TensorFlow:调用 cuInit 失败:CUDA

编程入门 行业动态 更新时间:2024-10-28 14:32:58
本文介绍了TensorFlow:调用 cuInit 失败:CUDA_ERROR_NO_DEVICE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送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=1CUDA_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:关键词]

本文发布于:2023-05-01 05:08:42,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1405229.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:TensorFlow   cuInit   CUDA

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!