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

NVCC Cuda 5.0 on Ubuntu 12.04 /usr/lib/libudt.so file format not recognized

我正在尝试在 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

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

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

我认为@kevinDTimm 和@talonmies 提到的是正确的:ARM 支持直到 CUDA5.5 才存在。 从官网下载CUDA5.0和ARM g++不能一起工作。

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

因此,对于正在使用 CARMA 板从事某些项目的任何其他人, 这里给大家一些提示:不要从官网下载CUDA5.0,从本站下载:cuda-linux-armv7-gnueabihf-cross-compilation-rel-5.0.47-15134578.run相反:url

这将同时支持CUDA5.0和ARM。但是,如前所述,这里的ARM只是为了交叉编译,在主机ubuntuVM中编译的代码只能在CARMA板上执行。