tensorflow-linux-gpu安装

tensorflow-linux-gpu安装

下载:

  • cuda_9.0.176

  • cudnn三个文件:https://developer.nvidia.com/rdp/cudnn-download deb格式;16.04

安装:

  • gcc 降级:

  • cd /usr/bin

  • ls -l gcc*

    ls -l g++*

  • sudo apt-get install gcc-4.8 g++-4.8

  • sudo

  • sudo mv gcc gcc.bak

    sudo ln -s gcc-4.8 gcc

    ls -l gcc*

  •  
  • mv g++ g++.bak

  • sudo ln -s g++-4.8 g++

    ls -l g++*

  • 查看gcc和g++版本号

    gcc -v

    g++ -v

  • 依赖库安装

  • sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler   
    sudo apt-get install --no-install-recommends libboost-all-dev   
    sudo apt-get install libopenblas-dev liblapack-dev libatlas-base-dev    
    sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev   
    sudo apt-get install git cmake build-essential
     

  • sudo apt-get install git cmake build-essential 
     

配置环境变量

sudo gedit ~/.bashrc
export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

安装 *.run:

  • 更名:1.run    sh 1.run 不安装驱动
  • 安装3个deb
  • 测试

cd /usr/local/cuda/samples/1_Utilities/deviceQuery #由自己电脑目录决定
sudo make
sudo ./deviceQuery

 

 

 

你可能感兴趣的:(linux)