Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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

      etc...

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

     etc...

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

    Needs["CUDALink`"]
    CUDAQ[]

returns

    False

running

    CUDAInformation[]

returns

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

and running

    CUDADriverVersion[]

returns

    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?

share|improve this question
    
Ziofil.. How do you set up the path? –  Jose E Calderon Jan 29 at 6:31
add comment

2 Answers

up vote 2 down vote accepted

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
mathematica

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   
 /usr/local/Wolfram/Mathematica/9.0/Executables/Mathematica
share|improve this answer
    
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. –  Ziofil Apr 9 '13 at 22:15
1  
@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. –  halirutan Apr 10 '13 at 4:59
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

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.