FindCUDA.cmake: Please add library variable for NVIDIA Management Library (NVML)
Hello, I have a request for the FindCUDA.cmake module.
NVIDIA has made a library for the management and monitoring of their GPU's: https://developer.nvidia.com/nvidia-management-library-nvml
Since CUDA 8, this library is shipped within the CUDA SDK.
In fact, the CUDA SDK ships only a stub library that should be usable for linking, whereas the real library is shipped with along with the NVIDIA GPU driver installation.
The stub library can be found here: ${CUDA_TOOLKIT_ROOT_DIR}/lib64/stubs/libnvidia-ml.so
The actual library (that only comes with the driver) can be found in /usr/lib64/libnvidia-ml.so
or /usr/lib64/nvidia/libnvidia-ml.so
, however I believe that in the context of a build system it would be better to provide the path to the stub library, not the real one.
I suggest to add a CMake variable that is set by FindCUDA.cmake, either CUDA_nvidia-ml_LIBRARY
or CUDA_nvidia-ml- stub_LIBRARY
. This variable should hold the path to the nvidia-ml library, so that it can be used within a target_link_libraries
call to properly link against that library.
That would be very appreciated :)