簡體   English   中英

已安裝 CUDA 10.1 但 Tensorflow 不在 GPU 上運行模擬

[英]CUDA 10.1 installed but Tensorflow doesn't run simulation on GPU

CUDA 10.1 和 NVidia 驅動程序 v440 安裝在我的 Ubuntu 18.04 系統上。 我不明白為什么nvidia-smi工具在安裝的版本為 10.1 時報告 CUDA 版本為 10.2(請參閱下文)。

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.33.01    Driver Version: 440.33.01    CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Quadro M1200        On   | 00000000:01:00.0  On |                  N/A |
| N/A   45C    P0    N/A /  N/A |    962MiB /  4042MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1346      G   /usr/lib/xorg/Xorg                           107MiB |
|    0      1647      G   /usr/bin/gnome-shell                          57MiB |
|    0      2521      G   /usr/lib/xorg/Xorg                           414MiB |
|    0      2655      G   /usr/bin/gnome-shell                         206MiB |
|    0      3549      C   python                                        26MiB |
|    0      4236      G   ...quest-channel-token=1063048282371062146   139MiB |
+-----------------------------------------------------------------------------+

每當我嘗試運行 Tensorflow (Python) 程序時,它似乎都能正確檢測到我筆記本電腦上的 GPU,但在初始化過程中會產生許多錯誤,並且不會在 GPU 上運行模擬,這可以通過上面顯示的 GPU 使用情況來證明。

2020-02-13 17:37:53.162545: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-02-13 17:37:53.167709: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcuda.so.1
2020-02-13 17:37:53.215323: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1005] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-02-13 17:37:53.215893: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x56196a0c1980 executing computations on platform CUDA. Devices:
2020-02-13 17:37:53.215913: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): Quadro M1200, Compute Capability 5.0
2020-02-13 17:37:53.235780: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2904000000 Hz
2020-02-13 17:37:53.236381: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x56196c491c70 executing computations on platform Host. Devices:
2020-02-13 17:37:53.236413: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): <undefined>, <undefined>
2020-02-13 17:37:53.236721: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1005] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-02-13 17:37:53.237160: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1640] Found device 0 with properties: 
name: Quadro M1200 major: 5 minor: 0 memoryClockRate(GHz): 1.148
pciBusID: 0000:01:00.0
2020-02-13 17:37:53.237367: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library 'libcudart.so.10.0'; dlerror: libcudart.so.10.0: cannot open shared object file: No such file or directory
2020-02-13 17:37:53.237508: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library 'libcublas.so.10.0'; dlerror: libcublas.so.10.0: cannot open shared object file: No such file or directory
2020-02-13 17:37:53.237645: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library 'libcufft.so.10.0'; dlerror: libcufft.so.10.0: cannot open shared object file: No such file or directory
2020-02-13 17:37:53.237811: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library 'libcurand.so.10.0'; dlerror: libcurand.so.10.0: cannot open shared object file: No such file or directory
2020-02-13 17:37:53.237948: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library 'libcusolver.so.10.0'; dlerror: libcusolver.so.10.0: cannot open shared object file: No such file or directory
2020-02-13 17:37:53.238083: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library 'libcusparse.so.10.0'; dlerror: libcusparse.so.10.0: cannot open shared object file: No such file or directory
2020-02-13 17:37:53.243683: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcudnn.so.7
2020-02-13 17:37:53.243719: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1663] Cannot dlopen some GPU libraries. Skipping registering GPU devices...
2020-02-13 17:37:53.243745: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1181] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-02-13 17:37:53.243760: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1187]      0 
2020-02-13 17:37:53.243772: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1200] 0:   N 
2020-02-13 17:37:53.273148: W tensorflow/compiler/jit/mark_for_compilation_pass.cc:1412] (One-time warning): Not using XLA:CPU for cluster because envvar TF_XLA_FLAGS=--tf_xla_cpu_global_jit was not set.  If you want XLA:CPU, either set that envvar, or use experimental_jit_scope to enable XLA:CPU.  To confirm that XLA is active, pass --vmodule=xla_compilation_cache=1 (as a proper command-line flag, not via TF_XLA_FLAGS) or set the envvar XLA_FLAGS=--xla_hlo_profile.
WARNING:tensorflow:From /home/xxxxxxx/.local/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py:422: The name tf.global_variables is deprecated. Please use tf.compat.v1.global_variables instead.

關於系統和安裝的軟件包的一些事實:

# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.4 LTS
Release:    18.04
Codename:   bionic

# dpkg --get-selections |grep -i cuda
cuda                        install
cuda-10-1                   install
cuda-command-line-tools-10-1            install
cuda-compiler-10-1              install
cuda-cudart-10-1                install
cuda-cudart-dev-10-1                install
cuda-cufft-10-1                 install
cuda-cufft-dev-10-1             install
cuda-cuobjdump-10-1             install
cuda-cupti-10-1                 install
cuda-curand-10-1                install
cuda-curand-dev-10-1                install
cuda-cusolver-10-1              install
cuda-cusolver-dev-10-1              install
cuda-cusparse-10-1              install
cuda-cusparse-dev-10-1              install
cuda-demo-suite-10-1                install
cuda-documentation-10-1             install
cuda-driver-dev-10-1                install
cuda-drivers                    install
cuda-gdb-10-1                   install
cuda-gpu-library-advisor-10-1           install
cuda-libraries-10-1             install
cuda-libraries-dev-10-1             install
cuda-license-10-1               install
cuda-license-10-2               install
cuda-memcheck-10-1              install
cuda-misc-headers-10-1              install
cuda-npp-10-1                   install
cuda-npp-dev-10-1               install
cuda-nsight-10-1                install
cuda-nsight-compute-10-1            install
cuda-nsight-systems-10-1            install
cuda-nvcc-10-1                  install
cuda-nvdisasm-10-1              install
cuda-nvgraph-10-1               install
cuda-nvgraph-dev-10-1               install
cuda-nvjpeg-10-1                install
cuda-nvjpeg-dev-10-1                install
cuda-nvml-dev-10-1              install
cuda-nvprof-10-1                install
cuda-nvprune-10-1               install
cuda-nvrtc-10-1                 install
cuda-nvrtc-dev-10-1             install
cuda-nvtx-10-1                  install
cuda-nvvp-10-1                  install
cuda-repo-ubuntu1804                install
cuda-repo-ubuntu1804-10-2-local-10.2.89-440.33.01   deinstall
cuda-runtime-10-1               install
cuda-samples-10-1               install
cuda-sanitizer-api-10-1             install
cuda-toolkit-10-1               install
cuda-tools-10-1                 install
cuda-visual-tools-10-1              install


# dpkg --get-selections |grep -P 'nvidia-[^\s]+\s+install$'
libnvidia-cfg1-440:amd64            install
libnvidia-common-435                install
libnvidia-common-440                install
libnvidia-compute-440:amd64         install
libnvidia-decode-440:amd64          install
libnvidia-encode-440:amd64          install
libnvidia-fbc1-440:amd64            install
libnvidia-gl-440:amd64              install
libnvidia-ifr1-440:amd64            install
nvidia-compute-utils-440            install
nvidia-dkms-440                 install
nvidia-driver-440               install
nvidia-kernel-common-440            install
nvidia-kernel-source-440            install
nvidia-machine-learning-repo-ubuntu1804     install
nvidia-modprobe                 install
nvidia-prime                    install
nvidia-settings                 install
nvidia-utils-440                install
xserver-xorg-video-nvidia-440           install
$ pip list|grep -i tensorflow
tensorflow-estimator (1.14.0)
tensorflow-gpu (1.14.0)

為了在 GPU 上運行 Python Tensorflow 模擬,我還需要做些什么嗎? 我該如何診斷?

Could not dlopen library 'libcudart.so.10.0'; 我們可以知道您的 tensorflow 包是針對 CUDA 10.0 構建的。 您應該安裝 CUDA 10.0 或自己從源代碼(針對 CUDA 10.1 或 10.2)構建它。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM