我有一个英特尔车载GPU和NVIDIA GPU。我在运行Ubuntu 18.04。
如何配置双GPU设置,使英特尔车载iGPU将驱动显示器,留下NVIDIA专为机器学习CUDA工作?
发布于 2018-12-11 05:49:13
我首先在本指南之后安装了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
(如果您尝试这样做,请确保检查您的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)
重新启动后,xorg和其他程序不再出现在nvidia-smi
的输出中。我还用了CUDA-10.0的火把。
请注意,我仍然有所有的NVIDIA驱动器安装,但他们不干预。
更新:对于Ubuntu20.04,需要进行一些额外的更改才能工作。您将找到完整的细节这里。
发布于 2019-04-29 21:12:25
让我分享一下我的食谱,它帮助我在Razer 15笔记本电脑上使用Arch和Gnome桌面环境。
最初,我开始使用Wayland会话来启动Gnome,该会话当时与NVIDIA驱动程序不兼容,因此,自然地,我已经集成了用于显示的图形适配器和用于深入学习的NVIDIA GPU。但是在最近的更新之后,GDM会话开始倒退到Xorg,NVIDIA GPU作为主GPU。问题是:
启动后我运行了nvidia-smi
。我希望看到No running processes found
,但我看到了使用我的NVIDIA的Xorg
进程列表。这意味着Gnome显示管理器使用Xorg会话与NVIDIA GPU作为主GPU。
我检查了/var/log/Xorg.0.log
:
(II) xfree86: Adding drm device (/dev/dri/card1)
(II) systemd-logind: got fd for /dev/dri/card1 226:1 fd 11 paused 0
(II) xfree86: Adding drm device (/dev/dri/card0)
(II) systemd-logind: got fd for /dev/dri/card0 226:0 fd 12 paused 0
(**) OutputClass "nvidia" ModulePath extended to "/usr/lib/nvidia/xorg,/usr/lib/xorg/modules,/usr/lib/xorg/modules"
(**) OutputClass "nvidia" setting /dev/dri/card1 as PrimaryGPU
(**)
意味着该设置已从配置文件中读取!我发现配置文件是/usr/share/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf
。我更改了配置文件,将Intel集成图形适配器设置为主GPU:
Section "OutputClass"
Identifier "intel"
MatchDriver "i915"
Driver "modesetting"
Option "PrimaryGPU" "yes" # <<<<<< add this string
EndSection
Section "OutputClass"
Identifier "nvidia"
MatchDriver "nvidia-drm"
Driver "nvidia"
Option "AllowEmptyInitialConfiguration"
# Option "PrimaryGPU" "yes" # <<<<<< comment this string
ModulePath "/usr/lib/nvidia/xorg"
ModulePath "/usr/lib/xorg/modules"
EndSection
发布于 2019-07-15 23:31:32
由于我没有资格发表评论,我在这里分享了与Maksym Ganenko的答案相关的结果:我在我的ubuntu18.04上尝试了这个解决方案,在那里我使用kde-等离子或ubuntu运行gdm3。您提到的/usr/share/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf
文件在我的系统/usr/share/X11/xorg.conf.d/11-nvidia-prime.conf
上,可能是因为我安装了一段时间的nvidia。编辑这个文件的问题在于,在我的安装/usr/bin/gpu管理器启动一个新的xsession时生成这个文件,所以所有的编辑都丢失了。如本文所述,避免使用带血浆的Xorg的nvidia卡遵循这里给出的建议,gpu管理器覆盖xorg.conf。的解决方案是通过以下方法保护生成的文件不受更改的影响
chattr +i /usr/share/X11/xorg.conf.d/11-nvidia-prime.conf
可能是chmod 444会做同样的事情,但我只是使用了gpu管理器覆盖xorg.conf。中提出的解决方案。
https://askubuntu.com/questions/1061551
复制相似问题