当我运行以下代码时:
import tensorflow as tf
if tf.config.list_physical_devices('GPU'):
print('GPU is available and configured for TensorFlow')
else:
print('GPU is not available or not properly configured for TensorFlow')
我收到以下错误:
2023-04-17 11:43:09.186983: E tensorflow/stream_executor/cuda/cuda_driver.cc:265] failed call to cuInit: CUDA_ERROR_UNKNOWN: unknown error
和输出:
GPU 不可用或未针对 TensorFlow 正确配置
要仔细检查,请使用此文档确认版本依赖性。
另外,NVIDIA驱动安装方式也可能有问题。
在此过程中,您需要在设置 Ubuntu 操作系统时禁用 BIOS 中的安全启动。
请按照以下步骤操作:
禁用安全启动
全新安装ubuntu
安装cuda工具包。
使用张量流