Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamically loading libnvidia-ml.so.1 instead of directly linking #313

Merged

Conversation

mdemoret-nv
Copy link
Contributor

Currently, we install the driver into one of the CI images to allow for stub generation during compilation. This was needed because device_info.cpp linked directly against CUDA::nvml. This caused a link dependency on a driver library which is problematic when building with CPU-only docker images.

Instead, we dynamically load libnvidia-ml.so.1 (appending the .so.1 to avoid collisions with the stub file libnvidia-ml.so) and the necessary functions at runtime. If the library is not found, using a GPU will be disabled. This allows loading of the library for stub generation without needing a GPU.

@mdemoret-nv mdemoret-nv added bug Something isn't working non-breaking Non-breaking change labels Apr 12, 2023
@mdemoret-nv mdemoret-nv requested a review from a team as a code owner April 12, 2023 17:01
@mdemoret-nv mdemoret-nv requested a review from a team as a code owner April 12, 2023 17:22
Copy link
Contributor

@dagardner-nv dagardner-nv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I wonder if there is any advantage to keeping container and test_container in the event that we ever do need additional packages for either the build or the test.

Similarly I think we should update the DOCKER_TARGET array in external/utilities/ci/runner/build_and_push.sh script to :

DOCKER_TARGET=${DOCKER_TARGET:-"build" "test"}

Even if for MRC the build and test targets remain aliases for base.

@mdemoret-nv
Copy link
Contributor Author

LGTM, I wonder if there is any advantage to keeping container and test_container in the event that we ever do need additional packages for either the build or the test.

Similarly I think we should update the DOCKER_TARGET array in external/utilities/ci/runner/build_and_push.sh script to :

DOCKER_TARGET=${DOCKER_TARGET:-"build" "test"}

Even if for MRC the build and test targets remain aliases for base.

Good point. Changed the names of the targets to build and test with the matching changes here: nv-morpheus/utilities#30

@codecov
Copy link

codecov bot commented Apr 13, 2023

Codecov Report

Merging #313 (62e1ca4) into branch-23.07 (c3f67c0) will decrease coverage by 0.04%.
The diff coverage is 56.60%.

Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff                @@
##           branch-23.07     #313      +/-   ##
================================================
- Coverage         73.28%   73.24%   -0.04%     
================================================
  Files               390      390              
  Lines             13352    13379      +27     
  Branches           1006     1008       +2     
================================================
+ Hits               9785     9800      +15     
- Misses             3567     3579      +12     
Flag Coverage Δ
cpp 69.07% <56.60%> (-0.04%) ⬇️
py 42.22% <56.60%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cpp/mrc/src/tests/test_topology.cpp 98.41% <ø> (-0.05%) ⬇️
cpp/mrc/src/internal/system/topology.cpp 83.33% <50.00%> (-0.72%) ⬇️
cpp/mrc/src/internal/system/device_info.cpp 55.55% <56.86%> (+2.61%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c3f67c0...62e1ca4. Read the comment docs.

@mdemoret-nv
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit 25d9ca8 into nv-morpheus:branch-23.07 Apr 13, 2023
@mdemoret-nv mdemoret-nv deleted the mdd_remove-nvml-direct-dep branch April 13, 2023 02:53
rapids-bot bot pushed a commit to nv-morpheus/Morpheus that referenced this pull request Apr 13, 2023
This PR is follows the MRC PR: nv-morpheus/MRC#313 which removes the explicit dependency on `libnvidia-ml.so` which allows us to no longer need the driver installed in our CI runner.

This allows us to use the `gpu-v100-latest-1` tag to stay up to date with the CI images.

@jjacobelli for Viz

Authors:
  - Michael Demoret (https://github.com/mdemoret-nv)

Approvers:
  - David Gardner (https://github.com/dagardner-nv)

URL: #877
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working non-breaking Non-breaking change
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants