【问题标题】:Enable to installing GPU drivers on VMs on Google Cloud允许在 Google Cloud 上的虚拟机上安装 GPU 驱动程序
【发布时间】:2021-07-29 16:18:25
【问题描述】:

我使用 Ubuntu 18.04 和 GPU 在 Google Cloud 上创建了 VM 实例:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 450.51.06    Driver Version: 450.51.06    CUDA Version: 11.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  Tesla T4            On   | 00000000:00:04.0 Off |                    0 |
| N/A   40C    P8     9W /  70W |      0MiB / 15109MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                                   
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

我尝试使用 Google Cloud Guides 在 VM 上安装 GPU 驱动程序,以使用以下命令安装 CUDA 11 和 NVIDIA® GPU 的相关驱动程序

$wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
$sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600
$sudo apt-key adv --fetch-keys 
$https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
$sudo add-apt-repository "deb 
$https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /"
$sudo apt-get update
$sudo apt-get -y install cuda

但它失败并显示以下消息:

>Reading package lists... Done
>Building dependency tree       
>Reading state information... Done
>Some packages could not be installed. This may mean that you have
>requested an impossible situation or if you are using the unstable
>distribution that some required packages have not yet been created
>or been moved out of Incoming.
>The following information may help to resolve the situation:
>
>The following packages have unmet dependencies:
>cuda : Depends: cuda-11-4 (>= 11.4.0) but it is not going to be installed
>E: Unable to correct problems, you have held broken packages.

有人帮忙解决这个问题吗?

更新:新建实例后,问题解决

【问题讨论】:

    标签: ubuntu google-cloud-platform nvidia


    【解决方案1】:

    您似乎安装了以前的 nvidia 驱动程序或缺乏 cuda 工具包,例如 Ubuntu 存储库中的一些以前的版本,因此您应该先将它们删除。

    sudo apt-get clean && apt-get update
    sudo apt-get purge cuda
    sudo apt-get purge nvidia-*
    sudo apt-get autoremove
    

    然后安装cuda:

    sudo apt-get -y install cuda
    

    【讨论】:

    • 不幸的是它没有帮助,在“清除”之后没有文件被删除
    猜你喜欢
    • 1970-01-01
    • 2020-07-02
    • 2019-06-30
    • 1970-01-01
    • 2018-12-07
    • 2021-09-05
    • 1970-01-01
    • 2023-04-01
    • 2015-01-10
    相关资源
    最近更新 更多