无法在Ubuntu上检测到使用python3.6的gpu

无法在Ubuntu上检测到使用python3.6的gpu,python,ubuntu,gpu,Python,Ubuntu,Gpu,我想在我的笔记本电脑(Ubuntu18.04)中检测gpu以使用它。为此,我使用Tensorflow的以下命令: import tensorflow as tf tf.test.gpu_device_name() 结果,我得到了这个结果: 2020-09-20 02:28:04.440281: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorF

我想在我的笔记本电脑(Ubuntu18.04)中检测gpu以使用它。为此,我使用Tensorflow的以下命令:

import tensorflow as tf
tf.test.gpu_device_name()
结果,我得到了这个结果:

2020-09-20 02:28:04.440281: 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-09-20 02:28:04.467750: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2599990000 Hz
2020-09-20 02:28:04.468610: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x5503e20 executing computations on platform Host. Devices:
2020-09-20 02:28:04.468629: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): Host, Default Version
2020-09-20 02:28:04.471728: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1
2020-09-20 02:28:04.570688: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] 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-09-20 02:28:04.571025: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x55ac430 executing computations on platform CUDA. Devices:
2020-09-20 02:28:04.571036: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): GeForce GTX 1660 Ti with Max-Q Design, Compute Capability 7.5
2020-09-20 02:28:04.571566: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] 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-09-20 02:28:04.571868: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties: 
name: GeForce GTX 1660 Ti with Max-Q Design major: 7 minor: 5 memoryClockRate(GHz): 1.335
pciBusID: 0000:01:00.0
2020-09-20 02:28:04.571962: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcudart.so.10.0'; dlerror: libcudart.so.10.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda-10.1/lib64:/usr/local/cuda-10.1/lib64:
2020-09-20 02:28:04.572015: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcublas.so.10.0'; dlerror: libcublas.so.10.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda-10.1/lib64:/usr/local/cuda-10.1/lib64:
2020-09-20 02:28:04.572068: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcufft.so.10.0'; dlerror: libcufft.so.10.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda-10.1/lib64:/usr/local/cuda-10.1/lib64:
2020-09-20 02:28:04.572119: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcurand.so.10.0'; dlerror: libcurand.so.10.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda-10.1/lib64:/usr/local/cuda-10.1/lib64:
2020-09-20 02:28:04.572206: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcusolver.so.10.0'; dlerror: libcusolver.so.10.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda-10.1/lib64:/usr/local/cuda-10.1/lib64:
2020-09-20 02:28:04.572260: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcusparse.so.10.0'; dlerror: libcusparse.so.10.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda-10.1/lib64:/usr/local/cuda-10.1/lib64:
2020-09-20 02:28:04.620475: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7
2020-09-20 02:28:04.620508: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1641] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
2020-09-20 02:28:04.620529: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1159] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-09-20 02:28:04.620537: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1165]      0 
2020-09-20 02:28:04.620548: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1178] 0:   N 
Out[3]: ''
我已经安装了tensorfow gpu==2.0.0、cuda10.1和python3.6

命令nvcc-V返回:

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 450.51.06    Driver Version: 450.51.06    CUDA Version: 11.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce GTX 166...  On   | 00000000:01:00.0 Off |                  N/A |
| N/A   49C    P8     2W /  N/A |    308MiB /  5944MiB |      1%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                           
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      2158      G   /usr/lib/xorg/Xorg                114MiB |
|    0   N/A  N/A      2344      G   /usr/bin/gnome-shell              108MiB |
|    0   N/A  N/A      2855      G   /usr/lib/firefox/firefox            1MiB |
|    0   N/A  N/A      3167      G   /usr/lib/firefox/firefox            1MiB |
|    0   N/A  N/A      3214      G   /usr/lib/firefox/firefox            1MiB |
|    0   N/A  N/A     15568      G   /usr/lib/firefox/firefox            1MiB |
|    0   N/A  N/A     15997      G   /usr/lib/firefox/firefox            1MiB |
|    0   N/A  N/A     18104      C   ...alenvs/genesis/bin/python       69MiB |
+-----------------------------------------------------------------------------+
命令nvidia smi返回:

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 450.51.06    Driver Version: 450.51.06    CUDA Version: 11.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce GTX 166...  On   | 00000000:01:00.0 Off |                  N/A |
| N/A   49C    P8     2W /  N/A |    308MiB /  5944MiB |      1%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                           
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      2158      G   /usr/lib/xorg/Xorg                114MiB |
|    0   N/A  N/A      2344      G   /usr/bin/gnome-shell              108MiB |
|    0   N/A  N/A      2855      G   /usr/lib/firefox/firefox            1MiB |
|    0   N/A  N/A      3167      G   /usr/lib/firefox/firefox            1MiB |
|    0   N/A  N/A      3214      G   /usr/lib/firefox/firefox            1MiB |
|    0   N/A  N/A     15568      G   /usr/lib/firefox/firefox            1MiB |
|    0   N/A  N/A     15997      G   /usr/lib/firefox/firefox            1MiB |
|    0   N/A  N/A     18104      C   ...alenvs/genesis/bin/python       69MiB |
+-----------------------------------------------------------------------------+
我不知道为什么命令nvdia smi显示cuda11.0,而nvcc-V显示cuda10.1。也许问题就在这里?我是GPU计算的初学者

你能帮忙吗