初始化调用失败:CUDA_ERROR_NO_DEVICE: 未检测到可用的CUDA设备。

4

每当我在代码中导入tensorflow时,我都会收到以下警告

2021-07-03 20:43:38.432690: E tensorflow/stream_executor/cuda/cuda_driver.cc:313] failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected

为了检查GPU的可用性,我运行了以下命令:

tf.config.list_physical_devices('GPU')

对于它返回了一个空数组,我不知道。
我也运行了。
tf.test.is_gpu_available()

这返回了一些值得注意的东西

2021-07-03 20:49:02.552671: I tensorflow/core/platform/cpu_feature_guard.cc:143] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA

2021-07-03 20:49:02.584748: I tensorflow/core/platform/profile_utils/cpu_utils.cc:102] CPU Frequency: 2394575000 Hz

2021-07-03 20:49:02.585433: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7f32e8000b60 initialized for platform Host (this does not guarantee that XLA will be used). Devices:

2021-07-03 20:49:02.585504: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version

2021-07-03 20:49:02.590168: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1

2021-07-03 20:49:02.737950: E tensorflow/stream_executor/cuda/cuda_driver.cc:313] failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected

2021-07-03 20:49:02.737996: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (user_name-HP-Pavilion-15-Notebook-PC): /proc/driver/nvidia/version does not exist
False

以下是我的设置规格

Python 3.8.5
TensorFlow 2.2.0
nvcc 10.1
os Ubuntu 20.04 LTS
GPU GM108M [GeForce 830M]

我需要怎样解决这个问题?我想让Tensorflow库在运行代码时使用本地GPU。

编辑:已安装libcudart和libcuda。


你的系统中没有CUDA可用的GPU,或者你的GPU驱动程序(和CUDA)未正确安装以使其能够使用。 - Robert Crovella
你使用的是哪款GPU? - Dr. Snoopy
1
更重要的是,这里的问题是什么? - Dr. Snoopy
1
问题在于你好像没有运行Nvidia图形驱动程序(与CUDA不同)。你需要安装官方的Nvidia驱动程序。 - Dr. Snoopy
1个回答

2

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接