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