0
The toolkit and items 1-6 of the NVIDIA_CUDA SDK have been installed and compiled , but when it gets to '6_Advanced/cdpLUDecomposition' the following error message appears.

  /usr/local/cuda-5.0/bin/nvcc -m64 -Xcompiler -fopenmp -gencode arch=compute_35,code=sm_35  -o cdpLUDecomposition dlaswp.o dgetf2.o dgetrf.o cdp_lu.o cdp_lu_main.o -L/usr/local/cuda-5.0/lib64 -lcublas -lcublas_device -lcudadevrt -lgomp 
/usr/local/cuda-5.0/lib64/libcublas.so: error: undefined reference to 'dlsym'
/usr/local/cuda-5.0/lib64/libcublas.so: error: undefined reference to 'dlopen'
/usr/local/cuda-5.0/lib64/libcublas.so: error: undefined reference to 'dlclose'
collect2: ld returned 1 exit status
make[1]: *** [cdpLUDecomposition] Error 1

我对 Ubuntu 和 Cuda 都是新手,但确实尝试在 make 之前添加 LD_FLAGS=-ldl 这没有帮助,并将 PATH 和 LD_LIBRARY_PATH 设置为 Nvidia 建议。此外,我更新了所有驱动程序,并能够从 SDK deviceQuery Program 获得有效结果。

任何帮助将不胜感激,因为我尝试过的所有其他方法都没有奏效。

4

1 回答 1

1

添加-ldl应该足够了。进入示例目录(cd 6_Advanced/cdpLUDecomposition)并检查构建命令make。在我的机器上是

/usr/local/cuda-5.0/bin/nvcc -m64 -Xcompiler -fopenmp -gencode arch=compute_35,code=sm_35 -o cdpLUDecomposition dlaswp.o dgetf2.o dgetrf.o cdp_lu.o cdp_lu_main.o -L/usr/本地/cuda-5.0/lib64 -lcublas -lcublas_device -lcudadevrt -lgomp

你可以

  • 运行构建命令手动附加-ldl,或
  • 通过附加-ldl到正确的 LDFLAGS(第 89 行)来修复目录中的 Makefile,这对于下一次重建来说更干净、更安全

ldd cdpLUDecomposition然后显示它链接到 /lib/x86_64-linux-gnu/libdl.so.2。

于 2013-02-09T11:55:26.237 回答