1

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

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 

and

/usr/local/cuda-5.0/lib 

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.

Community
  • 1
  • 1
mib1413456
  • 337
  • 1
  • 3
  • 16
  • 1
    Are you sure that the toolkit version you installed has ARM support? – talonmies Jun 08 '15 at 05:12
  • I installed the .run file from the website, the reason why I used CUDA 5.0 and not the latest was because my project is not using the latest version. – mib1413456 Jun 08 '15 at 05:32
  • That isn't what I asked. The error is happening because not because the runtime library can't be found, but because the ARM version can't be found. So I repeat my question - does the toolkit version you installed actually have an ARM runtime library? – talonmies Jun 08 '15 at 05:35
  • How can I check whether it has an ARM runtime library? – mib1413456 Jun 08 '15 at 05:36
  • 1
    Read the release notes that came with the tookit, and look in the toolkit installation directory for it. I doubt you will find anything, my hazy memory tells me ARM support was only added to CUDA in the 5.5 release – talonmies Jun 08 '15 at 05:46

5 Answers5

1

CUDA 5.5 was the first CUDA release to support ARM v7. The CUDA 5.0 toolkit you installed does not have support, which is why it can't find the right version of the CUDA runtime library.

harrism
  • 26,505
  • 2
  • 57
  • 88
  • I tried CUDA 5.5, 6.5...it still does not compile, currently still trying new methods, but thanks for your input. – mib1413456 Jun 10 '15 at 06:38
  • Would this be helpful? http://devblogs.nvidia.com/parallelforall/nvidia-nsight-eclipse-edition-for-jetson-tk1/ – harrism Jun 11 '15 at 02:09
0

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.

mib1413456
  • 337
  • 1
  • 3
  • 16
0

May be, it's a problem with Cuda Toolkits. The first the Cuda Toolkit 5.0 doesn't support Arm. The second the Cuda Toolkit 6.5 cross compile lost libcudart.so. I solved this problem is copying libcudart.so from the Cuda Toolkit 6.5 by Arm.

AlexanderKomarov
  • 400
  • 5
  • 11
0

in ~/.bashrc add the following

export PATH=/usr/local/cuda-5.0/bin:$PATH

export LD_LIBRARY_PATH=/usr/local/cuda-5.0/lib64:$LD_LIBRARY_PATH

in the following file -> /etc/ld.so.conf.d/cuda.conf

/usr/local/cuda-5.0/lib64

run: sudo ldconfig

Community
  • 1
  • 1
rigo
  • 326
  • 2
  • 9
-3

add /etc/ld.so.conf this:

/usr/local/cuda-5.0/lib /usr/local/cuda-5.0/lib64

and run command: ldconfig your compile will find cudart lib

Liyuan Liu
  • 172
  • 2
  • 1
    This is irrelevant and has no effect on compilation behaviour. Plus, you absolutely *never* want to do this in a cross compilation environment. That would have your operating system searching through foreign architecture libraries, which will slow down application launch and cause very hard to diagnose runtime errors. – talonmies Jun 08 '15 at 05:38