Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
936 views
in Technique[技术] by (71.8m points)

windows - TensorFlow : failed call to cuInit: CUDA_ERROR_NO_DEVICE

My test :

import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()`

Error :

c:lworkensorflow-1.1.0ensorflowstream_executorcudacuda_driver.cc:405]

failed call to cuInit: CUDA_ERROR_NO_DEVICE

-> but "/cpu:0" works fine

Config :

nvidia-smi : enter image description here

  • CUDA Version 9.1
  • tensorflow-1.1.0
  • Windows 10
  • cudnn64_7.dll (installed in C:Program FilesNVIDIA GPU Computing ToolkitCUDAv9.1in)
  • Only tensorflow-gpu is installed in my Conda environment

Why can't Tensorflow detect my GPU ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...