View previous topic :: View next topic |
Author |
Message |
abduct Apprentice

Joined: 19 Mar 2015 Posts: 222
|
Posted: Thu Mar 13, 2025 3:10 am Post subject: wlroots, sway, nvidia hybrid graphics |
|
|
Hello all
I am having a few issues on a legion 5 pro laptop that I've been trying to work through and hopefully someone has some ideas or a definitive answer so I can give up on them. I am running sway wayland with wlroots-0.18.2 and latest proprietary nvidia ~amd64 drivers and my issues are the following:
1) Black grid tearing on external HDMI out
I load sway with "--unsupported-graphics-card" to allow it to launch on my nvidia DGPU. This can be confirmed with sway being in the nvidia-smi process list. When an external monitor is attached, the external monitor is automatically detected and set properly as a display output with valid settings as per "swaymsg -t get-outputs", but it displays black grid like tearing that moves around the screen in blocks. I've had this issue before on other distros and it seems to be a fault of nvidia drivers and wlroots not being cooperative. I've used a similar patch to https://aur.archlinux.org/packages/wlroots-nvidia in the past while on arch and it resolved the issue (all be it not properly as the glfinish call is blocking while glflush is async). I have tried porting the patch to gentoo and after running `PATCHES=/home/abduct/nvidia.patch ebuild path-to-wlroots-0.18.2.ebuild clean prepare` and seeing that the patch was successful followed by a `emerge -a1 wlroots` the issue persisted after a relaunch of sway. I did not try to reboot the system after emerging the patch since I thought relaunching the window manager would be enough. I also did not check the source itself prior to emerging to check if the patch was actually applied at the source level.
Anyways there's been back and forth on this topic it seems since around 2022 and everyone points the issue to nvidia drivers. Is there anything I should attempt to try to try to resolve this tearing? I have also tried to use vulkan rendering via "WLR_RENDERER=vulkan sway --unsupported-graphics-card" unsuccessfully. The black grid tearing persisted.
2) Loading sway on amdgpu IGPU via "WLR_DRM_DEVICES=/dev/dri/.... sway" there is no output on the external HDMI
After confirming that sway is indeed loaded on the AMD IGPU via checking no inputs in nvidia-smi, there is no output on the external HDMI. There is a signal as the external monitor doesn't display "no source", but the entire display is blank. I have a feeling this is due to the external HDMI being tied to the nvidia DGPU. Is there a way around this as it ties into my last issue and perhaps the tearing could be resolved if the AMDGPU took over the HDMI output.
Also on a side note, it appears sway is supposed to automatically default to the IGPU when launched. On my system it defaults to the DGPU hense the manual setting of the DRM device. Not sure if this is related.
3) Trying to power save by following https://wiki.gentoo.org/wiki/Hybrid_graphics#Completely_powering_down_the_Nvidia_dGPU does not seem to work
I've appended the modeprobe and udev rules to their respective files and rebooted the machine, but the power usage via nvidia-smi remains at 10W/135W which according to the wiki means the GPU is still powered on. I have a feeling this might be due to sway using the DGPU, so my next step is to try loading sway onto the IGPU and checking the power state. Is there anything else I can check? Perhaps in /proc, /sys, or dmesg/journalctl to verify if any and all settings from modeprobe/udev files were successfully applied?
Misc information:
PRIME seems to be functioning successfully according to glxgears/glxinfo as the output of the applications as well as nvidia-smi changes accordingly. So I would say anything PRIME related is unrelated to the issues.
I am not to worried about the power saving as my laptop is usually plugged in, but the HDMI screen tearing is a definite issue I want to try to resolve.
Thanks everyone |
|
Back to top |
|
 |
abduct Apprentice

Joined: 19 Mar 2015 Posts: 222
|
Posted: Sat Mar 15, 2025 9:18 pm Post subject: |
|
|
A few more details:
Switching to nvidia-drivers kernel-open had no affect on the external monitor screen tearing.
Some dmesg logs:
Code: | # dmesg | grep nvidia
[ 0.000000] Command line: initrd=\initramfs.img rd.vconsole.keymap=us rd.luks.uuid=c9b8cca7-da5d-4d9d-92b7-cc045d3c498f root=UUID=1fe146d8-ee26-440b-b2dc-72e338b48ef7 quiet loglevel=3 systemd.show_status=auto rd.udev.log_level=3 nvidia_drm.fbdev=1 nvidia_drm.modeset=1
[ 0.048575] Kernel command line: initrd=\initramfs.img rd.vconsole.keymap=us rd.luks.uuid=c9b8cca7-da5d-4d9d-92b7-cc045d3c498f root=UUID=1fe146d8-ee26-440b-b2dc-72e338b48ef7 quiet loglevel=3 systemd.show_status=auto rd.udev.log_level=3 nvidia_drm.fbdev=1 nvidia_drm.modeset=1
[ 14.589256] nvidia-nvlink: Nvlink Core is being initialized, major device number 509
[ 14.589996] nvidia 0000:01:00.0: enabling device (0000 -> 0003)
[ 14.590095] nvidia 0000:01:00.0: vgaarb: VGA decodes changed: olddecodes=io+mem,decodes=none:owns=none
[ 14.710923] nvidia-modeset: Loading NVIDIA UNIX Open Kernel Mode Setting Driver for x86_64 570.124.04 Release Build (portage@localhost) Sat Mar 15 13:13:11 PDT 2025
[ 14.713819] [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver
[ 14.714123] Loading firmware: nvidia/570.124.04/gsp_ga10x.bin
[ 17.390371] [drm] Initialized nvidia-drm 0.0.0 for 0000:01:00.0 on minor 0
[ 17.391227] nvidia 0000:01:00.0: [drm] Cannot find any crtc or sizes
[ 35.820764] nvidia-uvm: Loaded the UVM driver, major device number 506.
[ 147.043157] nvidia 0000:01:00.0: [drm] fb1: nvidia-drmdrmfb frame buffer device
|
Code: | # dmesg | grep vga
[ 0.397066] pci 0000:01:00.0: vgaarb: setting as boot VGA device
[ 0.397066] pci 0000:01:00.0: vgaarb: bridge control possible
[ 0.397066] pci 0000:01:00.0: vgaarb: VGA device added: decodes=io+mem,owns=none,locks=none
[ 0.397066] pci 0000:05:00.0: vgaarb: setting as boot VGA device (overriding previous)
[ 0.397066] pci 0000:05:00.0: vgaarb: bridge control possible
[ 0.397066] pci 0000:05:00.0: vgaarb: VGA device added: decodes=io+mem,owns=none,locks=none
[ 0.397066] vgaarb: loaded
[ 14.508442] snd_hda_intel 0000:01:00.1: Handle vga_switcheroo audio client
[ 14.590095] nvidia 0000:01:00.0: vgaarb: VGA decodes changed: olddecodes=io+mem,decodes=none:owns=none
[ 15.427209] amdgpu: vga_switcheroo: detected switching method \_SB_.PCI0.GP17.VGA_.ATPX handle
[ 15.439277] amdgpu 0000:05:00.0: vgaarb: deactivate vga console
|
I have also discovered that when I use obs-studio to capture the sway workspace the external HDMI monitor is attached to, there is no flickering seen on obs-studio.
Short clip of the grid flicker in question: https://imgur.com/pS8scHB
As you can see the enlarged video playing application is getting cut out and the background is showing (the application is full screen currently) and there is a grid like corruption on the monitor.
Monitor display info:
Code: | ~ $ swaymsg -pt get_outputs
Output HDMI-A-1 'Dell Inc. Dell S2417DG RFNPC91S05VU'
Current mode: 2560x1440 @ 59.951 Hz
Power: on
Position: 0,0
Scale factor: 1.000000
Scale filter: nearest
Subpixel hinting: unknown
Transform: normal
Workspace: 1
Max render time: off
Adaptive sync: disabled
Allow tearing: no
Available modes:
2560x1440 @ 59.951 Hz
1920x1080 @ 59.939 Hz
1920x1080 @ 50.000 Hz
1280x720 @ 59.943 Hz
1280x720 @ 50.000 Hz
1024x768 @ 60.004 Hz
800x600 @ 60.317 Hz
720x576 @ 50.000 Hz
720x480 @ 59.940 Hz
640x480 @ 59.940 Hz
640x480 @ 59.929 Hz
Output eDP-1 'California Institute of Technology 0x1609 Unknown' (focused)
Current mode: 2560x1600 @ 165.019 Hz
Power: on
Position: 2560,0
Scale factor: 1.000000
Scale filter: nearest
Subpixel hinting: unknown
Transform: normal
Workspace: 3
Max render time: off
Adaptive sync: disabled
Allow tearing: no
Available modes:
2560x1600 @ 165.019 Hz
2560x1600 @ 60.008 Hz
1920x1200 @ 165.019 Hz
1920x1080 @ 165.019 Hz
1600x1200 @ 165.019 Hz
1680x1050 @ 165.019 Hz
1280x1024 @ 165.019 Hz
1440x900 @ 165.019 Hz
1280x800 @ 165.019 Hz
1280x720 @ 165.019 Hz
1024x768 @ 165.019 Hz
800x600 @ 165.019 Hz
640x480 @ 165.019 Hz |
|
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|