调用 cuInit 失败:CUDA_ERROR_UNKNOWN:未知错误

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

当我运行以下代码时:

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 正确配置

tensorflow gpu
1个回答
0
投票

要仔细检查,请使用此文档确认版本依赖性。

另外,NVIDIA驱动安装方式也可能有问题。

在此过程中,您需要在设置 Ubuntu 操作系统时禁用 BIOS 中的安全启动。

请按照以下步骤操作:

  1. 禁用安全启动

  2. 全新安装ubuntu

  3. 安装cuda工具包。

  4. 使用张量流

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