install process

https://github.com/omnia-md/conda-recipes/issues/813
Summary of steps I’ve done to install tensorflow-gpu in Ubuntu 18.04 (should work in any Debian-based distro).

1.Install Nvidia driver on a machine with supported Nvidia card.
$ sudo apt update
$ sudo ubuntu-drivers autoinstall
$ sudo reboot
2. You might need to switch to Nvidia GPU from Intel GPU by using

$ sudo prime-select nvidia
$ sudo reboot
3. Install Anaconda with python 3.6.

https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64.sh (Don’t use python 3.7.)

  1. Install tensorflow-gpu

$ conda install tensorflow-gpu1.11 cudatoolkit9.0 cudnn==7.1.2 h5py

  1. You’re done.

Source: https://medium.com/datadriveninvestor/install-tensorflow-gpu-to-use-nvidia-gpu-on-ubuntu-18-04-do-ai-71b0ce64ebc5

![

](https://img-blog.csdnimg.cn/20190227230028682.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MzY5ODgyMQ==,size_16,color_FFFFFF,t_70)
The following packages will be downloaded:

package                    |            build
---------------------------|-----------------
tensorflow-gpu-1.7.0       |                0           3 KB
cudnn-7.3.1                |        cuda9.0_0       331.3 MB
cudatoolkit-9.0            |       h13b8566_0       340.4 MB
tensorflow-gpu-base-1.7.0  |   py27hcdda91b_1       157.9 MB
cupti-9.0.176              |                0         1.6 MB
------------------------------------------------------------
                                       Total:       831.3 MB

The following NEW packages will be INSTALLED:

cudatoolkit:         9.0-h13b8566_0      
cudnn:               7.3.1-cuda9.0_0     
cupti:               9.0.176-0           
tensorflow-gpu:      1.7.0-0             
tensorflow-gpu-base: 1.7.0-py27hcdda91b_1

nvidia-smi
Wed Feb 27 16:54:42 2019
±----------------------------------------------------------------------------+
| NVIDIA-SMI 384.130 Driver Version: 384.130 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|=++==============|
| 0 GeForce GTX 1080 Off | 00000000:01:00.0 On | N/A |
| 42% 36C P0 46W / 200W | 312MiB / 8110MiB | 2% Default |
±------------------------------±---------------------±---------------------+
| 1 GeForce GTX 1080 Off | 00000000:03:00.0 Off | N/A |
| 42% 30C P8 7W / 180W | 1MiB / 8114MiB | 0% Default |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 962 G /usr/lib/xorg/Xorg 167MiB |
| 0 1811 G compiz 142MiB |
±----------------------------------------------------------------------------+

./mnistCUDNN
cudnnGetVersion() : 7005 , CUDNN_VERSION from cudnn.h : 7005 (7.0.5)
Host compiler version : GCC 5.4.0
There are 2 CUDA capable devices on your machine :
device 0 : sms 20 Capabilities 6.1, SmClock 1784.5 Mhz, MemSize (Mb) 8110, MemClock 5005.0 Mhz, Ecc=0, boardGroupID=0
device 1 : sms 20 Capabilities 6.1, SmClock 1733.5 Mhz, MemSize (Mb) 8114, MemClock 5005.0 Mhz, Ecc=0, boardGroupID=1
Using device 0

Testing single precision
Loading image data/one_28x28.pgm
Performing forward propagation …
Testing cudnnGetConvolutionForwardAlgorithm …
Fastest algorithm is Algo 1
Testing cudnnFindConvolutionForwardAlgorithm …
^^^^ CUDNN_STATUS_SUCCESS for Algo 1: 0.026656 time requiring 3464 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 0: 0.052032 time requiring 0 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 2: 0.072704 time requiring 57600 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 7: 0.088640 time requiring 2057744 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 5: 0.116736 time requiring 203008 memory
Resulting weights from Softmax:
0.0000000 0.9999399 0.0000000 0.0000000 0.0000561 0.0000000 0.0000012 0.0000017 0.0000010 0.0000000
Loading image data/three_28x28.pgm
Performing forward propagation …
Resulting weights from Softmax:
0.0000000 0.0000000 0.0000000 0.9999288 0.0000000 0.0000711 0.0000000 0.0000000 0.0000000 0.0000000
Loading image data/five_28x28.pgm
Performing forward propagation …
Resulting weights from Softmax:
0.0000000 0.0000008 0.0000000 0.0000002 0.0000000 0.9999820 0.0000154 0.0000000 0.0000012 0.0000006

Result of classification: 1 3 5

Test passed!

Testing half precision (math in single precision)
Loading image data/one_28x28.pgm
Performing forward propagation …
Testing cudnnGetConvolutionForwardAlgorithm …
Fastest algorithm is Algo 1
Testing cudnnFindConvolutionForwardAlgorithm …
^^^^ CUDNN_STATUS_SUCCESS for Algo 2: 0.031456 time requiring 28800 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 0: 0.040672 time requiring 0 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 1: 0.051840 time requiring 3464 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 7: 0.088224 time requiring 2057744 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 5: 0.111744 time requiring 203008 memory
Resulting weights from Softmax:
0.0000001 1.0000000 0.0000001 0.0000000 0.0000563 0.0000001 0.0000012 0.0000017 0.0000010 0.0000001
Loading image data/three_28x28.pgm
Performing forward propagation …
Resulting weights from Softmax:
0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000714 0.0000000 0.0000000 0.0000000 0.0000000
Loading image data/five_28x28.pgm
Performing forward propagation …
Resulting weights from Softmax:
0.0000000 0.0000008 0.0000000 0.0000002 0.0000000 1.0000000 0.0000154 0.0000000 0.0000012 0.0000006

Result of classification: 1 3 5

Test passed!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值