NVCC CUDA交叉编译找不到“-lcudart” [英] NVCC CUDA cross compiling cannot find "-lcudart"

查看:4876
本文介绍了NVCC CUDA交叉编译找不到“-lcudart”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的Ubuntu虚拟机上安装了CUDA 5.0和NVCC,并且编译即使是基本的CUDA C程序也有问题。错误如下:

I have installed CUDA 5.0 and NVCC on my Ubuntu virtual machine and have had problems compiling even a basic CUDA C program. The error is as follows:

user@ubuntu:~/CUDA$ nvcc helloworld.cu -o helloworld.o -target-cpu-arch=ARM -ccbin=/usr/bin/arm-linux-gnueabi-gcc-4.6 --machine=32
/usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../arm-linux-gnueabi/bin/ld: skipping incompatible /usr/local/cuda-5.0/bin/../lib/libcudart.so when searching for -lcudart
/usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../arm-linux-gnueabi/bin/ld: skipping incompatible /usr/lib/libcudart.so when searching for -lcudart
/usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../arm-linux-gnueabi/bin/ld: cannot find -lcudart
collect2: ld returned 1 exit status

我试图研究这个问题,发现了这个链接:在搜索-lcudart 时跳过不兼容的libcudart.so

I have tried to research this problem and came across this link: skipping incompatible libcudart.so when searching for -lcudart

因此,我按照该链接提供的建议,添加了

And so I followed the advice that was offered on that link and added

 /usr/local/cuda-5.0/lib64 

/usr/local/cuda-5.0/lib 

到我的LD_LIBRARY_PATH环境变量,现在这是

to my LD_LIBRARY_PATH environment variable and now this is the result of the

  user@ubuntu:~/CUDA$ echo $LD_LIBRARY_PATH 
  /usr/local/cuda-5.0/lib:/usr/local/cuda-5.0/lib64
  user@ubuntu:~/CUDA$ 

但是,问题仍然存在,请帮助。

However, the problem still persists, please help.

推荐答案

原来,我从NVIDIA使用的CUDA安装程序不允许我交叉编译我的CARMA板,但它必须从制造商SECO下载。

It turns out that the CUDA installer I was using from NVIDIA will not allow me to cross compile for my CARMA board, but it has to be downloaded from the manufacturer SECO.

这篇关于NVCC CUDA交叉编译找不到“-lcudart”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆