Getting OpenCL to work on Linux laptop with Optimus technology

General Tech Technology & Software 2 years ago

0 1 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Technology & Software related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

 

I have an installation of Kubuntu 13.10 on my laptop which has an Nvidia GT555m with optimus technology. I am having some trouble getting my C++ code with OpenCL to compile.

The error I keep getting is Cannot find -lOpenCL. Doing a quick search with the GNU find utility gives me the following:

/usr/lib32/nvidia-319/libOpenCL.so.1
/usr/lib32/nvidia-319/libOpenCL.so
/usr/lib32/nvidia-319/libOpenCL.so.1.0
/usr/lib32/nvidia-319/libOpenCL.so.1.0.0
/usr/lib/x86_64-linux-gnu/libOpenCL.so
/usr/lib/nvidia-319/libOpenCL.so.1
/usr/lib/nvidia-319/libOpenCL.so
/usr/lib/nvidia-319/libOpenCL.so.1.0
/usr/lib/nvidia-319/libOpenCL.so.1.0.0

I have the following OpenCL development packages installed:

opencl-headers
nvidia-opencl-dev

I also tried the utility clinfo to see if I get any information, but I get the following error:

clinfo: error while loading shared libraries: libOpenCL.so.1: cannot open shared object file: No such file or directory

Does anyone have any experience setting up a Linux development environment with OpenCL on their optimus laptops?

I was under the impression that I do not need to do anything fancy to get this working.

EDIT: Ok it seems the reason I was not managing to compile was because I was mixing up headers and libraries. Using the following compiles my code well:

g++ -std=c++11 -I /usr/local/cuda-5.5/include vadd.cpp -L /usr/lib/nvidia-331 -lOpenCL

I am getting another error during runtime now (but at least I managed to compile!). The error is as follows:

ERROR: clGetPlatformIDs
-1001

From doing some research this means I probably do not have the ICD portion of nvidias toolkit installed? What I cannot understand is - where to find it!

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.