E tensorflow/stream_executor/cuda/cuda_driver.cc:328] failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected

Hi,

Do you have a GPU on your desktop?
Could you share the output log of nvidia-smi with us?

$ nvidia-smi

Thanks.

image

Hi,

Please help to verify the CUDA and cuDNN functionality and share the output with us.

$ cd /usr/local/cuda/samples/1_Utilities/deviceQuery
$ sudo make
$ ./deviceQuery

And

$ cd /usr/src/cudnn_samples_v8/conv_sample/
$ sudo make
$ ./conv_sample

Thanks.

Sorry for late reply. This issue can be fixed by adding below code to python scripts:
import os
os.environ['CUDA_VISIBLE_DEVICES'] ="0"

And the result as below:
5月 23 09:49:06 ThinkStation-xxxx gunicorn[1343]: 2022-05-23 09:49:06.069934: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least>
5月 23 09:49:06 ThinkStation-xxxx gunicorn[1343]: 2022-05-23 09:49:06.070654: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least>
5月 23 09:49:06 ThinkStation-xxxx gunicorn[1343]: 2022-05-23 09:49:06.071296: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1871] Adding visible gpu devices: 0
5月 23 09:49:06 ThinkStation-xxxx gunicorn[1343]: 2022-05-23 09:49:06.071339: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1258] Device interconnect StreamExecutor with strength 1 edge matrix:
5月 23 09:49:06 ThinkStation-xxxx gunicorn[1343]: 2022-05-23 09:49:06.071351: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1264] 0
5月 23 09:49:06 ThinkStation-xxxx gunicorn[1343]: 2022-05-23 09:49:06.071361: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1277] 0: N
5月 23 09:49:06 ThinkStation-xxxx gunicorn[1343]: 2022-05-23 09:49:06.071602: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least>
5月 23 09:49:06 ThinkStation-xxxx gunicorn[1343]: 2022-05-23 09:49:06.072347: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least>
5月 23 09:49:06 ThinkStation-xxxx gunicorn[1343]: 2022-05-23 09:49:06.073001: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1418] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 4836 MB memory>

Thank you in advance!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.