Ubunut16.04 安装 Theano+GPU

1. 更新NVIDIA显卡驱动

  安装好系统之后首先在系统更新管理器中更新显卡驱动,如下图 

  

  点击Apply Changes

2. 安装numpy,scipy,theano

  pip安装即可

  sudo pip install <packbage>

3. 安装Cuda7.5

  sudo apt-get install nvidia-cuda-toolkit

5. 配置.theanorc

  生成文件 sudo gedit ~/.theanorc(注意不要漏掉theano前面的一个点)并复制如下内容,然后保存,其中cuda一项的内容为cuda所安装的位置。 

[global] 
floatX=float32 
device=gpu 
[cuda] 
root=/usr/lib/nvidia-cuda-toolkit 
[nvcc] 
flags=-D_FORCE_INLINES

  至此theano的安装及配置已经完成,在python里输入import theano,显示使用的GPU设备表示GPU配置成功。 

  

   也可以采用Using the GPU中的测试程序对GPU进行测试。

  转载:http://blog.csdn.net/jteng/article/details/52075871

原文地址:https://www.cnblogs.com/lqruui/p/6049494.html