Closed dominikborkowski closed 6 years ago
This seems reasonable to me. Would you like to open a PR against the CUDA easyblock? You just need to add a line at https://github.com/easybuilders/easybuild-easyblocks/blob/master/easybuild/easyblocks/c/cuda.py#L171
'LIBRARY_PATH': os.path.join(lib_path, 'stubs'),
Looks like AndiH beat me to the PR. Thank you!
I am closing this issue, as it has been fixed here: https://github.com/easybuilders/easybuild-easyblocks/pull/1464
Many applications link against libcuda.so.1 which is available in full in the cuda driver package. When one attempts to compile cuda enabled aps, for example TensorFlow-1.7.0-foss-2018a-Python-3.6.4-CUDA-9.1.85.eb, on a system without that external package, compilation will fail while trying to link.
There is a potential simple fix, which would allow full compilation of CUDA apps with the existing CUDA provided by CUDA-9.1.85.eb, and it involves library stubs. Per Nvidia's documentation from http://developer.download.nvidia.com/compute/cuda/6_5/rel/docs/CUDA_Toolkit_Release_Notes.pdf
"On Linux, stubs that applications can link against at build time have been added for each library. This removes the need to have the full library installed when building an application. In addition to the CUDA Toolkit libraries, a stub has been provided for the CUDA Driver library (libcuda.so). See the NVIDIA CUDA Getting Started Guide for LINUX for details on how to use these stubs."
By adding
lib64/stubs
location to LIBRARY_PATH in CUDA-9.1.85.eb applications now can link properly. For example:This has a potential to allow people to compile code on systems that do not have the cuda driver system packages installed, and it seems to be fully blessed by Nvidia.
Cheers!