2

I am trying to run some Theano script using THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32 python gpu_test.py, I get the following error message:

WARNING (theano.sandbox.cuda): CUDA is installed, but device gpu is not available  
(error: Unable to get the number of gpus available: no CUDA-capable device is detected)

I run Kubuntu 15.10 x64 with a Nvidia GTX 690.

CUDA seems to be correctly installed:

f@f-Aurora-R4:~/theano$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2014 NVIDIA Corporation
Built on Thu_Jul_17_21:41:27_CDT_2014
Cuda compilation tools, release 6.5, V6.5.12

f@f-Aurora-R4:~/theano$ nvidia-smi  
Sat Nov 14 21:18:51 2015       
+------------------------------------------------------+                       
| NVIDIA-SMI 4.304...   Driver Version: 304.128        |                       
|-------------------------------+----------------------+----------------------+
| GPU  Name                     | Bus-Id        Disp.  | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap| Memory-Usage         | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 690          | 0000:04:00.0     N/A |                  N/A |
| 30%   33C  N/A     N/A /  N/A |   0%    8MB / 2047MB |     N/A      Default |
+-------------------------------+----------------------+----------------------+
|   1  GeForce GTX 690          | 0000:05:00.0     N/A |                  N/A |
| 30%   36C  N/A     N/A /  N/A |  12%  237MB / 2047MB |     N/A      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Compute processes:                                               GPU Memory |
|  GPU       PID  Process name                                     Usage      |
|=============================================================================|
|    0            Not Supported                                               |
|    1            Not Supported                                               |
+-----------------------------------------------------------------------------+

I used the instructions from the official guide Easy Installation of an Optimized Theano on Current Ubuntu, on a fresh installation of Kubuntu, namely:

# Python requirements
sudo apt-get -y install python-numpy python-scipy python-dev python-pip 
sudo apt-get -y install python-nose g++ libopenblas-dev git

# Install Theano:
sudo pip install Theano

# Add GPU requirements
sudo apt-get install nvidia-current
sudo apt-get install nvidia-cuda-toolkit 
sudo apt-get install cuda

Then I created a .theanorc file in that contains in my home folder (namely /home/f/.theanorc):

[cuda]
root = /usr/lib/nvidia-cuda-toolkit

and I rebooted.

Did I miss something?


I tried the following commands but get the same error:

# Tried specifying the GPU:
THEANO_FLAGS=mode=FAST_RUN,device=gpu0,floatX=float32 python gpu_test.py
THEANO_FLAGS=mode=FAST_RUN,device=gpu1,floatX=float32 python gpu_test.py

# Tried pointing to CUDA:
THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32,cuda.root=/usr/lib/nvidia-cuda-toolkit  python gpu_test.py
THEANO_FLAGS=mode=FAST_RUN,device=gpu0,floatX=float32,cuda.root=/usr/lib/nvidia-cuda-toolkit  python gpu_test.py
THEANO_FLAGS=mode=FAST_RUN,device=gpu1,floatX=float32,cuda.root=/usr/lib/nvidia-cuda-toolkit  python gpu_test.py
Franck Dernoncourt
  • 77,520
  • 72
  • 342
  • 501
  • 2
    Your 304.xx driver is suitable for CUDA 5.0 or before. CUDA 6.5 requires a 340.xx or newer driver. I suggest installing a newer driver for your GPU. – Robert Crovella Nov 15 '15 at 03:13
  • @RobertCrovella Thanks, how to know which drivers are suitable for a given CUDA version? – Franck Dernoncourt Nov 16 '15 at 18:37
  • @FranckDernoncourt: Driver and CUDA runtime version compatibility is shown in the platform release notes of each toolkit. – talonmies Nov 16 '15 at 21:55
  • @talonmies Thanks. I was hoping there would be one nice summary table somewhere. Two issues I have: 1. hard to find in release notes (e.g. in [CUDA 6.5 release notes](http://developer.download.nvidia.com/compute/cuda/6_5/rel/docs/CUDA_Toolkit_Release_Notes.pdf) I can't find that CUDA 6.5 requires a 340.xx or newer driver.) 2. The release notes themselves may to tough to find (e.g. I managed to unravel [CUDA Toolkit Archive](https://developer.nvidia.com/cuda-toolkit-archive), but still can't find the release notes for CUDA 3.0: most resources linked to CUDA 7.5). – Franck Dernoncourt Nov 16 '15 at 22:09
  • 2
    One nice summary table [somewhere](http://stackoverflow.com/questions/30820513/what-is-version-of-cuda-for-nvidia-304-125/30820690#30820690) covering the last 3 years or so. If you need to go back more than 5 years (cuda 3.0) I don't have that readily available for you. – Robert Crovella Nov 17 '15 at 04:40
  • @RobertCrovella cool it's a great table! – Franck Dernoncourt Nov 17 '15 at 04:49
  • For cuda toolkits prior to 5.0, you can discover the information (for linux minimum driver) from [here](https://developer.nvidia.com/cuda-toolkit-archive) if you look carefully enough. – Robert Crovella Nov 17 '15 at 04:56
  • @RobertCrovella Thanks a lot. I think it would be very useful to add this information clearly on Nvidia website. (i.e. the compatibility table between CUDA, Nvidia drivers and OSes). Same for cuDNN: [How to know which cuDNN version one should use?](http://stackoverflow.com/q/33760192/395857) – Franck Dernoncourt Nov 17 '15 at 15:04

0 Answers0