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

Fix finding and linking NVML #550

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

Conversation

masterleinad
Copy link
Contributor

@masterleinad masterleinad commented Jun 12, 2024

Description

Without this fix NVML can't be found via standard CMake variables. With this, I can do

cmake -DVARIORUM_WITH_NVIDIA_GPU=ON -DNVML_ROOT=/usr/local/cuda-11.7/targets/x86_64-linux/ ../src

do find NVML. Requiring finding the include file and library also makes the error message at the end obsolete. Of course, it's up for discussion what the best error message is and I'm happy to change accordingly.

Finding CUDAToolkit allows me to configure without specifying any extra CMake arguments since the path is deduced from the nvcc location.

Also Variorum was linking against NVML_HEADER instead of NVML_LIBRARY resulting in link failures even when the library was found.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature/architecture support (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Build/CI update

How Has This Been Tested?

Configuring and building in a docker container based on top of nvidia/cuda:11.7.1-devel-ubuntu22.04 via

cmake _DVARIORUM_WITH_NVIDIA_GPU=ON -DNVML_ROOT=/usr/local/cuda-11.7/targets/x86_64-linux/ ../src

Test before merge:

  • Lassen

Checklist:

  • I have run ./scripts/check-code-format.sh and confirm my code code follows the style guidelines of variorum
  • I have added comments in my code
  • My changes generate no new warnings (build with -DENABLE_WARNINGS=ON)
  • New and existing unit tests pass with my changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants