Linux虚拟机安装NVIDIA显卡驱动

说明

驱动程序安装步骤

  1. 查看vGPU加载情况,命令:lspci;查询结果中有NVIDIA字样为正常;否则为异常,请联系技术支持处理。

    图-2 vGPU加载情况

  2. 将从NVIDIA官网获取的驱动程序通过ftp方式上传至虚拟机。

    图-3 上传驱动程序

  3. 在虚拟机中安装驱动程序。

    • 依次执行下列命令,完成安装。

      [root@localhost ~]# chmod +x NVIDIA-Linux-x86_64-440.56-grid.run

      [root@localhost ~]# init 3

      [root@localhost ~]# ./NVIDIA-Linux-x86_64-440.56-grid.run

      图-4 安装完成

    • 如出现如下报错,请执行下列步骤,以完成安装。

      图-5 安装报错

    • 执行如下命令。

      [root@localhost ~]# sh NVIDIA-Linux-x86_64-440.56-grid.run -k $(uname -r)

      Respond to the installer prompts as follows:

      Accept the EULA

      Say no to installing 32-bit binaries

      Say no to modifying the x.org file

    • 返回执行结果,如下图所示。

      图-6 执行结果

  4. 完成安装后,执行命令:nvidia-smi,查看vGPU的信息,此时vGPU即可正常使用。

    图-7 查看信息