Message Boards Message Boards

Unable to get CUDA to link to Mathematica , using Ubuntu 14.04

Posted 9 years ago

I have a new computer running Ubuntu 14.04 and Mathematica I have a NVidia GTX 750ti video card.

I installed the latest 352.21 Nvidia drivers for this card, and tried installing CUDA 7 but was unable to get it to link to CUDA ;


Now shows false. The first time it downloaded some information.

It seemed the problem might be with directory paths; see;

This is the absolute path to the NVIDIA driver library.

The library is installed by the NVIDIA driver package downloaded from the NVIDIA driver download website.

"Linux-x86-64" "/usr/lib64/*"

Default path to the NVIDIA driver library in case NVIDIADRIVERLIBRARY_PATH is not defined.

(the previewer is eliminating the underscores in NVIDIADRIVERLIBRARYPATH and CUDALIBRARY_PATH, I did enter them correctly)

I set in my .profile; NVIDIADRIVERLIBRARY_PATH=/usr/lib/nvidia-352/

This is the absolute path to the CUDA library. The library is installed by the NVIDIA driver package downloaded from the NVIDIA driver download website. "Linux-x86-64" "/usr/lib64/" Default path to the CUDA Library in case CUDALIBRARYPATH is not defined.

It appears CUDA 7 does not have a file, so I uninstalled CUDA 7 and tried CUDA 6.5, using the Ubuntu Software Center repository, I installed CUDA Toolkit 6.5 meta-package. (32.8k, 14 Sept 2014) is now in /usr/local/cuda-6.5/lib64/stubs, so I set my .profile

export PATH=/usr/local/cuda-6.5/bin:$PATH #CUDA

export LDLIBRARYPATH=/usr/local/cuda-6.5/lib64/stubs/$LDLIBRARYPATH #LIBPATH



gives false.

POSTED BY: Stuart Anderson
7 Replies

To add to the above. I could not get Ubuntu 16.04 and Mathematica (Linux) working using the solution above.

However it DOES WORK with Ubuntu 16.04 and Mathematica (Linux)

POSTED BY: Stuart Anderson
Posted 9 years ago

Thanks. This works for me too.


POSTED BY: Asim Ansari

I have been successful in getting CUDALink working. My solution was to use symlinks.

I have managed to get CUDALink working on an ubuntu 14.04 with an NVidia GTX 750 Ti with CUDA 7 toolkit (installed the toolkit following these instructions.

I have never been able to change NVIDIA_DRIVER_LIBRARY_PATH and CUDA_LIBRARY_PATH using env variables and get CUDALink to work.

I assume the Mathematica CUDA and Nvidia library paths as hardwired and I use symlinks from the libraries to the default locations where Mathematica is looking. It works for me! Mathematica is looking in /usr/lib64, this does not exist on my system, so;

cd /usr sudo mkdir lib64

Locate your file, I used find

stuart@stuart-2015:~$ find / -name* 2>/dev/null /usr/lib/nvidia-346/ /usr/lib/nvidia-346/tls/ /usr/lib32/nvidia-346/ /usr/lib32/nvidia-346/tls/

I have a 64bit system, I ignore the lib32 libraries, I have 2 choices;

/usr/lib/nvidia-346/ /usr/lib/nvidia-346/tls/

these are actually different files, I dont know what the difference is, or which is preferred, but there are only two choices, so I try the second file first and symlink like so;

sudo ln -s /usr/lib/nvidia-346/tls/ /usr/lib64/

With the cuda library, we find these files;

find / -name 2>/dev/null /usr/lib/i386-linux-gnu/ /usr/lib/x86_64-linux-gnu/ /usr/local/cuda-7.0/targets/x86_64-linux/lib/stubs/

I need the 64-bit version, issue the symlink command;

sudo ln -s /usr/lib/x86_64-linux-gnu/ /usr/lib64/

Now open Mathematica and test;

CUDA test

POSTED BY: Stuart Anderson

I lodged a bug report with support on 3rd August 2015, got the acknowledgement; Hello,

Thank you for taking the time to send in this report.

Our development team is aware of this issue with CUDALink in Linux. I have appended your contact information to the existing report.

If you run into any other behavior problems please don't hesitate to contact us at


Anmol Bajracharya Technical Support Wolfram Research, Inc.

POSTED BY: Stuart Anderson

I do not have it working. I have followed all instructions, have set the paths correctly, CUDA is working, but Mathematica will not load the libraries. I think this version of the software is buggy.

POSTED BY: Stuart Anderson
Posted 9 years ago

It is not clear from the above whether you were able to solve the problem. I have a similar issue which I have not been able to solve.

POSTED BY: Asim Ansari

I started with a clean install. Then installed the CUDA 7 runtime, carefully following the Nvidia instructions; Even though there is a 352.21 driver for the NVidia GTX 750ti, it shouldnt be used.

stuart@stuart-All-Series:~/NVIDIA_CUDA-7.0_Samples/1_Utilities/deviceQuery$ ./deviceQuery ./deviceQuery Starting...

CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)

Device 0: "GeForce GTX 750 Ti" CUDA Driver Version / Runtime Version 7.0 / 7.0 CUDA Capability Major/Minor version number: 5.0 Total amount of global memory: 2048 MBytes (2147155968 bytes) ( 5) Multiprocessors, (128) CUDA Cores/MP: 640 CUDA Cores GPU Max Clock rate: 1242 MHz (1.24 GHz) Memory Clock rate: 2700 Mhz Memory Bus Width: 128-bit L2 Cache Size: 2097152 bytes Maximum Texture Dimension Size (x,y,z) 1D=(65536), 2D=(65536, 65536), 3D=(4096, 4096, 4096) Maximum Layered 1D Texture Size, (num) layers 1D=(16384), 2048 layers Maximum Layered 2D Texture Size, (num) layers 2D=(16384, 16384), 2048 layers Total amount of constant memory: 65536 bytes Total amount of shared memory per block: 49152 bytes Total number of registers available per block: 65536 Warp size: 32 Maximum number of threads per multiprocessor: 2048 Maximum number of threads per block: 1024 Max dimension size of a thread block (x,y,z): (1024, 1024, 64) Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535) Maximum memory pitch: 2147483647 bytes Texture alignment: 512 bytes Concurrent copy and kernel execution: Yes with 1 copy engine(s) Run time limit on kernels: Yes Integrated GPU sharing Host Memory: No Support host page-locked memory mapping: Yes Alignment requirement for Surfaces: Yes Device has ECC support: Disabled Device supports Unified Addressing (UVA): Yes Device PCI Domain ID / Bus ID / location ID: 0 / 6 / 0 Compute Mode: < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 7.0, CUDA Runtime Version = 7.0, NumDevs = 1, Device0 = GeForce GTX 750 Ti Result = PASS

POSTED BY: Stuart Anderson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract