更新:通过安装内核主线 5.6.19-050619-generic 修复了迄今为止的稳定性问题
内核版本 5.6 何时会在 ubuntu 20.04 存储库中提供?++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
我最近购买了一台 acer aspire 7 笔记本电脑型号 A715-41G(具体型号:A715-41G-R8MJ),但在正确设置视频时遇到了问题。
这款笔记本电脑配备 AMD Ryzen 5 3550H 处理器和独立 Nvidia Geforce gtx 1650 显卡(AMD Ryzen 5 3550H 配备 Radeon Vega Mobile Gfx)
System: Kernel: 5.4.0-42-generic x86_64 bits: 64 compiler: gcc v: 9.3.0
parameters: BOOT_IMAGE=/vmlinuz-5.4.0-42-generic root=/dev/mapper/vgubuntu-root ro quiet splash
acpi_backlight=vendor vt.handoff=7
Desktop: Gnome 3.36.3 wm: gnome-shell dm: GDM3 3.34.1 Distro: Ubuntu 20.04.1 LTS (Focal Fossa)
Machine: Type: Laptop System: Acer product: Aspire A715-41G v: V1.00 serial: <filter>
Mobo: PK model: Azalea_PKS v: V1.00 serial: <filter> UEFI: INSYDE v: 1.00 date: 03/13/2020
Battery: ID-1: BAT1 charge: 12.7 Wh condition: 50.1/47.8 Wh (105%) volts: 10.6/11.2 model: LGC AP18C8K type: Li-ion
serial: <filter> status: Discharging
CPU: Topology: Quad Core model: AMD Ryzen 5 3550H with Radeon Vega Mobile Gfx bits: 64 type: MT MCP arch: Zen+
family: 17 (23) model-id: 18 (24) stepping: 1 microcode: 8108109 L2 cache: 2048 KiB
flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 33537
Speed: 1220 MHz min/max: 1400/2100 MHz boost: enabled Core speeds (MHz): 1: 1223 2: 1223 3: 1222 4: 1222 5: 1221
6: 1222 7: 1222 8: 1222
Vulnerabilities: Type: itlb_multihit status: Not affected
Type: l1tf status: Not affected
Type: mds status: Not affected
Type: meltdown status: Not affected
Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl and seccomp
Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization
Type: spectre_v2 mitigation: Full AMD retpoline, IBPB: conditional, STIBP: disabled, RSB filling
Type: srbds status: Not affected
Type: tsx_async_abort status: Not affected
Ubuntu 20.04 安装很顺利,但是当我安装 nvidia 驱动程序(sudo apt install nvidia-driver-440)时,系统重启后崩溃。
解决方案:使用 /etc/modprobe.d/ 中的文件将 nouveau 驱动程序列入黑名单,文件内容如下:
blacklist nouveau
options nouveau modeset = 0
感谢它,我可以启动 Ubuntu
下一个问题:增加和减少亮度的按钮被颠倒了。解决方案:我添加acpi_backlight = vendor
到 /etc/default/grub 文件
另一个问题:由于 nvidia dGPU 一直消耗 4W 电量,导致电池消耗高。
解决方案:我遵循了此页面上的 nvidia 建议:http://download.nvidia.com/XFree86/Linux-x86_64/440.100/README/dynamicpowermanagement.html关于动态电源管理。
我在 /lib/udev/rules.d/ 目录中创建了文件 80-nvidia-pm.rules,内容如下
# Remove NVIDIA USB xHCI Host Controller devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{remove}="1"
# Remove NVIDIA USB Type-C UCSI devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{remove}="1"
# Remove NVIDIA Audio devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{remove}="1"
# Enable runtime PM for NVIDIA VGA/3D controller devices on driver bind
ACTION=="bind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030000", TEST=="power/control", ATTR{power/control}="auto"
ACTION=="bind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030200", TEST=="power/control", ATTR{power/control}="auto"
# Disable runtime PM for NVIDIA VGA/3D controller devices on driver unbind
ACTION=="unbind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030000", TEST=="power/control", ATTR{power/control}="on"
ACTION=="unbind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030200", TEST=="power/control", ATTR{power/control}="on"
我创建了 /etc/modprobe.d/nvidia.conf 文件,内容如下:
options nvidia "NVreg_DynamicPowerManagement=0x02"
由于这一点,电池性能从3小时增加到6小时以上。
在那之前,这些都是这些问题的令人满意的解决方案,但我仍然有一个问题找不到好的解决方案。而且这是最重要的问题。我找不到让 AMD iGPU 和 nvidia dGPU 正常工作的解决方案。
安装 nvidia 驱动并将 nouveau 驱动列入黑名单后,nvidia x server settings 显示一个没有任何内容的窗口,nvidia-smi 命令显示它没有进程。我检查了 /etc/X11 目录,没有 xorg.conf 文件
$ nvidia-smi
Sun Aug 9 00:53:55 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.100 Driver Version: 440.100 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 1650 Off | 00000000:01:00.0 Off | N/A |
| N/A 38C P0 2W / N/A | 0MiB / 3914MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+
$ inxi -xxxG
Graphics: Device-1: NVIDIA vendor: Acer Incorporated ALI driver: nvidia v: 440.100 bus ID: 01:00.0 chip ID: 10de:1f99
Device-2: Advanced Micro Devices [AMD/ATI] Picasso vendor: Acer Incorporated ALI driver: amdgpu v: kernel
bus ID: 05:00.0 chip ID: 1002:15d8
Display: x11 server: X.Org 1.20.8 driver: modesetting unloaded: nvidia alternate: ati,fbdev,nouveau,vesa
compositor: gnome-shell v: 3.36.3 resolution: 1920x1080~60Hz
OpenGL: renderer: AMD RAVEN (DRM 3.35.0 5.4.0-42-generic LLVM 10.0.0) v: 4.6 Mesa 20.0.8 direct render: Yes
$ xrandr --listproviders
Providers: number : 1
Provider 0: id: 0x45 cap: 0x9, Source Output, Sink Offload crtcs: 4 outputs: 2 associated providers: 0 name:modesetting
在网上搜索后,我找到了这个模型 xorg.conf 文件。
Section "ServerLayout"
Identifier "layout"
Option "AllowNVIDIAGPUScreens"
EndSection
Section "Device"
Identifier "AMDGPU"
Driver "amdgpu"
Option "TearFree" "true"
EndSection
Section "OutputClass"
Identifier "iGPU"
MatchDriver "amdgpu"
Driver "modesetting"
EndSection
Section "Device"
Identifier "nvidia"
Driver "nvidia"
EndSection
Section "OutputClass"
Identifier "nvidia"
MatchDriver "nvidia-drm"
Driver "nvidia"
Option "AllowEmptyInitialConfiguration"
ModulePath "/usr/lib/nvidia/xorg"
ModulePath "/usr/lib/xorg/modules"
EndSection
我不喜欢复制和粘贴任何东西,但这使它工作起来,现在 nvidia x 服务器设置显示内容,nvidia-smi 显示进程。
$nvidia-smi
Sun Aug 9 00:43:55 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.100 Driver Version: 440.100 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 1650 Off | 00000000:01:00.0 Off | N/A |
| N/A 36C P8 1W / N/A | 49MiB / 3914MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1249 G /usr/lib/xorg/Xorg 14MiB |
| 0 1897 G /usr/lib/xorg/Xorg 34MiB |
+-----------------------------------------------------------------------------+
$inxi -xxxG
Graphics: Device-1: NVIDIA vendor: Acer Incorporated ALI driver: nvidia v: 440.100 bus ID: 01:00.0 chip ID: 10de:1f99
Device-2: Advanced Micro Devices [AMD/ATI] Picasso vendor: Acer Incorporated ALI driver: amdgpu v: kernel
bus ID: 05:00.0 chip ID: 1002:15d8
Display: x11 server: X.Org 1.20.8 driver: modesetting,nvidia alternate: amdgpu,ati,fbdev,nouveau,vesa
compositor: gnome-shell v: 3.36.3 resolution: 1920x1080~60Hz
OpenGL: renderer: AMD RAVEN (DRM 3.35.0 5.4.0-42-generic LLVM 10.0.0) v: 4.6 Mesa 20.0.8 direct render: Yes
$xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x45 cap: 0x9, Source Output, Sink Offload crtcs: 4 outputs: 2 associated providers: 0 name:modesetting
Provider 1: id: 0x231 cap: 0x0 crtcs: 0 outputs: 0 associated providers: 0 name:NVIDIA-G0
这个解决方案的缺点是导致系统不稳定。登录屏幕上有时不显示指针,尽管我重新启动时需要更长的时间,当我关闭笔记本电脑几分钟后再次打开它时,系统显示黑屏,我甚至没有 ssh 访问权限,只能在尝试一两次后才能完全关闭并再次打开它。
dmesg 显示出现了严重错误
[ 29.654785] kernel: [drm:amdgpu_job_timedout [amdgpu]] *ERROR* ring gfx timeout, signaled seq=1, emitted seq=3
[ 29.654918] kernel: [drm:amdgpu_job_timedout [amdgpu]] *ERROR* Process information: process Xorg pid 1249 thread Xorg:cs0 pid 1344
[ 29.654926] kernel: amdgpu 0000:05:00.0: GPU reset begin!
[ 30.777283] kernel: amdgpu 0000:05:00.0: GPU reset succeeded, trying to resume
[ 30.777892] kernel: [drm] PCIE GART of 1024M enabled (table at 0x000000F400900000).
[ 30.778481] kernel: [drm] PSP is resuming...
[ 30.798357] kernel: [drm] reserve 0x400000 from 0xf47f800000 for PSP TMR
[ 30.809000] kernel: [drm] psp command failed and response status is (0x7)
[ 31.479027] kernel: [drm] VCN decode and encode initialized successfully(under DPG Mode).
[ 31.479037] kernel: amdgpu 0000:05:00.0: ring gfx uses VM inv eng 0 on hub 0
[ 31.479040] kernel: amdgpu 0000:05:00.0: ring comp_1.0.0 uses VM inv eng 1 on hub 0
[ 31.479043] kernel: amdgpu 0000:05:00.0: ring comp_1.1.0 uses VM inv eng 4 on hub 0
[ 31.479045] kernel: amdgpu 0000:05:00.0: ring comp_1.2.0 uses VM inv eng 5 on hub 0
[ 31.479048] kernel: amdgpu 0000:05:00.0: ring comp_1.3.0 uses VM inv eng 6 on hub 0
[ 31.479050] kernel: amdgpu 0000:05:00.0: ring comp_1.0.1 uses VM inv eng 7 on hub 0
[ 31.479052] kernel: amdgpu 0000:05:00.0: ring comp_1.1.1 uses VM inv eng 8 on hub 0
[ 31.479054] kernel: amdgpu 0000:05:00.0: ring comp_1.2.1 uses VM inv eng 9 on hub 0
[ 31.479057] kernel: amdgpu 0000:05:00.0: ring comp_1.3.1 uses VM inv eng 10 on hub 0
[ 31.479059] kernel: amdgpu 0000:05:00.0: ring kiq_2.1.0 uses VM inv eng 11 on hub 0
[ 31.479062] kernel: amdgpu 0000:05:00.0: ring sdma0 uses VM inv eng 0 on hub 1
[ 31.479064] kernel: amdgpu 0000:05:00.0: ring vcn_dec uses VM inv eng 1 on hub 1
[ 31.479065] kernel: amdgpu 0000:05:00.0: ring vcn_enc0 uses VM inv eng 4 on hub 1
[ 31.479068] kernel: amdgpu 0000:05:00.0: ring vcn_enc1 uses VM inv eng 5 on hub 1
[ 31.479070] kernel: amdgpu 0000:05:00.0: ring vcn_jpeg uses VM inv eng 6 on hub 1
[ 31.490635] kernel: [drm] recover vram bo from shadow start
[ 31.490636] kernel: [drm] recover vram bo from shadow done
[ 31.490637] kernel: [drm] Skip scheduling IBs!
[ 31.490675] kernel: ------------[ cut here ]------------
[ 31.490681] kernel: WARNING: CPU: 3 PID: 74 at include/linux/dma-fence.h:533 drm_sched_resubmit_jobs+0x152/0x160 [gpu_sched]
[ 31.490682] kernel: Modules linked in: ccm cmac algif_hash algif_skcipher vboxnetadp(OE) vboxnetflt(OE) af_alg vboxdrv(OE) bnep binfmt_misc nls_iso8859_1 snd_soc_dmic snd_hda_codec_realtek snd_acp3x_pdm_dma acp3x_rn snd_hda_codec_generic ledtrig_audio snd_soc_core snd_hda_codec_hdmi snd_compress ac97_bus snd_pcm_dmaengine snd_hda_intel snd_intel_dspcfg snd_hda_codec uvcvideo joydev snd_hda_core snd_hwdep videobuf2_vmalloc videobuf2_memops edac_mce_amd btusb btrtl videobuf2_v4l2 btbcm snd_pcm videobuf2_common kvm_amd btintel bluetooth snd_seq_midi ccp videodev snd_seq_midi_event iwlmvm ecdh_generic kvm ecc snd_rawmidi mc mac80211 snd_seq snd_seq_device libarc4 snd_timer hid_multitouch input_leds serio_raw acer_wmi wmi_bmof sparse_keymap k10temp iwlwifi snd snd_rn_pci_acp3x snd_pci_acp3x cfg80211 soundcore mac_hid acer_wireless nvidia_uvm(OE) sch_fq_codel parport_pc ppdev lp parport ip_tables x_tables autofs4 dm_crypt nvidia_drm(POE) nvidia_modeset(POE) nvidia(POE) amdgpu crct10dif_pclmul
[ 31.490707] kernel: crc32_pclmul ghash_clmulni_intel amd_iommu_v2 hid_generic aesni_intel gpu_sched i2c_algo_bit ttm crypto_simd cryptd drm_kms_helper glue_helper syscopyarea sysfillrect nvme sysimgblt fb_sys_fops r8169 ahci ipmi_devintf i2c_piix4 drm libahci nvme_core realtek ipmi_msghandler i2c_hid video hid wmi
[ 31.490720] kernel: CPU: 3 PID: 74 Comm: kworker/3:1 Tainted: P OE 5.4.0-42-generic #46-Ubuntu
[ 31.490721] kernel: Hardware name: Acer Aspire A715-41G/Azalea_PKS, BIOS V1.00 03/13/2020
[ 31.490724] kernel: Workqueue: events drm_sched_job_timedout [gpu_sched]
[ 31.490727] kernel: RIP: 0010:drm_sched_resubmit_jobs+0x152/0x160 [gpu_sched]
[ 31.490729] kernel: Code: 41 5c 41 5d 41 5e 41 5f 5d c3 49 8b 46 10 31 c9 48 c7 80 80 00 00 00 00 00 00 00 49 8b 7f 70 31 c0 83 e7 01 74 04 0f 0b eb bf <0f> 0b eb c7 0f 0b eb 8b 66 0f 1f 44 00 00 0f 1f 44 00 00 55 48 89
[ 31.490730] kernel: RSP: 0018:ffffab6b403d3d28 EFLAGS: 00010246
[ 31.490731] kernel: RAX: 0000000000000000 RBX: 0000000000000001 RCX: 0000000000000000
[ 31.490732] kernel: RDX: ffffa069d4b4a280 RSI: ffffa069e3dcb1f8 RDI: 0000000000000000
[ 31.490733] kernel: RBP: ffffab6b403d3d60 R08: 000000000000050b R09: 0000000000000004
[ 31.490733] kernel: R10: 0000000000000000 R11: 0000000000000001 R12: ffffa069d1b87ad8
[ 31.490734] kernel: R13: ffffa069d1b87980 R14: ffffa069e3dcb000 R15: ffffa069d4b4a240
[ 31.490735] kernel: FS: 0000000000000000(0000) GS:ffffa069e88c0000(0000) knlGS:0000000000000000
[ 31.490736] kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 31.490737] kernel: CR2: 00007f4aeb7fdb38 CR3: 00000001e043a000 CR4: 00000000003406e0
[ 31.490738] kernel: Call Trace:
[ 31.490827] kernel: amdgpu_device_gpu_recover+0x6cd/0x95a [amdgpu]
[ 31.490907] kernel: amdgpu_job_timedout+0x103/0x130 [amdgpu]
[ 31.490909] kernel: drm_sched_job_timedout+0x44/0x90 [gpu_sched]
[ 31.490914] kernel: process_one_work+0x1eb/0x3b0
[ 31.490916] kernel: worker_thread+0x4d/0x400
[ 31.490919] kernel: kthread+0x104/0x140
[ 31.490921] kernel: ? process_one_work+0x3b0/0x3b0
[ 31.490922] kernel: ? kthread_park+0x90/0x90
[ 31.490927] kernel: ret_from_fork+0x22/0x40
[ 31.490928] kernel: ---[ end trace 3f6c6090efb5a251 ]---
[ 31.490960] kernel: amdgpu 0000:05:00.0: GPU reset(2) succeeded!
我还验证了 xorg.conf 文件中的以下内容也会导致系统不稳定:
Section "ServerLayout"
Identifier "layout"
Option "AllowNVIDIAGPUScreens"
EndSection
我没有主意了,有人知道如何正确配置这些 AMD + Nvidia 混合图形系统吗?
如果您来到这里,感谢您花时间阅读所有这些内容,我试图提供我所能收集到的所有信息。
如果您发现写作中有什么奇怪的事情,请原谅我,英语不是我的母语,我通常不经常写作
编辑:我能够通过 ssh 进行访问。这是我能够收集的信息pastebin 与 dmesg
唯一的重启方式是使用,echo b /proc/sysrq-trigger
因为两者sudo reboot
都不起作用systemctl reboot
,一切都很慢而且被阻塞
正如我之前所说,笔记本电脑开机时发生崩溃,重启后不会发生这种情况
答案1
我有同样的笔记本电脑,没有时间选择做什么,我刚刚安装了 Pop!_OS,它运行完美,我可以选择仅使用集成、专用或混合 gpu 模式。