NVCC Cuda 5.0对Ubuntu 12.04 /usr/lib/libudt.so文件格式无法识别

时间:2015-06-10 15:35:00

标签: ubuntu cuda nvcc

我正在尝试在Ubuntu 12.04上安装CUDA 5.0以进行并行编程。我需要使用NVCC交叉编译功能,因此,在安装CUDA 5.0(也成功添加到路径)后,使用 NVCC交叉编译时出错。

这是我想要运行的命令:

nvcc -gencode arch=compute_20,code=sm_20 -Xptxas -v test.cu -o test -DLINUX -DIA32 -target-cpu-arch=ARM -ccbin=/usr/bin/arm-linux-gnueabihf-g++-4.6 -m32 -O3 -Xcompiler -fopenmp -I/usr/local/include -L/usr/local/lib -I/usr/include/thrust -ludt -lstdc++ -lpthread -lm -L/usr/local/cuda-5.0/lib -L/usr/local/cuda-5.0/lib -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include

最初,它失败并显示以下错误消息:

ptxas info : 0 bytes gmem
ptxas info : Compiling entry function '_Z5helloPcPi' for 'sm_20'
ptxas info : Function properties for _Z5helloPcPi
     0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 5 registers, 40 bytes cemm[0]
/usr/lib/gcc/arm-linux-gnueabifh/4.6/../../../../arm-linux-gnueabifh/bin/ld:can not find -ludt
collect2: ld returned 1 exit status

然后我的一个朋友告诉我,这个错误信息意味着我需要安装udt,所以我尝试安装udt。

sudo apt-get install libudt-dev

它确实解决了这个错误,但是会出现一个新错误:

ptxas info    : 0 bytes gmem
ptxas info    : Compiling entry function '_Z5helloPcPi' for 'sm_20'
ptxas info    : Function properties for _Z5helloPcPi
     0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Used 5 registers, 40 bytes cmem[0]
/usr/lib/libudt.so: file not recognized: File format not recognized
collect2: ld returned 1 exit status

我在线搜索,有些人建议我应该更新我的GCC和G ++,我这样做了,不行。

有关更多信息,这是我安装的库(添加了系统路径):

gcc, g++, cuda 5.0, ia32-libs, libudt-dev, freeglut3-dev, build-essential, libx11-dev, libxmu-dev, libxi-dev, libgl1-mesa-glx,libglu1-mesa,libglu1-mesa-dev

这个问题可能与this重复,但实际上我在这里遇到了不同的问题。

希望你能与我分享你对这个问题的解决方案,我将非常感激,因为我已经遭受了好几天的痛苦。

1 个答案:

答案 0 :(得分:1)

我认为@kevinDTimm和@talonmies所提到的是正确的:在CUDA5.5之前不存在ARM支持。 从官方网站和ARM g ++下载CUDA5.0无法一起工作。

就我而言,我的项目需要CUDA5.0和ARM,因为我们正在开发CARMA板。我必须使用CUDA5.0用于CARMA板,而ARM用于在将文件传输到CARMA板之前编译代码。

因此,对于使用CARMA板进行某些项目的其他人, 这里有一些提示:不要从官方网站下载CUDA5.0,请从这个网站下载:cuda-linux-armv7-gnueabihf-cross-compilation-rel-5.0.47-15134578.run:{{3} }

这将一起支持CUDA5.0和ARM。但是,如上所述,ARM仅用于交叉编译,主机ubuntu VM中编译的代码只能在CARMA板上执行。

相关问题