简体   繁体   中英

Theano Ubuntu 12 cuda

my question is the next one:

I use theano on ubuntu 14 and configure theano flags by editing .theanorc . To use cuda, I only have to add:

[cuda]
root=/usr/local/cudaVersion/

And everything goes, theano is capable of finding nvcc, the libs and everything, I do not have to add cudaRoot to the $PATH or the library directory to $LD_LIBRARY_PATH .

In ubuntu 12 this does not happens. If I create the .theanorc in the same way, theano is only capable of finding nvcc but not the library, and I have to add /usr/local/cudaVersion/lib64 to the LD_LIBRARY_PATH enviroment variable.

The problem is that I do not like to use this enviroment variable. Does anyone knows why in ubuntu 14 only editing .theanorc is enough and in ubuntu 12 is not?

I will try to help you the best i can. I use Theano and CUDA on Linux.

First, are you sudo in both OS's ? Did you install theano and python environment and cuda as sudo? Because, i suppose that, if the setup of CUDA wasnt done on global library path, then it wont be automatically detected.

Also, according to the official website of theano:

http://deeplearning.net/software/theano/install_ubuntu.html#install-ubuntu

Quoting :

For Ubuntu 11.10 through 14.04:

sudo apt-get install python-numpy python-scipy python-dev python-pip python-nose g++ libopenblas-dev git sudo pip install Theano

On 14.04, this will install Python 2 by default. If you want to use Python 3:

sudo apt-get install python3-numpy python3-scipy python3-dev python3-pip python3-nose g++ libopenblas-dev git sudo pip install Theano

For Ubuntu 11.04:

sudo apt-get install python-numpy python-scipy python-dev python-pip python-nose g++ git libatlas3gf-base libatlas-dev sudo pip install Theano

So did you follow these instructions? They might be the cause.

Also, There is additional instructions to setting up cuda for theano, on the same page:

Ubuntu 11.10/12.04 (probably work on 11.04 too):

sudo apt-add-repository ppa:ubuntu-x-swat/x-updates sudo apt-get update sudo apt-get install nvidia-current

Ubuntu 14.04:

sudo apt-get install nvidia-current sudo apt-get install nvidia-cuda-toolkit

The questions below might also help if the above didnt solve it.

As described on the references, did you edit .bashrc properly?

How did you install CUDA on both OS's?

Did you try to uninstall CUDA,Theano and python environments and install them again?

Its probably worth to edit the question with more info if these didnt help!

Extra references:

https://groups.google.com/forum/#!topic/theano-users/RRqYTf42YIo

http://dhaneshr.net/2015/09/10/setting-up-cudnn-and-theano-on-ubuntu-14-04-and-15-10/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM