Monday, February 6, 2017

Installing CUDA

It took me about a week but I finally got it to work. I don't belabor the details but here is the summary:

1. Download CUDA toolkit 8.0
I used Ubuntu 16.04 LTS version of runfile (local)

2. Compute md5 sum:
$ md5sum cuda_8.0.44_linux.run

3. Remove CUDA toolkit 7.5
$ sudo apt-get purge nvidia-cuda*
$ sudo apt-get purge nvidia-*
(redundant but I did it to make sure)

4. Go to a terminal session
(ctrl+alt+F2)

5. Stop lightdm
$ sudo service lightdm stop

6. Install CUDA runfile
$ sudo sh cuda_8.0.44_linux.run --override

7. Start lightdm again
$ sudo service lightdm start 

8. Modify PATH 
$ export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}} 
$ export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64\${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

I basically followed the Installation Guide. Easy, right?

Here is my mistake. I realize that the CUDA driver version is 367 by default at this point.

9. Install the latest CUDA driver for Tesla K80 (= 375 at the time of this writing)
$ sudo apt-get install nvidia-375

Somehow driver 375 doesn't seem to do well in my system. When I run

$ nvidia-smi

I get the following error.

Failed to initialize NVML: Driver/library version mismatch 

After multiple repetition of the loop 1-9 above, I just gave up installing driver 375 and everything seems to be working well. Now I have

CUDA Toolkit 8.0
CUDA driver 367
and... MATLAB does recognize Tesla K80!






 

No comments:

Post a Comment