Поддержка графического процессора Tensorflow в Linux Mint/Ubuntu 14.04
Итак, я установил тензор потока, и версия процессора работает нормально, но я не могу заставить работать графический процессор. Я установил Cuda, загрузив.de b с Nvidia. Я скопировал содержание cudNN
cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
#define CUDNN_MAJOR 6
#define CUDNN_MINOR 0
#define CUDNN_PATCHLEVEL 20
--
#define CUDNN_VERSION (CUDNN_MAJOR * 1000 + CUDNN_MINOR * 100 + CUDNN_PATCHLEVEL)
#include "driver_types.h"
Я ввел путь в ~/.profile
export CUDA_HOME=/usr/local/cuda
export CUDA_ROOT=/usr/local/cuda
export PATH=$PATH:$CUDA_ROOT/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CUDA_ROOT/lib64
Ох, а Нвидия-Сми показывает:
| NVIDIA-SMI 375.39 Driver Version: 375.39 |
|-------------------------------+----------------------+----------------------+
| 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 | 0000:01:00.0 On | N/A |
| 10% 54C P0 42W / 200W | 591MiB / 8105MiB | 4% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1368 G /usr/bin/X 344MiB |
| 0 3078 G cinnamon 129MiB |
| 0 6549 G /usr/lib/virtualbox/VirtualBox 20MiB |
| 0 15491 G ...bleH2AndQuicRequests/Enabled/*NetworkTime 96MiB |
Тем не менее все еще используя Tensorflow я получаю:
>>> python
>>> import tensorflow as tf
>>> sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
Device mapping: no known devices.
I tensorflow/core/common_runtime/direct_session.cc:257] Device mapping:
Я надеюсь, что вы можете сказать мне, что еще я могу сделать. С наилучшими пожеланиями и заранее спасибо
1 ответ
Я думаю, что вы установили просто простую (CPU) версию tenorflow. Вы должны установить версию gps для tenorflow. Самый простой способ сделать это - использовать дистрибутив anaconda Python & tenorflow.
kmario23 ❯ conda install -c anaconda tensorflow-gpu
Fetching package metadata .........
Solving package specifications: ..........
Package plan for installation in environment /home/kmario23/anaconda3:
The following packages will be downloaded:
package | build
---------------------------|-----------------
conda-env-2.6.0 | 0 502 B anaconda
cudatoolkit-7.5 | 0 217.2 MB anaconda
cudnn-5.1 | 0 77.2 MB anaconda
tensorflow-gpu-1.0.1 | py35_4 77.4 MB anaconda
conda-4.3.16 | py35_0 510 KB anaconda
------------------------------------------------------------
Total: 372.4 MB
The following NEW packages will be INSTALLED:
cudatoolkit: 7.5-0 anaconda
cudnn: 5.1-0 anaconda
tensorflow-gpu: 1.0.1-py35_4 anaconda
The following packages will be UPDATED:
conda: 4.2.13-py35_0 conda-forge --> 4.3.16-py35_0 anaconda
Proceed ([y]/n)?
Идите и установите его, прямо сейчас.
Также обратите внимание, что при простом поиске пакетов будет отображаться отдельная версия тензорного потока для графического процессора.
kmario23 ❯ anaconda search -t conda tensorflow
Using Anaconda API: https://api.anaconda.org
Run 'anaconda show <USER/PACKAGE>' to get more details:
Packages:
Name | Version | Package Types | Platforms
------------------------- | ------ | --------------- | ---------------
HCC/tensorflow | 1.0.0 | conda | linux-64
HCC/tensorflow-cpucompat | 1.0.0 | conda | linux-64
HCC/tensorflow-fma | 1.0.0 | conda | linux-64
SentientPrime/tensorflow | 0.6.0 | conda | osx-64
: TensorFlow helps the tensors flow
acellera/tensorflow-cuda | 0.12.1 | conda | linux-64
anaconda/tensorflow | 1.0.1 | conda | linux-64
anaconda/tensorflow-gpu | 1.0.1 | conda | linux-64
conda-forge/tensorflow | 1.0.0 | conda | linux-64, win-64, osx-64
: TensorFlow helps the tensors flow
Я бы порекомендовал установить tensorflow-gpu
из канала анаконды anaconda/tensorflow-gpu
,