2013-02-15 192 views
0

CUDA编程指南指出:正确认识CUDA版本和兼容性

the driver API is backward compatible, meaning that applications, plug-ins, and libraries (including the C runtime) compiled against a particular version of the driver API will continue to work on subsequent device driver releases 

我明白这是说,如果我的代码是在CUDA4编译二进制将在CUDA5运行。然而,事实证明,上运行CUDA5的CUDA5编译的二进制导致:

error while loading shared libraries: libcudart.so.4: cannot open shared object file: No such file or directory 

请注意,我使用Linux中的“模块”设施,以不同CUDA版本之间进行切换的,即

module load cuda4 
compile 
module unload cuda4 
module load cuda5 
run 

回答

2

开发者有责任将libcudart.so.4与应用程序一起打包。模块命令可能会更改您的LD_LIBRARY_PATH或PATH变量,因此LDD未找到libcudart.so.4。我建议您添加一个后期构建步骤,将所需的.so复制到您的应用程序目录中。

CUDA工具包目录根目录下的EULA.txt中的附件A列出了可再发行组件软件。这包括libcudart.so(以及在文件名中嵌入版本号信息的变体)。这还包括libcufft,libcublas,...