I am writing an application using CUDA to be distributed on Linux systems and I have concerns regarding the dynamic linking to libcudart.so.
When linking my executable against -lcudart, only the major version number of libcudart.so, e.g. libcudart.so.4, is stored in the linked executable, regardless of the minor version of the CUDA runtime library that I linked against. Hence, if I built agains 4.1, the dynamic loader might load libcudart.so.4.0.xx. Through cudaGetRuntimeVersion() it is possible to get a number “4010” or “4000” which also gives the minor version number. In that way I can check that cudart is of the correct minor version number. However, there is no way that I know of, to check that the last digit, e.g. 28 in 4.1.28, is the same one in runtime as link time.
Furthermore, there seems (The Official NVIDIA Forums | NVIDIA) to be no cross compatibility between cudart versions at all, and one should ship the cudart librart together with the application (NVIDIA CUDA C Programming Guide 4.1, Ch. 3.2, first paragraph).
My interpretation (perhaps wrong) of this is that, if I build my application against, say cudart 4.0.22, then I need to use exactly libcudart.so.4.0.22, not even 4.0.23 or 4.1.28, to be sure my application will work.
Does anyone know if that is so?