Multi-Monitor on Lenovo Legion 5

So, I know there are many options to multi-monitor setups, and I know many issues come hand in hand when using a laptop for various reasons. I'm relatively ignorant of the many intricacies that come with linux, just doing some daily-driving as a normal user for a year and not getting into most of the nitty-gritty technical stuff. So I'll start at the top.

I want to set up a monitor so that I can put some background video on while I work. The catch is, the Legion 5's HDMI and USB-C ports video-out are all hardwired in to the Nvidia graphics card. I have the AMD card set as my main render on the screen because I want more than 5 minutes of battery life when I'm not running power in. Then I just use prime-run %command% to launch games through the more powerful Nvidia card in my day-to-day. You know, a common manual workaround for something most laptops do automatically. The joys of taking some control back, thanks Micro$oft.

I understand from some research that the basic "solution" to this problem is just to use the Nvidia card as my primary and take the hit. But lets be honest; This isn't a real solution, it's a lazy patch that ends up with me only using half of the card I paid for. But the other side of that coin is not using any of the video ports I specifically got this laptop for.

Is there any way to set it up so that when I plug in a monitor it fires up the Nvidia card and renders the output on the monitor? Or, if not, just a way to change the primary card for the entire computer over when a second monitor is plugged in? I don't need the full card 85% of the time, so it seems wasteful to do otherwise.

Kernel: 6.1.9-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 12.2.1
parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
root=UUID=8a83484f-281e-4911-85ab-18297d3c3e0d rw [email protected]
quiet quiet splash rd.udev.log_priority=3 vt.global_cursor_default=0
loglevel=3 ibt=off
Desktop: KDE Plasma v: 5.26.5 tk: Qt v: 5.15.8 info: latte-dock
wm: kwin_x11 vt: 1 dm: SDDM Distro: Garuda Linux base: Arch Linux
Type: Laptop System: LENOVO product: 82RG v: Legion 5 Pro 16ARH7H
serial: <superuser required> Chassis: type: 10 v: Legion 5 Pro 16ARH7H
serial: <superuser required>
Mobo: LENOVO model: LNVNB161216 v: SDK0T76461 WIN
serial: <superuser required> UEFI: LENOVO v: JUCN51WW date: 08/29/2022
ID-1: BAT0 charge: 82.7 Wh (100.0%) condition: 82.7/80.0 Wh (103.3%)
volts: 17.5 min: 15.4 model: Sunwoda L21D4PC1 type: Li-poly serial: <filter>
status: full cycles: 10
Device-1: hidpp_battery_0 model: Logitech Wireless Mouse MX Master 2S
serial: <filter> charge: 55% (should be ignored) rechargeable: yes
status: discharging
Info: model: AMD Ryzen 7 6800H with Radeon Graphics bits: 64 type: MT MCP
arch: Zen 3+ gen: 4 level: v3 note: check built: 2022 process: TSMC n6 (7nm)
family: 0x19 (25) model-id: 0x44 (68) stepping: 1 microcode: 0xA404102
Topology: cpus: 1x cores: 8 tpc: 2 threads: 16 smt: enabled cache:
L1: 512 KiB desc: d-8x32 KiB; i-8x32 KiB L2: 4 MiB desc: 8x512 KiB
L3: 16 MiB desc: 1x16 MiB
Speed (MHz): avg: 1693 high: 4280 min/max: 1600/4784 boost: enabled
scaling: driver: acpi-cpufreq governor: schedutil cores: 1: 1365 2: 1600
3: 1374 4: 1600 5: 1355 6: 4280 7: 1600 8: 1600 9: 1872 10: 1597 11: 1396
12: 1375 13: 1595 14: 1555 15: 1600 16: 1327 bogomips: 102208
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Vulnerabilities: <filter>
Device-1: NVIDIA GA106M [GeForce RTX 3060 Mobile / Max-Q] vendor: Lenovo
driver: nvidia v: 525.85.05 alternate: nouveau,nvidia_drm non-free: 525.xx+
status: current (as of 2022-12) arch: Ampere code: GAxxx
process: TSMC n7 (7nm) built: 2020-22 pcie: gen: 1 speed: 2.5 GT/s
lanes: 8 link-max: gen: 4 speed: 16 GT/s lanes: 16 bus-ID: 01:00.0
chip-ID: 10de:2560 class-ID: 0300
Device-2: AMD Rembrandt [Radeon 680M] vendor: Lenovo driver: amdgpu
v: kernel arch: RDNA-2 code: Navi-2x process: TSMC n7 (7nm) built: 2020-22
pcie: gen: 4 speed: 16 GT/s lanes: 16 ports: active: eDP-1 empty: DP-1,
DP-2, DP-3, DP-4, DP-5, DP-6 bus-ID: 34:00.0 chip-ID: 1002:1681
class-ID: 0300 temp: 39.0 C
Display: x11 server: X.Org v: 21.1.6 with: Xwayland v: 22.1.7
compositor: kwin_x11 driver: X: loaded: amdgpu,nvidia
unloaded: modesetting,nouveau alternate: fbdev,nv,vesa dri: radeonsi
gpu: amdgpu display-ID: :0 screens: 1
Screen-1: 0 s-res: 2560x1600 s-dpi: 96 s-size: 677x423mm (26.65x16.65")
s-diag: 798mm (31.43")
Monitor-1: HDMI-1-0 size-res: N/A modes: N/A
Monitor-2: eDP pos: primary res: 2560x1600 hz: 165 dpi: 189
size: 344x215mm (13.54x8.46") diag: 406mm (15.97") modes: N/A
API: OpenGL v: 4.6 Mesa 22.3.4 renderer: AMD Radeon Graphics (rembrandt
LLVM 15.0.7 DRM 3.49 6.1.9-zen1-1-zen) direct render: Yes
Device-1: NVIDIA GA106 High Definition Audio driver: snd_hda_intel v: kernel
pcie: gen: 1 speed: 2.5 GT/s lanes: 8 link-max: gen: 4 speed: 16 GT/s
lanes: 16 bus-ID: 01:00.1 chip-ID: 10de:228e class-ID: 0403
Device-2: AMD Rembrandt Radeon High Definition Audio vendor: Lenovo
driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16
bus-ID: 34:00.1 chip-ID: 1002:1640 class-ID: 0403
Device-3: AMD ACP/ACP3X/ACP6x Audio Coprocessor vendor: Lenovo
driver: snd_pci_acp6x v: kernel
alternate: snd_pci_acp3x,snd_rn_pci_acp3x,snd_pci_acp5x,snd_acp_pci,snd_rpl_pci_acp6x,snd_pci_ps,snd_sof_amd_renoir,snd_sof_amd_rembrandt
pcie: gen: 4 speed: 16 GT/s lanes: 16 bus-ID: 34:00.5 chip-ID: 1022:15e2
class-ID: 0480
Device-4: AMD Family 17h/19h HD Audio vendor: Lenovo driver: snd_hda_intel
v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16 bus-ID: 34:00.6
chip-ID: 1022:15e3 class-ID: 0403
Sound API: ALSA v: k6.1.9-zen1-1-zen running: yes
Sound Server-1: PulseAudio v: 16.1 running: no
Sound Server-2: PipeWire v: 0.3.65 running: yes
Device-1: MEDIATEK MT7922 802.11ax PCI Express Wireless Network Adapter
vendor: Lenovo driver: mt7921e v: kernel pcie: gen: 2 speed: 5 GT/s lanes: 1
bus-ID: 02:00.0 chip-ID: 14c3:0616 class-ID: 0280
IF: wlp2s0 state: up mac: <filter>
Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
vendor: Lenovo driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1
port: 4000 bus-ID: 03:00.0 chip-ID: 10ec:8168 class-ID: 0200
IF: eno1 state: down mac: <filter>
Device-1: Foxconn / Hon Hai Wireless_Device type: USB driver: btusb v: 0.8
bus-ID: 3-3:3 chip-ID: 0489:e0d8 class-ID: e001 serial: <filter>
Report: bt-adapter ID: hci0 rfk-id: 0 state: up address: <filter>
Local Storage: total: 953.87 GiB used: 151.02 GiB (15.8%)
SMART Message: Unable to run smartctl. Root privileges required.
ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung
model: MZVL21T0HCLR-00BL2 size: 953.87 GiB block-size: physical: 512 B
logical: 512 B speed: 63.2 Gb/s lanes: 4 type: SSD serial: <filter>
rev: CL1QGXA7 temp: 39.9 C scheme: GPT
ID-1: / raw-size: 953.57 GiB size: 953.57 GiB (100.00%)
used: 150.99 GiB (15.8%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
used: 32.6 MiB (10.9%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
ID-3: /home raw-size: 953.57 GiB size: 953.57 GiB (100.00%)
used: 150.99 GiB (15.8%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
ID-4: /var/log raw-size: 953.57 GiB size: 953.57 GiB (100.00%)
used: 150.99 GiB (15.8%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
ID-5: /var/tmp raw-size: 953.57 GiB size: 953.57 GiB (100.00%)
used: 150.99 GiB (15.8%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
ID-1: swap-1 type: zram size: 14.82 GiB used: 0 KiB (0.0%) priority: 100
dev: /dev/zram0
System Temperatures: cpu: 44.4 C mobo: N/A gpu: amdgpu temp: 39.0 C
Fan Speeds (RPM): N/A
Processes: 364 Uptime: 10m wakeups: 4 Memory: 14.82 GiB
used: 3.86 GiB (26.1%) Init: systemd v: 252 default: graphical
tool: systemctl Compilers: gcc: 12.2.1 clang: 15.0.7 Packages: pm: pacman
pkgs: 1686 libs: 532 tools: octopi,paru Shell: fish v: 3.6.0 default: Bash
v: 5.1.16 running-in: konsole inxi: 3.3.24
Garuda (2.6.14-1):
System install date:     2023-01-26
Last full system update: 2023-02-22
Is partially upgraded:   No
Relevant software:       snapper NetworkManager mkinitcpio nvidia-dkms
Windows dual boot:       No/Undetected
Failed units:

The problem you are trying to solve is unclear. It seems like your focus drifts a bit during the course of describing what is happening.

Set up a udev rule to accomplish this: udev - ArchWiki

1 Like

I guess the crux of my problem is trying to keep the efficient AMD card as the main render device and using the Nvidia card as needed. I'm just trying to posit solutions without knowing what is and isn't possible. Really, I'll follow any line of thought as long as it leads to a reasonable solution.

udev looks like it might be a possible solution, but I'll have to do a bunch of reading.

In the mean time I've swapped to using the Nvidia card as my primary by changing my BIOS from Hybrid to Dedicated, so I can use a monitor as a second screen, but it brings up an issue I had before where the UI scale of certain elements are far too big. To the point of cutting off / overlapping on the monitor. Elements inside of windows appear to be the proper scale though.

xrandr | grep -w connected
HDMI-0 connected 1920x1080+334+0 (normal left inverted right x axis y axis) 480mm x 270mm
DP-4 connected primary 2560x1600+0+1080 (normal left inverted right x axis y axis) 344mm x 215mm

UI Scaling issue fixed by forcing Font DPI as 96.