tensorFlow安装的问题及方法

参考https://www.jianshu.com/p/df677e3fd630

  1. 卸载的方法: 显示已经装的包,
    -l | grep nvidia```
    1
    关闭Xorg的显示:

sudo service lightdm stop sudo init 3 sudo killall xorg

1
2


sudo apt-get –purge remove cuda sudo apt-get purge nvidia- sudo apt-get purge cuda sudo apt-get purge libcudnn7 sudo apt-get purge libcudnn7-dev

1
2
3
4
5
6

2. 安装nvidia的驱动

+ 网址<http://www.nvidia.com/Download/index.aspx>
+ 需要安装ver=390.48的驱动,可以降级为ver=390.25的驱动
+ 安装驱动前需要卸载旧的驱动,```sudo apt-get remove –purge nvidia*

  • 添加驱动源,并更新

    1
    2
    sudo add-apt-repository ppa:graphics-drivers/ppa
    sudo apt-get update

  • 查看电脑支持的驱动的版本,

    apt-cache search nvidia*```
    1
    + 安装更新,```sudo apt-get install nvidia-390

  • 检验是否安装成功,

    /proc/driver/nvidia/version```
    1
    2
    3
    4

    3. 安装cuda toolkit 9.0

    + 卸载旧的系统 ```sudo ./uninstall_cuda_*.pl

  • 下载源文件,

    1
    + 安装方式:

sudo dpkg -i cuda-repo-ubuntu1604_9.0.176-1_amd64.deb sudo dpkg -i libcudnn7_7.0.5.15-1+cuda9.0_amd64.deb sudo dpkg -i libcudnn7-dev_7.0.5.15-1+cuda9.0_amd64.deb sudo dpkg -i libnccl2_2.1.4-1+cuda9.0_amd64.deb sudo dpkg -i libnccl-dev_2.1.4-1+cuda9.0_amd64.deb sudo apt-get update sudo apt-get install cuda=9.0.176-1 sudo apt-get install libcudnn7-dev sudo apt-get install libnccl-dev

1
2
3
4
5


4. 安装cudnn lib

安装方式:先下载,

sudo dpkg -i libcudnn7_7.0.5.15-1+cuda9.0_amd64.deb sudo dpkg -i libcudnn7-dev_7.0.5.15-1+cuda9.0_amd64.deb sudo dpkg -i libnccl2_2.1.4-1+cuda9.0_amd64.deb sudo dpkg -i libnccl-dev_2.1.4-1+cuda9.0_amd64.deb sudo apt-get update sudo apt-get install libcudnn7-dev sudo apt-get install libnccl-dev ```