NVIDIA-SMI 失败,因为它无法与 NVIDIA 驱动程序通信。确保安装并运行了最新的 NVIDIA 驱动程序。为什么?

Har*_*vey 3 gpu nvidia tensorflow google-colaboratory

我正在尝试在 Google Colab 上运行 stylegan2,但使用我的 Drive 上的所有文件,并避免使用 !git clone 来自stylegan2github。这是我在特定单元格上的代码:

    %tensorflow_version 1.x
    %cd /content/drive/My Drive/stylegan2-master/
    !nvcc test_nvcc.cu -o test_nvcc -run
    print('Tensorflow version: {}'.format(tf.__version__) )
    !nvidia-smi -L
    print('GPU Identified at: {}'.format(tf.test.gpu_device_name()))
Run Code Online (Sandbox Code Playgroud)

结果:

/content/drive/My Drive/stylegan2-master CPU 打招呼。cudaErrorNoDevice:未检测到支持 CUDA 的设备 Tensorflow 版本:1.15.2 NVIDIA-SMI 失败,因为它无法与 NVIDIA 驱动程序通信。确保安装并运行了最新的 NVIDIA 驱动程序。

GPU 标识于:

为什么我无法获得 GPU?我是该领域的新手,所以我可能会遗漏一些非常简单的东西,但仍然无法在互联网上找到答案。

小智 11

您必须先在 Notebook 设置中启用 GPU。

您可以通过单击Edit > Notebook settings并选择 GPU 作为硬件加速器来轻松完成。

应该是这样。