试图让TensorFlow使用我的GPU,但我没有遇到麻烦。任何帮助将不胜感激。它曾经工作一年或更长时间。现在,我试图使其重新启动并运行,这给我带来了任何问题。我的机器上可能安装了同一事物的多个版本(我试图使其正常工作的副产品)。如果您需要更多信息,请告诉我您需要什么。先感谢您。
我正在运行的用于测试是否正在使用GPU的脚本如下
import tensorflow as tf
print(tf.__version__)
print(tf.test.is_gpu_available())
print(tf.test.is_gpu_available(
cuda_only=False,
min_cuda_compute_capability=None
))
print(tf.test.is_gpu_available(
cuda_only=True,
min_cuda_compute_capability=None
))
print(tf.test.is_built_with_cuda())
import ctypes
print(ctypes.WinDLL('cudnn64_7.dll'))
import sys
print(sys.version)
输出:
2.0.0
False
False
False
False
2020-04-13 19:17:37.456782: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
<WinDLL 'cudnn64_7.dll', handle 7fffe01b0000 at 0x28783590b70>
3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)]
对调试有用的其他信息
(venv) D:\PiChess\Core>nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Fri_Feb__8_19:08:26_Pacific_Standard_Time_2019
Cuda compilation tools, release 10.1, V10.1.105
(venv) D:\PiChess\Core>pip list
Package Version
------------------------ ----------
absl-py 0.9.0
astor 0.8.1
astunparse 1.6.3
blessings 1.7
cachetools 4.0.0
certifi 2019.11.28
chardet 3.0.4
gast 0.2.2
google-auth 1.11.2
google-auth-oauthlib 0.4.1
google-pasta 0.1.8
gpustat 0.6.0
grpcio 1.27.2
h5py 2.10.0
idna 2.9
importlib 1.0.4
Keras-Applications 1.0.8
Keras-Preprocessing 1.1.0
Markdown 3.2.1
numpy 1.18.1
nvidia-ml-py3 7.352.0
oauthlib 3.1.0
opt-einsum 3.1.0
pip 19.0.3
protobuf 3.11.3
psutil 5.7.0
pyasn1 0.4.8
pyasn1-modules 0.2.8
requests 2.23.0
requests-oauthlib 1.3.0
rsa 4.0
scipy 1.4.1
setuptools 46.1.3
six 1.14.0
tensorboard 2.0.2
tensorflow 2.0.0
tensorflow-estimator 2.0.1
tensorflow-gpu-estimator 2.1.0
termcolor 1.1.0
urllib3 1.25.8
Werkzeug 1.0.0
wheel 0.34.2
windows-curses 2.1.0
wrapt 1.12.0
在文件C:\ Program Files \ NVIDIA GPU Computing Toolkit \ CUDA \ v10.1 \ include \ cudnn.h中,找到以下信息
#define CUDNN_MAJOR 7
#define CUDNN_MINOR 6
#define CUDNN_PATCHLEVEL 5
从控制台。
(venv) D:\PiChess\Core>nvidia-smi
'nvidia-smi' is not recognized as an internal or external command,
operable program or batch file.
PS C:\Program Files\NVIDIA Corporation\NVSMI> ./nvidia-smi.exe
Mon Apr 13 19:15:30 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 445.75 Driver Version: 445.75 CUDA Version: 11.0 |
|-------------------------------+----------------------+----------------------+
| GPU Name TCC/WDDM | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 105... WDDM | 00000000:01:00.0 Off | N/A |
| N/A 44C P8 N/A / N/A | 75MiB / 4096MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+