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 verify the installation of CUDA and am running into some issues. I have successfully built all of the examples that come with the GPU computing SDK. When I try to run deviceQuery however, I get an error saying that can not be found.





Inside of that directory is a file:

What other sort of errors could be causing the library to not be located?

EDIT for Fran's answer:

  1. Yes, I am exporting the variable
  2. I am not sure if the program is 64-bit, however it came as part of a 64-bit SDK install, so I would like to assume it is
  3. Output of ldd:

    #ldd deviceQuery =>  (0x00007fff94ecc000) => /usr/local/cuda/lib64/ (0x00007f2d4658a000) => /usr/lib64/ (0x00007f2d45b1e000) => /usr/lib64/ (0x00000037f1200000) => /lib64/ (0x00000037e5e00000) => /lib64/ (0x00000037f0600000) => /lib64/ (0x00000037e5600000) => /lib64/ (0x00000037e5a00000) => /lib64/ (0x00000037e5200000) => /lib64/ (0x00000037e6200000) => /lib64/ (0x00000037e6e00000)
    /lib64/ (0x00000037e4e00000)

I have found that I can run it as a normal user, but doing so causes it to fail since the user does not have access to the GPU. Running it with sudo causes the missing file error.


sudo ldd deviceQuery

confirms the missing on the second line of the output.

share|improve this question
up vote 1 down vote accepted
  1. Did you export LD_LIBRARY_PATH from the shell in which you are running the program?

  2. Are both the program and shared library 64-bit binaries (or both 32-bit binaries)?

  3. What is the output of ldd program, where program is the program that can't find the library at runtime?

share|improve this answer
I have updated the question with the information you requested. – Godric Seer May 30 '12 at 23:48
I found that the drivers were not being initialized on boot, so what I thought was an error for the user was in-fact correct. Creating a startup script to initialize the driver solved the issue and gives the proper result. – Godric Seer May 31 '12 at 0:29

If you are building from source, you have the option to build it such that it uses an existing library path via --prefix= or --libdir=. Otherwise you can:

  • add /usr/local/cuda/lib64 to the LD_LIBRARY_PATH in /etc/profile
  • move it manually (to /usr/local/ for example) and make a symlink for /usr/local/cuda to /usr/local
  • use LDPRELOAD to preload the missing libs manually

Just a quick reminder on LD_LIBRARY_PATH - keep in mind that the more paths you add, the more the dynamic linker has to look through to find it.

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.