Tensorflow gpu问题(CUDA运行时错误:设备内核映像无效)



我有一个python虚拟环境(conda(,在那里我安装了CUDA工具包10.1.243和tensorflow gpu 2.3.0rc0。我的CUDA驱动程序是11.0。

为了测试tensorflow是否正确安装到GPU,我在venv:中运行了一系列命令

tf.test.is_built_with_cuda()

真实

tf.config.list_physical_devices(‘GPU’)

找到了具有以下属性的设备0:pciBusID:0000:01:00.0名称:Quadro M2000M计算机能力:5.0[PhysicalDevice(name='/physical_device:GPU:0',device_type='GPU'(]

python -c "import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([1000,1000])))"

tensorflow.python.framework.errors_impl.InternalError:GPU上的CUDA运行时隐式初始化失败:0。状态:设备内核映像无效

我不知道如何解决这个问题。我有一种感觉,这与修改编译有关,以便tensorflow支持我的设备(5.0(的计算能力,但我不确定如何继续。非常感谢。

我刚刚遇到了同样的问题。我用以下命令将Tensorflow2.3版本降级为2.2。

pip install --upgrade tensorflow==2.2

它现在正在工作,但速度很慢。

根据github问题的解释,Google Tensorflow工程团队已经放弃了对一些旧版本GPU的支持:https://github.com/tensorflow/tensorflow/issues/41990

我相信你的GPU是在那些较低版本的GPU家族。因此,将你的TF从2.3降级。至2.2是一个解决方案。TF工程师建议我们自己构建TF2.3,并更改其构建配置脚本,以启用较低版本的GPU支持,但谷歌TF团队没有确认它可以工作,也没有能力解决我们将遇到的任何问题。

我推荐pip install tensorflow-gpu==2.2

最新更新