cannot find -lcuda
I try compile deviceQuery,

but when i do his return the error:

make -C src/deviceQuery/
make[2]: Entering directory `/home/tiago/NVIDIA_GPU_Computing_SDK/C/src/deviceQuery'
/usr/bin/ld: cannot find -lcuda
collect2: ld returned 1 exit status
make[2]: *** [../../bin/linux/release/deviceQuery] Error 1
make[2]: Leaving directory `/home/tiago/NVIDIA_GPU_Computing_SDK/C/src/deviceQuery'
make[1]: *** [src/deviceQuery/Makefile.ph_build] Error 2
make[1]: Leaving directory `/home/tiago/NVIDIA_GPU_Computing_SDK/C'
make: *** [all] Error 2


Any can help me, I am using Fedora 15 with gcc 4.4.6
I try compile deviceQuery,



but when i do his return the error:



make -C src/deviceQuery/

make[2]: Entering directory `/home/tiago/NVIDIA_GPU_Computing_SDK/C/src/deviceQuery'

/usr/bin/ld: cannot find -lcuda

collect2: ld returned 1 exit status

make[2]: *** [../../bin/linux/release/deviceQuery] Error 1

make[2]: Leaving directory `/home/tiago/NVIDIA_GPU_Computing_SDK/C/src/deviceQuery'

make[1]: *** [src/deviceQuery/Makefile.ph_build] Error 2

make[1]: Leaving directory `/home/tiago/NVIDIA_GPU_Computing_SDK/C'

make: *** [all] Error 2





Any can help me, I am using Fedora 15 with gcc 4.4.6

Tiago Alves de Oliveira



Master's degree student at LCAD, UFES (Federal University of Espírito Santo)



BS in Computer Science from UNIFOR-MG

#1
Posted 01/05/2012 05:22 PM   
[quote name='tiagofga' date='05 January 2012 - 10:22 AM' timestamp='1325784128' post='1351993']

/usr/bin/ld: cannot find -lcuda

[/quote]

Try linking with -lcudart instead of -lcuda.
[quote name='tiagofga' date='05 January 2012 - 10:22 AM' timestamp='1325784128' post='1351993']



/usr/bin/ld: cannot find -lcuda







Try linking with -lcudart instead of -lcuda.

#2
Posted 01/06/2012 05:54 AM   
(I use Ubuntu 10, not Fedora.) Have you added the library installation folder (normally /usr/local/cuda/lib) to LD_LIBRARY_PATH? You also have to run ldconf after that to set up sonames.
(I use Ubuntu 10, not Fedora.) Have you added the library installation folder (normally /usr/local/cuda/lib) to LD_LIBRARY_PATH? You also have to run ldconf after that to set up sonames.

#3
Posted 01/09/2012 07:30 PM   
[quote name='memstick' date='09 January 2012 - 12:30 PM' timestamp='1326137411' post='1353770']
Have you added the library installation folder (normally /usr/local/cuda/lib) to LD_LIBRARY_PATH?
[/quote]

But if you do an ls -l on that directory, you'll see that there are no libcuda.so* files, so no matter what you do, -lcuda won't be found. (True for CUDA 4.0 on my system, anyway.)
[quote name='memstick' date='09 January 2012 - 12:30 PM' timestamp='1326137411' post='1353770']

Have you added the library installation folder (normally /usr/local/cuda/lib) to LD_LIBRARY_PATH?





But if you do an ls -l on that directory, you'll see that there are no libcuda.so* files, so no matter what you do, -lcuda won't be found. (True for CUDA 4.0 on my system, anyway.)

#4
Posted 01/10/2012 05:32 AM   
[quote name='jamesqf' date='10 January 2012 - 06:32 AM' timestamp='1326173542' post='1354035']
But if you do an ls -l on that directory, you'll see that there are no libcuda.so* files, so no matter what you do, -lcuda won't be found. (True for CUDA 4.0 on my system, anyway.)
[/quote]

Then it might be in /usr/local/cuda/lib64. It should be somewhere. I successfully link to it myself. Check the library installation paths in /usr/local/cuda/bin/nvcc.profile, maybe it's in one of those.
[quote name='jamesqf' date='10 January 2012 - 06:32 AM' timestamp='1326173542' post='1354035']

But if you do an ls -l on that directory, you'll see that there are no libcuda.so* files, so no matter what you do, -lcuda won't be found. (True for CUDA 4.0 on my system, anyway.)





Then it might be in /usr/local/cuda/lib64. It should be somewhere. I successfully link to it myself. Check the library installation paths in /usr/local/cuda/bin/nvcc.profile, maybe it's in one of those.

#5
Posted 01/10/2012 07:50 AM   
[quote name='memstick' date='10 January 2012 - 12:50 AM' timestamp='1326181805' post='1354062']
Then it might be in /usr/local/cuda/lib64. It should be somewhere. I successfully link to it myself. Check the library installation paths in /usr/local/cuda/bin/nvcc.profile, maybe it's in one of those.
[/quote]

No, there's only libcudart.so.* (4.0.17 in my installation). Likewise in nvcc.profile, it's -lcudart, not -lcuda.
[quote name='memstick' date='10 January 2012 - 12:50 AM' timestamp='1326181805' post='1354062']

Then it might be in /usr/local/cuda/lib64. It should be somewhere. I successfully link to it myself. Check the library installation paths in /usr/local/cuda/bin/nvcc.profile, maybe it's in one of those.





No, there's only libcudart.so.* (4.0.17 in my installation). Likewise in nvcc.profile, it's -lcudart, not -lcuda.

#6
Posted 01/11/2012 05:26 AM   
On my laptop it seems that lcuda.so is created under /usr/lib/. Do you have anything there?
On my laptop it seems that lcuda.so is created under /usr/lib/. Do you have anything there?

#7
Posted 01/11/2012 08:49 AM   
libcuda.so is installed by the driver ( in /usr/lib or /usr/lib64 depending on your OS), libcudart.so is in the toolkit.
If you are using the driver API, you need to link to libcuda, if you are using the runtime API you need to link to libcudart.
libcuda.so is installed by the driver ( in /usr/lib or /usr/lib64 depending on your OS), libcudart.so is in the toolkit.

If you are using the driver API, you need to link to libcuda, if you are using the runtime API you need to link to libcudart.

#8
Posted 01/11/2012 03:41 PM   
[quote name='mfatica' date='11 January 2012 - 08:41 AM' timestamp='1326296485' post='1354636']
libcuda.so is installed by the driver ( in /usr/lib or /usr/lib64 depending on your OS), libcudart.so is in the toolkit.
If you are using the driver API, you need to link to libcuda, if you are using the runtime API you need to link to libcudart.
[/quote]

Thanks for clearing this up. It makes a sort of sense, especially since I do a lot of work on my laptop, which does not have a CUDA device installed. The desktop machine which has the GPUs does have a libcuda in /usr/lib64, but my executables are always linked with -lcudart, since that works on either system. (And in fact my CUDA development directories on the desktop machine are just the notebook ones mounted via NFS.)

If you cared to expand on the differences between driver & runtime API (or point to some existing docs), I'd be interested.
[quote name='mfatica' date='11 January 2012 - 08:41 AM' timestamp='1326296485' post='1354636']

libcuda.so is installed by the driver ( in /usr/lib or /usr/lib64 depending on your OS), libcudart.so is in the toolkit.

If you are using the driver API, you need to link to libcuda, if you are using the runtime API you need to link to libcudart.





Thanks for clearing this up. It makes a sort of sense, especially since I do a lot of work on my laptop, which does not have a CUDA device installed. The desktop machine which has the GPUs does have a libcuda in /usr/lib64, but my executables are always linked with -lcudart, since that works on either system. (And in fact my CUDA development directories on the desktop machine are just the notebook ones mounted via NFS.)



If you cared to expand on the differences between driver & runtime API (or point to some existing docs), I'd be interested.

#9
Posted 01/11/2012 07:26 PM   
[quote name='mfatica' date='11 January 2012 - 08:41 AM' timestamp='1326296485' post='1354636']
libcuda.so is installed by the driver ( in /usr/lib or /usr/lib64 depending on your OS), libcudart.so is in the toolkit.
If you are using the driver API, you need to link to libcuda, if you are using the runtime API you need to link to libcudart.
[/quote]

Thanks for clearing this up. It makes a sort of sense, especially since I do a lot of work on my laptop, which does not have a CUDA device installed. The desktop machine which has the GPUs does have a libcuda in /usr/lib64, but my executables are always linked with -lcudart, since that works on either system. (And in fact my CUDA development directories on the desktop machine are just the notebook ones mounted via NFS.)

If you cared to expand on the differences between driver & runtime API (or point to some existing docs), I'd be interested.
[quote name='mfatica' date='11 January 2012 - 08:41 AM' timestamp='1326296485' post='1354636']

libcuda.so is installed by the driver ( in /usr/lib or /usr/lib64 depending on your OS), libcudart.so is in the toolkit.

If you are using the driver API, you need to link to libcuda, if you are using the runtime API you need to link to libcudart.





Thanks for clearing this up. It makes a sort of sense, especially since I do a lot of work on my laptop, which does not have a CUDA device installed. The desktop machine which has the GPUs does have a libcuda in /usr/lib64, but my executables are always linked with -lcudart, since that works on either system. (And in fact my CUDA development directories on the desktop machine are just the notebook ones mounted via NFS.)



If you cared to expand on the differences between driver & runtime API (or point to some existing docs), I'd be interested.

#10
Posted 01/11/2012 07:26 PM   
[quote name='jamesqf' date='10 January 2012 - 11:02 AM' timestamp='1326173542' post='1354035']
But if you do an ls -l on that directory, you'll see that there are no libcuda.so* files, so no matter what you do, -lcuda won't be found. (True for CUDA 4.0 on my system, anyway.)
[/quote]

I am using fedora 14. There was no libcuda.so at /usr/local/cuda/lib/. So I copied from /usr/lib/nvidia/ and make them. It works fine. Thanks a lot.
[quote name='jamesqf' date='10 January 2012 - 11:02 AM' timestamp='1326173542' post='1354035']

But if you do an ls -l on that directory, you'll see that there are no libcuda.so* files, so no matter what you do, -lcuda won't be found. (True for CUDA 4.0 on my system, anyway.)



I am using fedora 14. There was no libcuda.so at /usr/local/cuda/lib/. So I copied from /usr/lib/nvidia/ and make them. It works fine. Thanks a lot.

#11
Posted 04/11/2012 08:20 AM   
Arguably the safer option is adding [code]-L/usr/lib/nvidia-current[/code] to you linker flags. [url="http://stackoverflow.com/q/2716293#comment8885854_2716432"]In the case of the CUDA SDK[/url] change common.mk:148 to [code]LINKFLAGS += -L/usr/lib/nvidia-current[/code]
Arguably the safer option is adding
-L/usr/lib/nvidia-current
to you linker flags. In the case of the CUDA SDK change common.mk:148 to
LINKFLAGS += -L/usr/lib/nvidia-current

#12
Posted 06/27/2012 12:46 AM   
Scroll To Top