Difference between revisions of "Tensorflow with gpu"
From ElphelWiki
(Created page with "==Pre== * check device ~$ lspci | grep NVIDIA 81:00.0 VGA compatible controller: NVIDIA Corporation GF119 [GeForce GT 610] (rev a1) 81:00.1 Audio device: NVIDIA Corporation...") |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
81:00.1 Audio device: NVIDIA Corporation GF119 HDMI Audio Controller (rev a1) | 81:00.1 Audio device: NVIDIA Corporation GF119 HDMI Audio Controller (rev a1) | ||
* check driver version | * check driver version | ||
− | ~$ | + | ~$ cat /proc/driver/nvidia/version |
+ | NVRM version: NVIDIA UNIX x86_64 Kernel Module 387.26 Thu Nov 2 21:20:16 PDT 2017 | ||
+ | GCC version: gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9) | ||
* install cuda 9.0 with patches | * install cuda 9.0 with patches | ||
https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=deblocal | https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=deblocal | ||
Line 15: | Line 17: | ||
~$ export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}} | ~$ 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}} | ~$ export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} | ||
+ | * | ||
+ | ~$ nvidia-smi | ||
+ | Thu Apr 26 12:39:25 2018 | ||
+ | +-----------------------------------------------------------------------------+ | ||
+ | | NVIDIA-SMI 387.26 Driver Version: 387.26 | | ||
+ | |-------------------------------+----------------------+----------------------+ | ||
+ | | 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 GT 610 Off | 00000000:81:00.0 N/A | N/A | | ||
+ | | N/A 31C P8 N/A / N/A | 148MiB / 956MiB | N/A Default | | ||
+ | +-------------------------------+----------------------+----------------------+ | ||
+ | |||
+ | +-----------------------------------------------------------------------------+ | ||
+ | | Processes: GPU Memory | | ||
+ | | GPU PID Type Process name Usage | | ||
+ | |=============================================================================| | ||
+ | | 0 Not Supported | | ||
+ | +-----------------------------------------------------------------------------+ |
Revision as of 10:42, 26 April 2018
Pre
- check device
~$ lspci | grep NVIDIA 81:00.0 VGA compatible controller: NVIDIA Corporation GF119 [GeForce GT 610] (rev a1) 81:00.1 Audio device: NVIDIA Corporation GF119 HDMI Audio Controller (rev a1)
- check driver version
~$ cat /proc/driver/nvidia/version NVRM version: NVIDIA UNIX x86_64 Kernel Module 387.26 Thu Nov 2 21:20:16 PDT 2017 GCC version: gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9)
- install cuda 9.0 with patches
https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=deblocal
- then
sudo apt-get install cuda-9-0
https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions
~$ 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}}
~$ nvidia-smi Thu Apr 26 12:39:25 2018 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 387.26 Driver Version: 387.26 | |-------------------------------+----------------------+----------------------+ | 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 GT 610 Off | 00000000:81:00.0 N/A | N/A | | N/A 31C P8 N/A / N/A | 148MiB / 956MiB | N/A Default | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=============================================================================| | 0 Not Supported | +-----------------------------------------------------------------------------+