2013-02-15 193 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,...