Math libraries are in the LD_LIBRARY_PATH, still the linker cannot find them. However, explicitly indicating the location with -L, compiles and links perfectly: $nvfortran saxpy.cuf -L/nvidia/hpcsdk/Linux_x86_64/20.5/math_libs/10.2/lib64/ -lcublas -lcublasLt -lcurand
The SDK does not provide a module for math_libs, however we have created additional modules to loads math_libs so they can complement the compilers.
Try using the flag “-cudalibs=cublas,curand” instead of adding the CUDA libraries yourself. This is a convenience flag that will include the necessary library path that matches the CUDA version being used.
Note LD_LIBRARY_PATH isn’t used by the linker. It only applies to the loader when finding shared objects at runtime.
Try using “-cudalib=cublas” (i.e. no “s”) or use just “-cudalibs”. This is my typo above, I should have used “-cudalib”.
“-cubalibs” will include all the available CUDA libraries while “-cudalib=” allows individual selection.