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

Joined: 19 Mar 2015 Posts: 220
|
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 |
|
 |
|
|
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
|
|