I have successfully installed CUDA 5.0 on my Ubuntu 12.10, with driver 304.54, toolkit and samples. Running deviceQuery gives me a successful output:

    Detected 1 CUDA Capable device(s)

      Device 0: "GeForce 9500 GT"
      CUDA Driver Version / Runtime Version          5.0 / 5.0
      CUDA Capability Major/Minor version number:    1.1
      Total amount of global memory:                 512 MBytes (536543232 bytes)
      ( 4) Multiprocessors x (  8) CUDA Cores/MP:    32 CUDA Cores


bandwidthTest is also successful:

     Device 0: GeForce 9500 GT
     Quick Mode

     Host to Device Bandwidth, 1 Device(s)
     PINNED Memory Transfers
       Transfer Size (Bytes)    Bandwidth(MB/s)
       33554432         5628.6


I stress that my card is listed among the compatible CUDA cards for Mathematica. However, in Mathematica, running







    CUDAInformation::invdriv : CUDA was not able to find a valid CUDA driver.
    Refer to CUDALink System Requirements

and running



    CUDADriverVersion::nodriv : 
    CUDALink was not able to locate the NVIDIA driver binary.
    Refer to CUDALink System Requirements

So it cannot find both the binary and the libraries, and referring to the CUDALink system requirements help page is not helping. Any ideas?

  • $\begingroup$ Ziofil.. How do you set up the path? $\endgroup$ Commented Jan 29, 2014 at 6:31

2 Answers 2


Ahh! The solution is to export NVIDIA_DRIVER_LIBRARY_PATH to the full path /usr/lib/libnvidia-tls.so.304.54 and CUDA_LIBRARY_PATH to /usr/lib/libcuda.so.304.54! (for my driver version)

What a lovely way to waste an afternoon.


Please check where your libnvidia-tls.so.* and your libcuda.so is installed. When I'm not mistaken, they are under /usr/lib in ubuntu. Now read this tutorial and find that Mathematica expects these libraries to be in /usr/lib64 for a 64bit Linux.

Therefore, close Mathematica and open a terminal and execute (you have to change the library version according to your system)

export NVIDIA_DRIVER_LIBRARY_PATH=/usr/lib/libnvidia-tls.so.310.32
export CUDA_LIBRARY_PATH=/usr/lib/libcuda.so

In the starting Mathematica try to run CUDAQ again and if this succeeds, then you know where the problem is.

From there you have the opportunity to either make links of the libraries to /usr/lib64 or you set the above environment variables in your Mathematica application launcher.

If you want to create a custom application launcher for your Mathematica which uses changed environment variables, you can do it by using env in the command line. For instance my launcher (because I need some Intel libs) looks like that

enter image description here

where the content of the Command is something like this

env LD_LIBRARY_PATH=/opt/intel/composer_xe_2013.1.117/tbb/lib/intel64   
  • $\begingroup$ You are right, they are in /usr/lib. Though, exporting those environment variables by hand does not seem to do anything (other than changing the values of GPUTools`Internal`$CUDALibraryPath and GPUTools`Internal`$NVIDIADriverLibraryPath to the exported values). I even tried to create simlinks to /usr/lib64, but no luck. Darn. $\endgroup$
    – Ziofil
    Commented Apr 9, 2013 at 22:15
  • 1
    $\begingroup$ @Ziofil Sorry, it was pretty late here and I had my Ubuntu already off and was writing it from memory without trying it. Of course you need to specify the location of the library itself. I fixed my post. $\endgroup$
    – halirutan
    Commented Apr 10, 2013 at 4:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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