无法使用 GPU Ubuntu 20.04 CUDA 10.2

无法使用 GPU Ubuntu 20.04 CUDA 10.2
>>> import tensorflow as tf
>>> tf.debugging.set_log_device_placement(True)
>>> 
>>> # Create some tensors
>>> a = tf.constant([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]])
2020-06-02 15:21:45.190704: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1
2020-06-02 15:21:45.239786: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] 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-06-02 15:21:45.240144: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1561] Found device 0 with properties: 
pciBusID: 0000:2d:00.0 name: GeForce RTX 2060 SUPER computeCapability: 7.5
coreClock: 1.665GHz coreCount: 34 deviceMemorySize: 7.79GiB deviceMemoryBandwidth: 417.29GiB/s
2020-06-02 15:21:45.240252: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcudart.so.10.1'; dlerror: libcudart.so.10.1: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda-10.2/lib64:/usr/local/cuda-10.2/lib64::/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/extras/CUPTI/lib64
2020-06-02 15:21:45.241228: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10
2020-06-02 15:21:45.242323: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcufft.so.10
2020-06-02 15:21:45.242467: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcurand.so.10
2020-06-02 15:21:45.243467: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusolver.so.10
2020-06-02 15:21:45.244029: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusparse.so.10
2020-06-02 15:21:45.246146: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7
2020-06-02 15:21:45.246159: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1598] 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-06-02 15:21:45.246436: I tensorflow/core/platform/cpu_feature_guard.cc:143] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-06-02 15:21:45.271855: I tensorflow/core/platform/profile_utils/cpu_utils.cc:102] CPU Frequency: 3799960000 Hz
2020-06-02 15:21:45.272326: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7f7008000b60 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-06-02 15:21:45.272349: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
2020-06-02 15:21:45.274045: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1102] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-06-02 15:21:45.274060: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1108]      
>>> b = tf.constant([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]])
>>> c = tf.matmul(a, b)

驱动程序和 cuda-toolkit 安装良好。

所有标头均已成功加载,但会跳过 GPU 设备。它通常会记录一个依赖项加载失败,然后退出。

如能得到指导将不胜感激,谢谢。

答案1

没关系,我设法修复了这个问题,我正在检查中间或底部的错误,而它出现在第一个 dsoloader 行上sudo apt-get install cuda-cudart-10-1就是我所需要的,哈哈

相关内容