I have an ASUS Notebook with nVidia gt 520m and thought about trying some OpenCL programming (first time) on Ubuntu 11.10. I installed the nvidia-current-dev package. Thus, I found libOpenCL.so and such in /usr/lib/nvidia-current/ folder:
$razvan@...:~$ locate libOpenCL.so
/usr/lib/nvidia-current/libOpenCL.so
/usr/lib/nvidia-current/libOpenCL.so.1
/usr/lib/nvidia-current/libOpenCL.so.1.0
/usr/lib/nvidia-current/libOpenCL.so.1.0.0
/usr/lib32/nvidia-current/libOpenCL.so
/usr/lib32/nvidia-current/libOpenCL.so.1
/usr/lib32/nvidia-current/libOpenCL.so.1.0
/usr/lib32/nvidia-current/libOpenCL.so.1.0.0
I then installed the CUDA Toolkit for Ubuntu 10.10 from nVidia website and also the NVIDIA GPU SDK (in /opt/gpu_sdk).
When I go to /opt/gpu_sdk/OpenCL and try the make command I get:
razvan@...:/opt/gpu_sdk/OpenCL$ make
make[1]: Entering directory `/opt/gpu_sdk/OpenCL/common'
a - obj/release/oclUtils.cpp.o
make[1]: Leaving directory `/opt/gpu_sdk/OpenCL/common'
make[1]: Entering directory `/opt/gpu_sdk/shared'
make[1]: Leaving directory `/opt/gpu_sdk/shared'
make -C src/oclConvolutionSeparable/
make[1]: Entering directory `/opt/gpu_sdk/OpenCL/src/oclConvolutionSeparable'
/usr/bin/ld: cannot find -lOpenCL
collect2: ld returned 1 exit status
make[1]: *** [../../..//OpenCL//bin//linux/release/oclConvolutionSeparable] Error 1
make[1]: Leaving directory `/opt/gpu_sdk/OpenCL/src/oclConvolutionSeparable'
make: *** [src/oclConvolutionSeparable/Makefile.ph_build] Error 2
Afeter installing the nvidia-current-dev package I went to /etc/ld.so.conf.d/ and made nvidia-current.conf where I specified /usr/lib/nvidia-current and /usr/lib32/nvidia-current. Then I used ldconfig for caching the new locations.
Needless to say, it didn't work. I also appended the /usr/lib/nvidia-current and /usr/lib32/nvidia-current to the LD_LIBRARY_PATH environment variable in the hope of working... it did not work.
LD_LIBRARY_PATH
which is related to /usr/bin/ld specifically, while I should have setLIBRARY_PATH
which is the correct environment variable for the gnu compiler (used here). I don't know the connection betweenLD_LIBRARY_PATH
andLIBRARY_PATH
(or in this caseld
andgcc
and whygcc
doesn't use theld
executable.. I thought that gcc is using it; but maybe someone experienced enough can answer that). – razvanc Nov 08 '11 at 16:37