问题描述
限时送ChatGPT账号..我的测试:
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()`
错误:
c:\l\work\tensorflow-1.1.0\tensorflow\stream_executor\cuda\cuda_driver:405]
c:\l\work\tensorflow-1.1.0\tensorflow\stream_executor\cuda\cuda_driver:405]
调用 cuInit 失败:CUDA_ERROR_NO_DEVICE
failed call to cuInit: CUDA_ERROR_NO_DEVICE
-> 但 "/cpu:0" 工作正常
-> but "/cpu:0" works fine
配置:
nvidia-smi :
nvidia-smi :
CUDA 9.1 版tensorflow-1.1.0Windows 10cudnn64_7.dll(安装在 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\bin)我的 Conda 环境中仅安装了 tensorflow-gpu为什么 Tensorflow 检测不到我的 GPU?
Why can't Tensorflow detect my GPU ?
推荐答案
问题已解决 on GitHub.如果您为 CUDA_VISIBLE_DEVICES
环境变量设置了无效值,则会显示此错误消息,例如当您只有一个 GPU(ID 0
)并设置 CUDA_VISIBLE_DEVICES=1
或 CUDA_VISIBLE_DEVICES=2
时.
The issue was solved on GitHub. This error message will be shown if you set an invalid value for the CUDA_VISIBLE_DEVICES
environment variable, e.g. when you only have a single GPU (which has ID 0
) and set CUDA_VISIBLE_DEVICES=1
or CUDA_VISIBLE_DEVICES=2
.
这篇关于TensorFlow:调用 cuInit 失败:CUDA_ERROR_NO_DEVICE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论