Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am attempting to install ViennaCL-1.2.1 in scientific linux for future GPU computing. When I attempt to call make, i get a variety of errors, with most along the lines "undefined reference to 'clXXXXX'. I am assuming this is due to it not properly finding my OpenCL library. What I don't know is if I have the sufficient libraries. In /usr/lib I have, and I have installed the most up-to-date NVIDIA driver for my graphics card. The driver supports OpenCL, but do I need more downloads from the NVIDIA site to use the ViennaCL library?

EDIT: I solved the above make issue (I believe) by simply rerunning cmake. I think that I hadn't properly installed the libraries when I first ran cmake and it made silent errors when creating the make files. However this has simply changed the nature of the problem.

Now, whenever I run any of the tutorials or benchmarks included with ViennaCL, I get a fatal error, where 'ViennaCL encountered an unknown OpenCL Error'. It says this could be due to several compilation errors, but does not go into any further detail. The only one that does not throw an error is 'bandwidth-reduction' which from the manual is found to be the only one that does not require OpenCL.

For reference, here is my installation process for ViennaCL and the GPU drivers:

- sftp ViennaCL-1.2.1 to ~/Documents/packageInstall
- cd /usr/include
- sudo mkdir viennacl
- sudo cp -r ~/Documents/packageInstall/ViennaCL-1.2.1/viennacl/* /usr/include/viennacl
- sudo mkdir CL
- sudo cp -r ~/Documents/packageInstall/ViennaCL-1.2.1/CL/* /usr/include/CL
- sftp to ~/Documents/packageInstall
- sftp to ~/Documents/packageInstall
- cd ~/Documents/packageInstall
- sudo sh ./
- sudo sh ./
- cd ViennaCL-1.2.1/build
- cmake ..
- sudo make
- ./examples/tutorial/blas1 (or any other example)
share|improve this question

You're right, this sounds a lot like a linker error.
Please make sure the linker flags are correctly set, e.g. -lOpenCL

share|improve this answer
you were right, it is an OpenCL library access problem, but I am still unable to find what the problem is. I believe I have corrected the linker flag issue however. – Godric Seer May 29 '12 at 19:29
up vote 0 down vote accepted

With significant pointers from Karl Rupp, I solved the problem by adding the user attempting to run the programs to the 'Video' group, then also manually starting the nvidia service on each boot. The 'Video' group was required to allow access to the OpenCL library, and the drivers must be initiated for the GPU to be accessible.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.