Anaconda中的Tensorflow-Gpu和Cuda驱动程序的问题。

问题描述 投票:2回答:1

我在使用Tensorflow-GPU时遇到了以下问题。当我试图为一个深度学习任务设置gpus(在Jupyter中)时,我得到以下错误。

InternalError                             Traceback (most recent call last)
<ipython-input-3-a08c39e19f9e> in <module>
     20     for gpu in gpus:
     21       tf.config.experimental.set_memory_growth(gpu, True)
---> 22     logical_gpus = tf.config.experimental.list_logical_devices('GPU')
     23     print(len(gpus), "Physical GPUs,", len(logical_gpus), "Logical GPUs")
     24   except RuntimeError as e:

~\Anaconda3\envs\tens-gpu\lib\site-packages\tensorflow_core\python\framework\config.py in list_logical_devices(device_type)
    345     List of LogicalDevice objects
    346   """
--> 347   return context.context().list_logical_devices(device_type=device_type)
    348 
    349 

~\Anaconda3\envs\tens-gpu\lib\site-packages\tensorflow_core\python\eager\context.py in list_logical_devices(self, device_type)
   1150   def list_logical_devices(self, device_type=None):
   1151     """Return logical devices."""
-> 1152     self.ensure_initialized()
   1153 
   1154     devices = []

~\Anaconda3\envs\tens-gpu\lib\site-packages\tensorflow_core\python\eager\context.py in ensure_initialized(self)
    490         if self._default_is_async == ASYNC:
    491           pywrap_tensorflow.TFE_ContextOptionsSetAsync(opts, True)
--> 492         self._context_handle = pywrap_tensorflow.TFE_NewContext(opts)
    493       finally:
    494         pywrap_tensorflow.TFE_DeleteContextOptions(opts)

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

我的Cuda版本是Cuda 10.0.130,cudnn是7.6.4,而我有一个Intel UHD Graphics 620和一个NVIDIA GeForce MX150 gpus。驱动程序已更新到 "优化 "版本,我真的不明白什么是不工作。你能不能帮帮我,因为我已经尝试了所有我在网上找到的东西?先谢谢你

python tensorflow intel nvidia
1个回答
0
投票

这个错误的原因是你安装的CUDA Toolkit版本和python包CUDA toolkit版本不匹配,CUDA toolkit通常是作为Tensorflow GPU的依赖安装的。

运行CUDA应用程序需要系统至少有一个支持CUDA的GPU和一个与CUDA工具包兼容的驱动程序。详情请参考以下内容

enter image description here

无法加载动态库'cudart64_100.dll'; dlerror: 没有找到cudart64_100.dll。

最简单的解决方法是安装最新的 NVIDIA GPU Computing Toolkit因为如果它不在那里,你就会缺少'cudart64_100.dll'库。

© www.soinside.com 2019 - 2024. All rights reserved.