深度学习主机配置 gtx1080 + cuda + tensorflow + ubuntu16

  1. 下载并安装显卡驱动

    CTRL+ALT+F1
    sudo service lightdm stop
    sudo run ./NVIDIA-Linux-x86_64-367.57.run

    第二个命令是避免下面的错误

    you appear to be running an x server

    如果出现下面的错误可以忽略

    The Distribution-provided Pre-install Script Failed
  2. 下载安装 cuda8.0(tensorflow0.11必须cuda8.0,如果是老的版本可以装7.5)

    sudo sh ./cuda_8.0.44_linux.run

    不要安装自带的显卡驱动,其他都默认值

    Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 367.48?
    (y)es/(n)o/(q)uit: n
    
  3. 下载安装CUDNN
    这个只要解压, 解压后目录名为cuda

    tar -xvf cudnn-8.0-linux-x64-v5.1.tgz
  4. 配置环境变量

    export PATH=/usr/local/cuda/bin:$PATH
    export LD_LIBRARY_PATH=YOUR_CURRENT_PATH/cuda/lib64:/usr/local/cuda/lib64:$LD_LIBRARY_PATH
    
  5. 如果是安装的CUDA7.5, 由于只支持gcc5,需要修改/usr/local/cuda-7.5/include/host_config.h
    #if GNUC > 4 || (GNUC == 4 && GNUC_MINOR > 9)

  6. 测试cuda

    cd /home/YOUR_NAME/NVIDIA_CUDA-8.0_Samples/
    sudo make all -j4
    cd bin
    ./deviceQuery
    ./deviceQuery Starting...
    
     CUDA Device Query (Runtime API) version (CUDART static linking)
    
    Detected 1 CUDA Capable device(s)
    
    Device 0: "GeForce GTX 1080"
      CUDA Driver Version / Runtime Version          8.0 / 8.0
      CUDA Capability Major/Minor version number:    6.1
      Total amount of global memory:                 8112 MBytes (8506179584 bytes)
      (20) Multiprocessors, (128) CUDA Cores/MP:     2560 CUDA Cores
      GPU Max Clock rate:                            1823 MHz (1.82 GHz)
      Memory Clock rate:                             5005 Mhz
      Memory Bus Width:                              256-bit
      L2 Cache Size:                                 2097152 bytes
      Maximum Texture Dimension Size (x,y,z)         1D=(131072), 2D=(131072, 65536), 3D=(16384, 16384, 16384)
      Maximum Layered 1D Texture Size, (num) layers  1D=(32768), 2048 layers
      Maximum Layered 2D Texture Size, (num) layers  2D=(32768, 32768), 2048 layers
      Total amount of constant memory:               65536 bytes
      Total amount of shared memory per block:       49152 bytes
      Total number of registers available per block: 65536
      Warp size:                                     32
      Maximum number of threads per multiprocessor:  2048
      Maximum number of threads per block:           1024
      Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
      Max dimension size of a grid size    (x,y,z): (2147483647, 65535, 65535)
      Maximum memory pitch:                          2147483647 bytes
      Texture alignment:                             512 bytes
      Concurrent copy and kernel execution:          Yes with 2 copy engine(s)
      Run time limit on kernels:                     Yes
      Integrated GPU sharing Host Memory:            No
      Support host page-locked memory mapping:       Yes
      Alignment requirement for Surfaces:            Yes
      Device has ECC support:                        Disabled
      Device supports Unified Addressing (UVA):      Yes
      Device PCI Domain ID / Bus ID / location ID:   0 / 1 / 0
      Compute Mode:
         < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >
    
    deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 8.0, CUDA Runtime Version = 8.0, NumDevs = 1, Device0 = GeForce GTX 1080
    Result = PASS
    
  7. 安装tensorflow 0.11

    sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.11.0-cp27-none-linux_x86_64.whl
  8. 大工告成

    /var/opt/git/bitbucket$ python
    Python 2.7.12 (default, Jul  1 2016, 15:12:24) 
    [GCC 5.4.0 20160609] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import tensorflow as tf
    I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcublas.so locally
    I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcudnn.so locally
    I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcufft.so locally
    I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcuda.so.1 locally
    I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcurand.so locally
    >>> 
    
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值