Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

skipping incompatible libcudart.so when searching for -lcudart

Tags:

cuda

When I compile .cu file with nvcc 5.0, the compiler gives me following information.

/usr/bin/ld: skipping incompatible /usr/local/cuda-5.0/lib/libcudart.so when searching for -lcudart

It seems either a warning or an error. I don't know what the matter is.

Is there anyone knowing more details about this information?

like image 619
konjac Avatar asked Jun 13 '13 06:06

konjac


1 Answers

This warning often happens when trying to link a 64-bit code with a 32-bit library, see this question: Skipping Incompatible Libraries at compile.

You need to distinguish 2 library files:

  • $CUDA_HOME/lib/libcudart.so, the 32-bit version of the cudart library.
  • $CUDA_HOME/lib64/libcudart.so, the 64-bit version of the cudart library.

(in your case, $CUDA_HOME is /usr/local/cuda-5.0)

Basically, the linker finds the 32-bit library first (-L options are searched in order) and returns that warning even if it ends up finding the proper library.

You probably need to add $CUDA_HOME/lib64 to your LD_LIBRARY_PATH environment variable before $CUDA_HOME/lib so that ld can find the proper library for your 64-bit architecture before the 32-bit version.

like image 136
BenC Avatar answered Nov 15 '22 10:11

BenC