InternalError: cudaGetDevice() failed. Status: CUDA driver version is insufficient for CUDA runtime version

安装TensorFlow 2.0.0以后,运行出现了下面的错误:

tensorflow.python.framework.errors_impl.InternalError: cudaGetDevice() failed. Status: CUDA driver version is insufficient for CUDA runtime version

这是由于CUDA驱动版本不满足CUDA运行版本造成的,之前为了安装TensorFlow 2.0.0,升级了CUDA运行版本到CUDA 10.0,但是CUDA驱动版本并没有升级,从而造成了这个错误.CUDA驱动版本和CUDA运行版本应该满足下面这张表的要求(https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html):

运行nvidia-smi后,发现CUDA驱动版本是385.54,不满足上面的要求.

于是直接用Windows8.1的设备管理器,用自动搜索更新的驱动程序软件升级CUDA驱动版本:

升级结束以后,再运行nvidia-smi,显示CUDA驱动版本已经升级到了416.34,此时运行TensorFlow 2.0.0,就不会出现上面的错误了.

猜你喜欢

转载自www.cnblogs.com/mstk/p/13153617.html