Skip incompatible libcudart.so when searching for -lcudart

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

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

This seems to be a warning or error. I do not know what the matter is.

Does anyone have more information about this information?

+6
source share
1 answer

This warning often occurs when trying to link 64-bit code to a 32-bit library, see this question: Skipping incompatible libraries during compilation .

You need to select 2 library files:

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

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

Basically, the linker first finds the 32-bit library (the -L parameters are executed in order) and returns this warning even if it finishes searching for the corresponding library.

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

+10
source

Source: https://habr.com/ru/post/947186/


All Articles