![在 Ubuntu 20.04 上为 Razer Stealth 2020 笔记本电脑配置混合显卡和 HDMI 的 xserver](https://linux22.com/image/1632999/%E5%9C%A8%20Ubuntu%2020.04%20%E4%B8%8A%E4%B8%BA%20Razer%20Stealth%202020%20%E7%AC%94%E8%AE%B0%E6%9C%AC%E7%94%B5%E8%84%91%E9%85%8D%E7%BD%AE%E6%B7%B7%E5%90%88%E6%98%BE%E5%8D%A1%E5%92%8C%20HDMI%20%E7%9A%84%20xserver.png)
我一直在努力正确配置我的系统以使我的混合图形正常工作。
我的笔记本电脑有 USB-C(雷电)HDMI,无法检测外接显示器。此外,如果没有 i915.modeset=0,无论我是否安装了 nouveau、nvidia 或没有安装专用显卡驱动程序,我都无法启动系统。
我的系统:
lspci | egrep 'VGA|3D|USB|Intel'
00:00.0 Host bridge: Intel Corporation Device 8a12 (rev 03)
00:02.0 VGA compatible controller: Intel Corporation Iris Plus Graphics G7 (rev 07)
00:04.0 Signal processing controller: Intel Corporation Device 8a03 (rev 03)
00:07.0 PCI bridge: Intel Corporation Ice Lake Thunderbolt 3 PCI Express Root Port #0 (rev 03)
00:07.1 PCI bridge: Intel Corporation Ice Lake Thunderbolt 3 PCI Express Root Port #1 (rev 03)
00:0d.0 USB controller: Intel Corporation Ice Lake Thunderbolt 3 USB Controller (rev 03)
00:0d.2 System peripheral: Intel Corporation Ice Lake Thunderbolt 3 NHI #0 (rev 03)
00:14.0 USB controller: Intel Corporation Ice Lake-LP USB 3.1 xHCI Host Controller (rev 30)
00:14.2 RAM memory: Intel Corporation Device 34ef (rev 30)
00:14.3 Network controller: Intel Corporation Killer Wi-Fi 6 AX1650i 160MHz Wireless Network Adapter (201NGW) (rev 30)
00:15.0 Serial bus controller [0c80]: Intel Corporation Ice Lake-LP Serial IO I2C Controller #0 (rev 30)
00:15.1 Serial bus controller [0c80]: Intel Corporation Ice Lake-LP Serial IO I2C Controller #1 (rev 30)
00:16.0 Communication controller: Intel Corporation Management Engine Interface (rev 30)
00:1d.0 PCI bridge: Intel Corporation Ice Lake-LP PCI Express Root Port #9 (rev 30)
00:1d.4 PCI bridge: Intel Corporation Device 34b4 (rev 30)
00:1f.0 ISA bridge: Intel Corporation Ice Lake-LP LPC Controller (rev 30)
00:1f.3 Multimedia audio controller: Intel Corporation Smart Sound Technology Audio Controller (rev 30)
00:1f.4 SMBus: Intel Corporation Ice Lake-LP SMBus Controller (rev 30)
00:1f.5 Serial bus controller [0c80]: Intel Corporation Ice Lake-LP SPI Controller (rev 30)
58:00.0 3D controller: NVIDIA Corporation Device 1f95 (rev a1)
我的 nvidia 驱动程序似乎已正确安装,因为我能够运行带有 gpu 加速和 opengl 4.6 的程序:
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia glxgears -info
Running synchronized to the vertical refresh. The framerate should be
approximately the same as the monitor refresh rate.
GL_RENDERER = GeForce GTX 1650 Ti with Max-Q Design/PCIe/SSE2
GL_VERSION = 4.6.0 NVIDIA 450.66
GL_VENDOR = NVIDIA Corporation
但是,如果不使用这些环境变量,它确实会选择 llvmpipe 进行渲染。使用 prime-select 或 optirun 时也是如此。
我无法让它与以下两者一起工作:
- 带有和不带有 xorg.conf 的 bumblebee
- nvidia 专有驱动程序、prime-select 和各种 xorg.conf,包括 nvidia-xconfig
- 设置 nvidia-drv.modeset=1 内核选项失败,并显示“无法在帧缓冲模式下运行”
在所有情况下,系统都会锁定,并且无法切换到终端或重新启动 xserver。
以下是 xorg.log 的摘录。我的日志不包含任何错误,但它可疑地将模式设置为“NULL”,并选择渲染到尺寸为 640 x 480 的虚拟屏幕:
14.363] (==) NVIDIA(G0): Depth 24, (==) framebuffer bpp 32
[ 14.363] (==) NVIDIA(G0): RGB weight 888
[ 14.363] (==) NVIDIA(G0): Default visual is TrueColor
[ 14.363] (==) NVIDIA(G0): Using gamma correction (1.0, 1.0, 1.0)
[ 14.363] (II) Applying OutputClass "nvidia" options to /dev/dri/card0
[ 14.363] (**) NVIDIA(G0): Option "AllowEmptyInitialConfiguration"
[ 14.363] (**) NVIDIA(G0): Enabling 2D acceleration
[ 14.363] (II) Loading sub module "glxserver_nvidia"
[ 14.363] (II) LoadModule: "glxserver_nvidia"
[ 14.364] (II) Loading /usr/lib/x86_64-linux-gnu/nvidia/xorg/libglxserver_nvidia.so
[ 14.368] (II) Module glxserver_nvidia: vendor="NVIDIA Corporation"
[ 14.368] compiled for 1.6.99.901, module version = 1.0.0
[ 14.368] Module class: X.Org Server Extension
[ 14.368] (II) NVIDIA GLX Module 450.66 Wed Aug 12 19:41:37 UTC 2020
[ 14.368] (II) NVIDIA: The X server supports PRIME Render Offload.
[ 14.369] (II) NVIDIA(G0): NVIDIA GPU GeForce GTX 1650 Ti with Max-Q Design (TU117-A) at
[ 14.369] (II) NVIDIA(G0): PCI:88:0:0 (GPU-0)
[ 14.369] (--) NVIDIA(G0): Memory: 4194304 kBytes
[ 14.369] (--) NVIDIA(G0): VideoBIOS: 90.17.50.00.0e
[ 14.369] (II) NVIDIA(G0): Detected PCI Express Link width: 16X
[ 14.369] (II) NVIDIA(G0): Validated MetaModes:
[ 14.369] (II) NVIDIA(G0): "NULL"
[ 14.369] (II) NVIDIA(G0): Virtual screen size determined to be 640 x 480
[ 14.369] (WW) NVIDIA(G0): Unable to get display device for DPI computation.
[ 14.369] (==) NVIDIA(G0): DPI set to (75, 75); computed from built-in default
[ 14.369] (II) UnloadModule: "vesa"
[ 14.369] (II) Unloading vesa
[ 14.370] (II) FBDEV(0): FBIOBLANK: Invalid argument (Screen blanking not supported by kernel - disabling)
[ 14.370] (==) FBDEV(0): Backing store enabled
[ 14.370] (==) FBDEV(0): DPMS enabled
[ 14.370] (II) NVIDIA: Using 24576.00 MB of virtual memory for indirect memory
[ 14.370] (II) NVIDIA: access.
[ 14.394] (II) NVIDIA(G0): Setting mode "NULL"
[ 14.398] (==) NVIDIA(G0): Disabling shared memory pixmaps
[ 14.398] (==) NVIDIA(G0): Backing store enabled
[ 14.398] (==) NVIDIA(G0): Silken mouse enabled
[ 14.398] (==) NVIDIA(G0): DPMS enabled
[ 14.398] (WW) NVIDIA(G0): Option "VirtualHeads" is not used
[ 14.398] (II) Loading sub module "dri2"
[ 14.398] (II) LoadModule: "dri2"
[ 14.399] (II) Module "dri2" already built-in
[ 14.399] (II) NVIDIA(G0): [DRI2] Setup complete
[ 14.399] (II) NVIDIA(G0): [DRI2] VDPAU driver: nvidia
欢迎任何建议
编辑:似乎我的系统受到 i915 中一个严重错误的影响,并且正在上游解决:
https://gitlab.freedesktop.org/drm/intel/-/issues/2414
相关问题:
https://askubuntu.com/questions/893817/boot-very-slow-because-of-drm-kms-helper-errors
答案1
发现了一个解决方法,添加 intremap=off 可以解决除暂停循环之外的所有问题。
来源:https://gitlab.freedesktop.org/drm/intel/-/issues/2414#note_631004