We want to develop an application that at startup detects whether there are any CUDA capable devices present. The application must be able to run on systems without any CUDA GPU drivers present. We use the CUDA Runtime API for our calculations. If there is no CUDA support we would like to fallback on the CPU.
Since we cannot assume that libcudart is present on the users systems, how do achieve this?
(1) Is it possible to statically link in libcudart? (the deviceQuery example shows “CUDART static linking” but is still dependent on libcudart, though)
(2) Is it possible to distribute the libcudart.so library together with the application, preferably in the application installation folder? (do you have to modify the executables RPATH to a relative location, or set LD_LIBRARY_PATH when running the app? Are these practices acceptable?)
(3) Do you have to rely on dynamically loading the library with ‘dlopen’?
I have seen this questions asked several times on the forum, but I can’t find any answers. Any help is appreciated!