簡體   English   中英

cudaGetDevice() 失敗。 狀態:CUDA 驅動程序版本對於 CUDA 運行時版本不足(在 GCP - 在 VNC GUI 中運行的 Ubuntu 18 LTS)

[英]cudaGetDevice() failed. Status: CUDA driver version is insufficient for CUDA runtime version (on GCP - Ubuntu 18 LTS running in VNC GUI)

我已點擊此鏈接按順序獲取我的所有版本:

我需要將 Tensorflow_GPU_1.14.0 用於遺留代碼。

所以:

tensorflow_gpu-1.14.0
蟒蛇:2.7、3.3-3.7
立方網絡:7.4
庫達:10.0

import tensorflow as tf; print(tf.__version__)

返回 1.14.0

我的 nvcc 版本是:

nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:01_CDT_2018
Cuda compilation tools, release 10.0, V10.0.130

我的 nvidia-smi 是:

nvidia-smi
Wed Jan 22 16:47:10 2020       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 410.104      Driver Version: 410.104      CUDA Version: 10.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Tesla K80           Off  | 00000000:00:04.0 Off |                    0 |
| N/A   47C    P8    31W / 149W |     27MiB / 11441MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      2524      G   /usr/lib/xorg/Xorg                             9MiB |
|    0      2574      G   /usr/bin/gnome-shell                           6MiB |
+-----------------------------------------------------------------------------+

我的 Cudnn 版本是:

cat /usr/include/cudnn.h | grep CUDNN_MAJOR -A 2
#define CUDNN_MAJOR 7
#define CUDNN_MINOR 4
#define CUDNN_PATCHLEVEL 2
--
#define CUDNN_VERSION (CUDNN_MAJOR * 1000 + CUDNN_MINOR * 100 + CUDNN_PATCHLEVEL)
#include "driver_types.h"

我的蟒蛇版本:

import sys

print(sys.version)
3.6.10 |Anaconda, Inc.| (default, Jan  7 2020, 21:14:29) 
[GCC 7.3.0]

我正在使用 Ubuntu 18.04 LTS

為了在下面的評論部分擴展羅伯特的回答,我首先使用卸載了現有的 nvidia

sudo apt-get purge nvidia-*

然后使用安裝最新版本

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
sudo apt upgrade
ubuntu-drivers list

然后從我選擇的列表中

sudo apt install nvidia-driver-VERSION_NUMBER_HERE

然后我sudo reboot我的實例,並在 Jupyter notebook 中執行以下代碼。

import tensorflow as tf
print(('Is your GPU available for use?\n{0}').format(
    'Yes, your GPU is available: True' if tf.test.is_gpu_available() == True else 'No, your GPU is NOT available: False'
))

print(('\nYour devices that are available:\n{0}').format(
    [device.name for device in tf.config.experimental.list_physical_devices()]
))

它奏效了

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM