![直接渲染管理器无法在专有 NVIDIA 驱动程序上与 RTX3060 配合使用](https://linux22.com/image/220364/%E7%9B%B4%E6%8E%A5%E6%B8%B2%E6%9F%93%E7%AE%A1%E7%90%86%E5%99%A8%E6%97%A0%E6%B3%95%E5%9C%A8%E4%B8%93%E6%9C%89%20NVIDIA%20%E9%A9%B1%E5%8A%A8%E7%A8%8B%E5%BA%8F%E4%B8%8A%E4%B8%8E%20RTX3060%20%E9%85%8D%E5%90%88%E4%BD%BF%E7%94%A8.png)
我尝试通过在 Manjaro i3 中设置此内核参数来启用 DRM:
nvidia_drm.modeset=1
但之后系统拒绝启动 lightDM,因为出现以下 Xorg 错误:
failed to create screen resources
经过一番挖掘后,我在内核日志中发现了以下消息,其中提到了 noveau 驱动程序失败,即使我尚未安装 noveau 驱动程序。那么有人能理解这一点吗?
Mai 10 14:47:34 user1-victus kernel: nouveau 0000:01:00.0: timer: stalled at ffffffffffffffff
Mai 10 14:47:34 user1-victus kernel: WARNING: CPU: 14 PID: 746 at drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmtu102.c:43 tu102_vmm_flush+0x165/0x170 [nouveau]
Mai 10 14:47:34 user1-victus kernel: Modules linked in: ntfs3 uas usb_storage ccm cmac algif_hash algif_skcipher af_alg snd_ctl_led snd_soc_skl_hda_dsp snd_soc_intel_hda_dsp_common snd_soc_hdac_hdmi snd_sof_probes snd_hda_codec_realtek snd_hda_codec_generic ledtrig_audio qrtr squas>
Mai 10 14:47:34 user1-victus kernel: polyval_generic ecdh_generic gf128mul videobuf2_vmalloc snd_hda_intel mac80211 fat ghash_clmulni_intel i915 nouveau libarc4 snd_intel_dspcfg videobuf2_memops sha512_ssse3 snd_intel_sdw_acpi videobuf2_v4l2 aesni_intel snd_hda_codec videobuf2_com>
Mai 10 14:47:34 user1-victus kernel: CPU: 14 PID: 746 Comm: Xorg Tainted: G W 6.1.1-1-MANJARO #1 58eeef856bad441bca33a8abb39f91301fd24d8d
Mai 10 14:47:34 user1-victus kernel: Hardware name: HP Victus by HP Laptop 16-d0xxx/88F8, BIOS F.22 11/28/2022
Mai 10 14:47:34 user1-victus kernel: RIP: 0010:tu102_vmm_flush+0x165/0x170 [nouveau]
Mai 10 14:47:34 user1-victus kernel: Code: 8b 40 10 48 8b 78 10 48 8b 5f 50 48 85 db 75 03 48 8b 1f e8 6d 09 a9 c8 48 89 da 48 c7 c7 74 be 47 c1 48 89 c6 e8 c6 64 e8 c8 <0f> 0b eb a5 e8 c2 28 ee c8 66 90 f3 0f 1e fa 0f 1f 44 00 00 ff 74
Mai 10 14:47:34 user1-victus kernel: RSP: 0018:ffffb64ac179b778 EFLAGS: 00010282
Mai 10 14:47:34 user1-victus kernel: WARNING: CPU: 14 PID: 746 at drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmtu102.c:43 tu102_vmm_flush+0x165/0x170 [nouveau]
Mai 10 14:47:34 user1-victus kernel: Modules linked in: ntfs3 uas usb_storage ccm cmac algif_hash algif_skcipher af_alg snd_ctl_led snd_soc_skl_hda_dsp snd_soc_intel_hda_dsp_common snd_soc_hdac_hdmi snd_sof_probes snd_hda_codec_realtek snd_hda_codec_generic ledtrig_audio qrtr squas>
Mai 10 14:47:34 user1-victus kernel: polyval_generic ecdh_generic gf128mul videobuf2_vmalloc snd_hda_intel mac80211 fat ghash_clmulni_intel i915 nouveau libarc4 snd_intel_dspcfg videobuf2_memops sha512_ssse3 snd_intel_sdw_acpi videobuf2_v4l2 aesni_intel snd_hda_codec videobuf2_com>
Mai 10 14:47:34 user1-victus kernel: CPU: 14 PID: 746 Comm: Xorg Tainted: G W 6.1.1-1-MANJARO #1 58eeef856bad441bca33a8abb39f91301fd24d8d
Mai 10 14:47:34 user1-victus kernel: Hardware name: HP Victus by HP Laptop 16-d0xxx/88F8, BIOS F.22 11/28/2022
Mai 10 14:47:34 user1-victus kernel: RIP: 0010:tu102_vmm_flush+0x165/0x170 [nouveau]
Mai 10 14:47:34 user1-victus kernel: Code: 8b 40 10 48 8b 78 10 48 8b 5f 50 48 85 db 75 03 48 8b 1f e8 6d 09 a9 c8 48 89 da 48 c7 c7 74 be 47 c1 48 89 c6 e8 c6 64 e8 c8 <0f> 0b eb a5 e8 c2 28 ee c8 66 90 f3 0f 1e fa 0f 1f 44 00 00 ff 74
Mai 10 14:47:34 user1-victus kernel: RSP: 0018:ffffb64ac179b778 EFLAGS: 00010282
Mai 10 14:47:34 user1-victus kernel: RAX: 0000000000000000 RBX: ffff98e542c9d160 RCX: 0000000000000027
Mai 10 14:47:34 user1-victus kernel: RDX: ffff98eccfba1668 RSI: 0000000000000001 RDI: ffff98eccfba1660
Mai 10 14:47:34 user1-victus kernel: RBP: ffff98e560866400 R08: 0000000000000000 R09: ffffb64ac179b600
Mai 10 14:47:34 user1-victus kernel: R10: 0000000000000003 R11: ffffffff8b4b7110 R12: 0000000005000001
Mai 10 14:47:34 user1-victus kernel: R13: ffff98e560866400 R14: ffff98e5634136c0 R15: 0000000000000000
Mai 10 14:47:34 user1-victus kernel: FS: 00007f6a3d5a2980(0000) GS:ffff98eccfb80000(0000) knlGS:0000000000000000
Mai 10 14:47:34 user1-victus kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Mai 10 14:47:34 user1-victus kernel: CR2: 00007f6a34044060 CR3: 000000012143a004 CR4: 0000000000f70ee0
Mai 10 14:47:34 user1-victus kernel: PKRU: 55555554
Mai 10 14:47:34 user1-victus kernel: Call Trace:
Mai 10 14:47:34 user1-victus kernel: <TASK>
Mai 10 14:47:34 user1-victus kernel: nvkm_vmm_unref_pdes+0xeb/0x1f0 [nouveau b94536815bcbee6c07bf0305391ef14c5a1db60e]
Mai 10 14:47:34 user1-victus kernel: nvkm_vmm_unref_pdes+0x182/0x1f0 [nouveau b94536815bcbee6c07bf0305391ef14c5a1db60e]
Mai 10 14:47:34 user1-victus kernel: nvkm_vmm_unref_pdes+0x182/0x1f0 [nouveau b94536815bcbee6c07bf0305391ef14c5a1db60e]
Mai 10 14:47:34 user1-victus kernel: nvkm_vmm_unref_pdes+0x182/0x1f0 [nouveau b94536815bcbee6c07bf0305391ef14c5a1db60e]
Mai 10 14:47:34 user1-victus kernel: nvkm_vmm_unref_ptes+0x18c/0x250 [nouveau b94536815bcbee6c07bf0305391ef14c5a1db60e]
Mai 10 14:47:34 user1-victus kernel: nvkm_vmm_iter.constprop.0+0x2a5/0x890 [nouveau b94536815bcbee6c07bf0305391ef14c5a1db60e]
Mai 10 14:47:34 user1-victus kernel: ? nvkm_vmm_iter.constprop.0+0x2a5/0x890 [nouveau b94536815bcbee6c07bf0305391ef14c5a1db60e]
Mai 10 14:47:34 user1-victus kernel: ? nvkm_vmm_ptes_sparse+0x1e0/0x1e0 [nouveau b94536815bcbee6c07bf0305391ef14c5a1db60e]
Mai 10 14:47:34 user1-victus kernel: nvkm_vmm_put_locked+0x109/0x280 [nouveau b94536815bcbee6c07bf0305391ef14c5a1db60e]
Mai 10 14:47:34 user1-victus kernel: ? nvkm_vmm_ptes_sparse+0x1e0/0x1e0 [nouveau b94536815bcbee6c07bf0305391ef14c5a1db60e]
Mai 10 14:47:34 user1-victus kernel: nvkm_uvmm_mthd+0x686/0x6b0 [nouveau b94536815bcbee6c07bf0305391ef14c5a1db60e]
Mai 10 14:47:34 user1-victus kernel: nvkm_ioctl+0xd9/0x180 [nouveau b94536815bcbee6c07bf0305391ef14c5a1db60e]
Mai 10 14:47:34 user1-victus kernel: nvif_object_mthd+0xcc/0x200 [nouveau b94536815bcbee6c07bf0305391ef14c5a1db60e]
Mai 10 14:47:34 user1-victus kernel: nvif_vmm_put+0x64/0x80 [nouveau b94536815bcbee6c07bf0305391ef14c5a1db60e]
Mai 10 14:47:34 user1-victus kernel: nouveau_vma_del+0x80/0xd0 [nouveau b94536815bcbee6c07bf0305391ef14c5a1db60e]
Mai 10 14:47:34 user1-victus kernel: nouveau_gem_object_close+0x1eb/0x220 [nouveau b94536815bcbee6c07bf0305391ef14c5a1db60e]
Mai 10 14:47:34 user1-victus kernel: drm_gem_handle_delete+0x6a/0xd0
Mai 10 14:47:34 user1-victus kernel: ? drm_mode_destroy_dumb+0x40/0x40
Mai 10 14:47:34 user1-victus kernel: drm_ioctl_kernel+0xca/0x170
Mai 10 14:47:34 user1-victus kernel: drm_ioctl+0x1eb/0x450
Mai 10 14:47:34 user1-victus kernel: ? drm_mode_destroy_dumb+0x40/0x40
Mai 10 14:47:34 user1-victus kernel: nouveau_drm_ioctl+0x5a/0xb0 [nouveau b94536815bcbee6c07bf0305391ef14c5a1db60e]
Mai 10 14:47:34 user1-victus kernel: __x64_sys_ioctl+0x91/0xd0
Mai 10 14:47:34 user1-victus kernel: do_syscall_64+0x5c/0x90
Mai 10 14:47:34 user1-victus kernel: ? syscall_exit_to_user_mode+0x1b/0x40
Mai 10 14:47:34 user1-victus kernel: ? do_syscall_64+0x6b/0x90
Mai 10 14:47:34 user1-victus kernel: ? exit_to_user_mode_prepare+0x145/0x1d0
Mai 10 14:47:34 user1-victus kernel: ? syscall_exit_to_user_mode+0x1b/0x40
Mai 10 14:47:34 user1-victus kernel: ? do_syscall_64+0x6b/0x90
Mai 10 14:47:34 user1-victus kernel: ? exc_page_fault+0x74/0x170
Mai 10 14:47:34 user1-victus kernel: entry_SYSCALL_64_after_hwframe+0x63/0xcd
Mai 10 14:47:34 user1-victus kernel: RIP: 0033:0x7f6a3df23c0f
Mai 10 14:47:34 user1-victus kernel: Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 18 48 8b 44 24 18 64 48 2b 04 25 28 00 00
Mai 10 14:47:34 user1-victus kernel: RSP: 002b:00007ffcd9c547d0 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
Mai 10 14:47:34 user1-victus kernel: RAX: ffffffffffffffda RBX: 0000561a976c48d0 RCX: 00007f6a3df23c0f
Mai 10 14:47:34 user1-victus kernel: RDX: 00007ffcd9c54864 RSI: 00000000c00464b4 RDI: 0000000000000015
Mai 10 14:47:34 user1-victus kernel: RBP: 00007ffcd9c54864 R08: 0000561a976da840 R09: 00007f6a3e0857a0
Mai 10 14:47:34 user1-victus kernel: R10: 0000000000000050 R11: 0000000000000246 R12: 00000000c00464b4
Mai 10 14:47:34 user1-victus kernel: R13: 0000000000000015 R14: 0000561a96eef7a0 R15: 00007f6a3d4c8a60
Mai 10 14:47:34 user1-victus kernel: </TASK>
Ma
答案1
我想我终于想通了。至少autorandr现在终于检测到外部屏幕的插入,这是我想要启用drm的主要原因。
我关注了下面的文章 https://vfbsilva.medium.com/howto-set-up-prime-with-nvidia-proprietary-driver-c647e3597447
第1步:卸载大黄蜂
步骤 2:将 /etc/X11/xorg.conf.d/90-mhwd.conf 更改为:
Section "Module"
Load "modesetting"
EndSection
Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:1:0:0"
Option "AllowEmptyInitialConfiguration"
EndSection
步骤 3 将 /etc/modprobe.d/mhwd-gpu.conf 更改为
##
## Generated by mhwd - Manjaro Hardware Detection
##
blacklist nouveau
#blacklist ttm
#blacklist drm_kms_helper
#blacklist drm
options nvidia "NVreg_DynamicPowerManagement=0x02"
blacklist nvidiafb
blacklist rivafb
options nvidia_drm modeset=1
步骤4
创建此文件(/usr/local/bin/optimus.sh)
#!/bin/sh
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
使其可执行
chmod a+rx /usr/local/bin/optimus.sh
编辑 /etc/lightdm/lightdm.conf 并设置(如果您使用其他 dm,请查看文章)
display-setup-script=/usr/local/bin/optimus