Dummy libcuda.so.1 breaks NVIDIA IndeX plugin when running ParaView
nvidiaindex.install.cmake creates a "fake CUDA library", an empty file libcuda.so.1
or nvcuda.dll
in ${install_dir}/${dir}
.
The file does not end up in the final installation directory, but can still cause problems because of RPATH settings. It will be picked up by the NVIDIA IndeX plugin (or any other plugin that uses CUDA), causing CUDA initialization to fail. Depending on which CUDA API is used, the error message can simply be "CUDA driver insufficient", which does not make it easy to find the source of the problem.
As we have seen actual ParaView users running into this issue, would be possible to remove this dummy file, or at least place it somewhere else so that it does not end up in the library search path?
The binaries in the final installation directory (i.e. after make install
) have the RPATH set to the superbuild build directory:
$ readelf -d paraview-install/bin/pvserver | grep RPATH
0x000000000000000f (RPATH) Library rpath: [$ORIGIN/../lib:/home/user/paraview-superbuild-build/install/lib]
Is this intentional? The nightly ParaView packages do not seem to have this (RPATH is just $ORIGIN/../lib
).
The result of that RPATH is that running ParaView with the NIVDIA IndeX plugin will fail as long as the superbuild build directory is available. Removing that directory from the RPATH would also fix the issue, but removing the dummy file would also handle the case when a user tries to run ParaView from within the build directory.
The NVIDIA IndeX will now print a more helpful error message if it runs into this issue:
error: It appears that the NVIDIA driver is installed (current version: 450.36.06), but that the CUDA driver library is not available.
error: The CUDA driver library 'libcuda.so.1' failed to load: /home/user/paraview-superbuild-build/install/lib/libcuda.so.1: file too short