【问题标题】:A100 tensorflow gpu error: "Failed call to cuInit: CUDA_ERROR_NOT_INITIALIZED: initialization error"A100 tensorflow gpu 错误:“调用 cuInit 失败:CUDA_ERROR_NOT_INITIALIZED:初始化错误”
【发布时间】:2021-11-02 14:41:15
【问题描述】:

我正在尝试在虚拟机上的 docker 中运行支持 gpu 的 tensorflow。我尝试了很多在线解决方案,包括:

没有一个解决方案适合我,这里有一些步骤:

我使用 nvidia-smi 和 nvcc -V 验证了驱动程序和 cuda 和 cudnn 工具包已安装在容器内:

Python 版本是: Python 3.8.10

和tensorflow版本是:

import tensorflow as tf 
tf.__version__
'2.6.0'

错误出现: tf.config.list_physical_devices()

因此 GPU 在某种程度上对 tensorflow 不可见。所有 tensorflow 构建都返回相同的错误:

 E tensorflow/stream_executor/cuda/cuda_driver.cc:271] failed call to cuInit: CUDA_ERROR_NOT_INITIALIZED: initialization error

但例如对于 1.14,有一条关于 CPU 类型的附加注释:

Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 AVX512F FMA

GPU 是 A100,CPU 是 Intel(R) Xeon(R) Gold 6226R。

这里发生了什么?我该如何解决这个问题?

【问题讨论】:

    标签: python docker tensorflow nvidia-docker


    【解决方案1】:

    我意识到 GPU 具有多实例功能:

    因此,应该配置 GPU 实例:

    sudo nvidia-smi mig -cgi 0 -C 
    

    然后在调用 nvidia-smi 时会得到:

    问题就解决了!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-07-06
      • 2020-01-31
      • 2022-10-09
      • 2018-05-05
      • 2020-05-30
      • 2018-07-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多