如何为 xserver 配置 iGPU 和为 CUDA 工作配置 nvidia GPU

sta*_*son 18 xorg graphics cuda drivers dual-graphics

我有一个英特尔板载 GPU 和 NVIDIA GPU。我正在运行 Ubuntu 18.04。

如何配置双 GPU 设置,以便英特尔板载 iGPU 驱动显示器,而让 NVIDIA GPU 专门用于机器学习 CUDA 工作?

sta*_*son 16

我首先按照本指南安装了 NVIDIA 驱动程序和 CUDA 软件包。除了,在重新启动后,我最终/usr/lib/xorg/Xorg出现在nvidia-smi. 这并不好,因为我需要让所有 NVIDIA GPU RAM 都可用于我的工作。

经过一番研究,我找到了解决我问题的解决方案:

我创建/etc/X11/xorg.conf了以下内容:

Section "Device"
    Identifier      "intel"
    Driver          "intel"
    BusId           "PCI:0:2:0"
EndSection

Section "Screen"
    Identifier      "intel"
    Device          "intel"
EndSection
Run Code Online (Sandbox Code Playgroud)

(如果您尝试做同样的事情,请务必检查您的 GPU 在哪里。我的在00:02.0其上转换为PCI:0:2:0

% lspci  | grep VGA
00:02.0 VGA compatible controller: Intel Corporation Device 3e92
01:00.0 VGA compatible controller: NVIDIA Corporation GP104 (rev a1)
Run Code Online (Sandbox Code Playgroud)

重启后,xorg等程序不再出现在nvidia-smi. 我能够在 CUDA-10.0 中使用 pytorch。

请注意,我仍然安装了所有 NVIDIA 驱动程序,但它们不会干扰。


更新:对于 Ubuntu 20.04,需要一些额外的更改才能工作。您将在此处找到完整的详细信息。

  • 兄弟,你救了我的一天……我花了大约十个小时试图在 Ubuntu 19.04 上弄明白……我卸载了 NVIDIA 驱动程序,但永远无法正确恢复!我重新安装了 Ubuntu 19.04 并使用了你的方法。像魔术一样工作! (3认同)
  • 确认:它适用于 Ubuntu 19.04 nvidia-driver-418 和 NVIDIA Quadro GV100 (2认同)