您尚未登录。

#1 2020-02-28 22:33:00

LynnSpeng
会员
注册时间: 2020-02-13
帖子: 6

[已解决] PRIME Render Offload | nvidia-prime 配置

在按照wiki的方法配置之后,执行 prime-run glxinfo 时出现错误,另外 prime-run 执行其他程序时,nvidia-smi 也没有显示相关进程。

这是错误信息:

❯ prime-run glxinfo | grep "OpenGL renderer"
XIO:  fatal IO error 17 (File exists) on X server ":1"
      after 47 requests (47 known processed) with 0 events remaining.
XIO:  fatal IO error 17 (File exists) on X server ":1"
      after 47 requests (47 known processed) with 0 events remaining.
❯ nvidia-smi
Fri Feb 28 22:20:28 2020       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.59       Driver Version: 440.59       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 1060    Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   48C    P8     4W /  N/A |     33MiB /  6078MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0       588      G   /usr/lib/Xorg                                 14MiB |
|    0       915      G   /usr/lib/Xorg                                 15MiB |
+-----------------------------------------------------------------------------+
 
> xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x45 cap: 0x2, Sink Output crtcs: 3 outputs: 3 associated providers: 0 name:modesetting
Provider 1: id: 0x230 cap: 0x0 crtcs: 0 outputs: 0 associated providers: 0 name:NVIDIA-G0

这是相关配置文件:
/etc/X11/xorg.conf

Section "Device"
    Identifier     "dGPU"
    Driver         "nvidia"
    BusID	   "PCI:1:0:0"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Device"
    Identifier     "iGPU"
    Driver         "modesetting"
    Option         "AccelMethod" "sna"
    BusID          "PCI:0:2:0"
EndSection

Section "Screen"
    Identifier     "Default Screen"
    Device         "iGPU"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "AllowEmptyInitialConfiguration"
    SubSection     "Display"
        Depth       24
        Modes      "nvidia-auto-select"
    EndSubSection
EndSection

Section "ServerLayout"
    Identifier     "layout"
    Option 	   "AllowNVIDIAGPUScreens"
EndSection

/etc/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf

Section "OutputClass"
    Identifier "intel"
    MatchDriver "i915"
    Driver "modesetting"
EndSection

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    ModulePath "/usr/lib/nvidia/xorg"
    ModulePath "/usr/lib/xorg/modules"
EndSection

/etc/X11/xorg.conf.d/20-intel.conf

Section "Device"
   Identifier  "Intel Graphics"
   Driver      "intel"
   Option "NoAccel" "True"
EndSection

另外,之前是只使用nvidia显卡的配置方案,optimus.desktop已移除。
其他可能需要的配置文件节选:
/etc/mkinitcpio.conf

# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run.  Advanced users may wish to specify all system modules
# in this array.  For instance:
#     MODULES=(piix ide_disk reiserfs)
MODULES=(intel_agp i915 nvidia nvidia_modeset nvidia_uvm nvidia_drm)
....略....

/etc/default/grub

# GRUB boot loader configuration

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Arch"
#GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nvidia-drm.modeset=1 nopti mitigations=off"
GRUB_CMDLINE_LINUX="nvidia-drm.modeset=1"

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"
...略...

恳请解答,谢谢啦~ wink

最近编辑记录 LynnSpeng (2020-02-29 00:24:12)

离线

#2 2020-02-28 23:13:20

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,443
个人网站

Re: [已解决] PRIME Render Offload | nvidia-prime 配置

很奇怪的错误。另外你有两个 Xorg 进程。为什么是两个呢?

PS: 很可能你直接 pacman -S nvidia-prime 就可以了。不需要自己写一大堆额外的配置了。

离线

#3 2020-02-29 00:08:21

LynnSpeng
会员
注册时间: 2020-02-13
帖子: 6

Re: [已解决] PRIME Render Offload | nvidia-prime 配置

依云 说:

很奇怪的错误。另外你有两个 Xorg 进程。为什么是两个呢?

PS: 很可能你直接 pacman -S nvidia-prime 就可以了。不需要自己写一大堆额外的配置了。

xorg有两个的问题,我查了一下,是gdm的设计,它会创建两个xorg实例,一个用以登录服务,一个用以用户会话,并通过在两者之间快速切换避免了应锁定后恢复引起的闪屏(大概是这样。。。)我就不多说了。

至于 nvidia-prime 我是安装了之后才开始配置的。。。现在我需要完全卸载它,再来一次吗? 比如:

sudo pacman -Rscn nvidia-prime
sudo pacman -S nvidia-prime

离线

#4 2020-02-29 00:23:03

LynnSpeng
会员
注册时间: 2020-02-13
帖子: 6

Re: [已解决] PRIME Render Offload | nvidia-prime 配置

啊,谢谢依云仙子~
我试着看了以下nvidia-prime包的内容,只发现了一个prime-run可执行文件和20-nvidia-prime.conf配置文件(将会被安装到/usr/share/X11/xorg.conf.d/目录下),所以我就尝试将我在/etc/X11/目录下的xorg.conf和/etc/X11/xorg.conf.d/目录下的与显卡有关的配置文件全部删除了,然后重启,问题就解决了。哈哈哈!
再次表示感谢!

离线

页脚