我试图运行tensorflow与gpu支持,在一个码头上的虚拟机。我尝试过很多在线解决方案,包括:
commands:TensorFlow : failed call to cuInit: CUDA_ERROR_NO_DEVICE
而可见。
没有一个解决方案对我有用,下面是一些步骤:
我验证了驱动程序、cuda和cudnn工具包都安装在容器内,使用的是nvidia-smi和nvcc -V:



Python版本是:Python3.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) Gold6226R。
这里发生什么事情?我该怎么解决这个问题?
发布于 2021-11-03 16:55:27
我意识到GPU有一个多实例特性:

因此,应该配置GPU实例:
sudo nvidia-smi mig -cgi 0 -C

然后,当打电话给nvidia-smi时,你会得到:

问题就解决了!
https://stackoverflow.com/questions/69812260
复制相似问题