gpt4 book ai didi

ubuntu - Ubuntu 12.04 上的 NVCC Cuda 5.0/usr/lib/libudt.so 文件格式无法识别

转载 作者:行者123 更新时间:2023-12-04 19:18:00 37 4
gpt4 key购买 nike

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

然后我的一个 friend 告诉我,这个错误信息意味着我需要安装 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 重复,但实际上我在这里遇到了不同的问题。

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

最佳答案

我认为@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.从这个网站运行:url

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

关于ubuntu - Ubuntu 12.04 上的 NVCC Cuda 5.0/usr/lib/libudt.so 文件格式无法识别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30760937/

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com