envycontrol
envycontrol copied to clipboard
Screen tearing in Nvidia mode (AMD + Nvidia system)
When I boot into Nvidia mode, there is a lot of screen tearing. I have AMD intergrated graphics (on Ryzen 5), and an Nvidia GTX 1050.
Laptop: ASUS TUF Gaming FX505DD Distro: Manjaro KDE DE: KDE Plasma WM: SDDM (default) Nvidia driver version: 510.47.03 EnvyControl 1.3
What's the output of cat /proc/cmdline
and are you using dual monitors? Also, what's the output of nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"
Output of cat /proc/cmdline
:
BOOT_IMAGE=/boot/vmlinuz-5.16-x86_64 root=UUID=96529aef-29ca-48e1-9810-0be4ba6af252 rw quiet apparmor=1 security=apparmor udev.log_priority=3
Output of nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"
:
ERROR: Error assigning value nvidia-auto-select+0+0{ForceFullCompositionPipeline=On} to attribute 'CurrentMetaMode' (asowneryt-manjaro:0.0) as specified in assignment 'CurrentMetaMode=nvidia-auto-select +0+0 {
ForceFullCompositionPipeline = On }' (Attribute not available).
I am not using dual monitors, just my laptop screen. Thanks.
You can try to enable KMS for nvidia to see if that fixes the problem. To enable it:
- Open /etc/default/grub with a text editor of choice(with sudo)
- Add the line
nvidia-drm.modeset=1
toGRUB_CMDLINE_LINUX=""
(there should be two of these lines in the file, add it to the one which has an empty quotation marks. You can also append this line instead of adding it to an existing one, it should look something likeGRUB_CMDLINE_LINUX="nvidia-drm.modeset=1"
) - Run
sudo grub-mkconfig -o /boot/grub/grub.cfg
- Reboot
- Check the output of
cat /proc/cmdline
to see if it hasnvidia-drm.modeset=1
included in its output
I followed your instructions but I'm still having the screen tearing issue. nvidia-drm.modeset=1
is included in the output, though. Here's the full output of cat /proc/cmdline
now:
BOOT_IMAGE=/boot/vmlinuz-5.16-x86_64 root=UUID=96529aef-29ca-48e1-9810-0be4ba6af252 rw nvidia-drm.modeset=1 quiet apparmor=1 security=apparmor udev.log_priority=3
Thanks for trying to help btw, I really appreciate it. I've had this problem for ages now, and it would be fantastic to get it fixed.
Can you try to run nvidia-xconfig
as root as that sometimes does fix the problem although be prepared if any problems occur as the file generated by this command sometimes has incorrect screen ids? After running the command, if what you're seeing after a reboot is a black screen, you should open a new tty(ctrl+alt+f{any function num which doesn't point to the current boot session}) and remove the file /etc/X11/xorg.conf
Also can you tell what version of kde you are using?
I ran nvidia-xconfig
as root and restarted my system and it seems that nothing has changed and I'm still having the screen tearing issue. My KDE Plasma version is 5.23.5
In case it helps, here's some more details from the 'About this System' section in KDE settings:
Operating System: Manjaro Linux
KDE Plasma Version: 5.23.5
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2
Kernel Version: 5.16.5-1-MANJARO (64-bit)
Graphics Platform: X11
Processors: 8 × AMD Ryzen 5 3550H with Radeon Vega Mobile Gfx
Memory: 13.7 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1050/PCIe/SSE2
Can you try to follow the instructions at this page(https://wiki.archlinux.org/title/NVIDIA/Troubleshooting#Avoid_screen_tearing_in_KDE_(KWin) to see if that fixes the problem?
@ASOwnerYT, can you confirm if your issue has been fixed or not with the fix that I had sent you?
Nope the issue still isn't fixed. I followed the instructions you sent and it didn't seem to do anything. Thanks.
You can try the following solutions to see if one of these fixes the problem:(each numbered line represents one solution):
- Try running
sudo envycontrol --switch nvidia --dm sddm
- Add
export KWIN_TRIPLE_BUFFER=1
to/etc/profile
- Update your system(as kde plasma did have a recent update recently, although I don't know if it available in the manjaro repos but it is in the arch ones)
- Remove xorg.conf. Set vsync to automatic in kwin settings
I am not using dual monitors, just my laptop screen. Thanks.
Hello there @ASOwnerYT, could you check if modesetting is actually enabled?
Please run:
sudo cat /sys/module/nvidia_drm/parameters/modeset
Also attach the output of this command:
xrandr --prop
Greetings.
@geminis3 The output of the first command was Y, and here's the output of the second command on Pastebin: https://pastebin.com/00Xict0J
@geminis3 The output of the first command was Y, and here's the output of the second command on Pastebin: https://pastebin.com/00Xict0J
I see the problem, PRIME synchronization isn't getting enabled automatically despite using modeset.
Can you try this command?
xrandr --output eDP-1-1 --set "PRIME Synchronization" 1
I tried the command you sent, the screen went black for a few seconds and came back, and it didn't seem to fix the issue. I still have screen tearing. Sorry for the late reply.
Can you try booting a live USB with Pop OS (Nvidia) and check if tearing also appears there?
El jue, 24 de feb. de 2022 01:58, ASOwnerYT @.***> escribió:
I tried the command you sent, the screen went black for a few seconds and came back, and it didn't seem to fix the issue. I still have screen tearing. Sorry for the late reply.
— Reply to this email directly, view it on GitHub https://github.com/geminis3/envycontrol/issues/14#issuecomment-1049550402, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALY7IYNRHZ2SJ6M5RPOAA63U4XJHRANCNFSM5NWLHLNQ . You are receiving this because you were mentioned.Message ID: @.***>
Hey, i have the same issue, it's an issue with Xorg, on Wayland i have no tearing. It was first introduced (for me at least) on xorg 1.20.13. I have a Ryzen 5 4600H+GTX 1650. Here is the issue on their Gitlab, i'd love to have more people chime in with this issue. https://gitlab.freedesktop.org/xorg/xserver/-/issues/1231
Can you try booting a live USB with Pop OS (Nvidia) and check if tearing also appears there? El jue, 24 de feb. de 2022 01:58, ASOwnerYT @.> escribió: … I tried the command you sent, the screen went black for a few seconds and came back, and it didn't seem to fix the issue. I still have screen tearing. Sorry for the late reply. — Reply to this email directly, view it on GitHub <#14 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALY7IYNRHZ2SJ6M5RPOAA63U4XJHRANCNFSM5NWLHLNQ . You are receiving this because you were mentioned.Message ID: @.>
The pop os iso will also have screen tearing, the only way I found for it to fix screen tearing is to enable both Prime Synchronization and for tearfree be enabled for the amdgpu driver when using the nvidia mode and hybrid mode.
I had to create a script that that would run automatically on login in pop-os Script
Note Prime Sync will always show a zero in xrandr be it enable or not, some problems with amd driver apparently
I have found a fix but don't know how to do pull requests or how to actually make it work in python. So in short here is what needs to be done for the nvidia mode to work without screen tearing with amd igou's.
- In your script you need to make the driver in the XORG_CONTENT_AMD for the amdgpu device to be amdgpu not modesetting.
- You will prob need to add additional variable for the XRANDR_SCRIPT since when setting the xrandr provider source it needs to be the name of the amd igpu, but since they all don't have the same name like intel first you need to get it with
xrandr --listproviders
example
$ xrandr --listrprovides
Providers: number : 2
Provider 0: id: 0x1dc cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 4 outputs: 2 associated providers: 1 name:AMD Radeon Vega 8 Graphics @ pci:0000:05:00.0
Provider 1: id: 0x1b7 cap: 0x1, Source Output crtcs: 0 outputs: 0 associated providers: 1 name:NVIDIA-0
The command then needs to look like xrandr --setprovideroutputsource "AMD Radeon Vega 8 Graphics @ pci:0000:05:00.0" NVIDIA-0
- At this point there will be screen tearing when moving the mouse, then the user himself needs to run
xrandr --output eDP-1-0 --set "PRIME Synchronization" 1
(eDP-1-0 being the name of the screen that he get's from runningxrandr -q
.
NOTE
I recommend any amd igpu user to also enable TearFree since it also greatly helps in removing screen tearing and allows you to play games even without a compositor with no tearing no matter the mode used. Here is a script that I recommend for anybody who has a amd + nvidia system to run when logged into the desktop environment
#!/bin/sh
mode=$(envycontrol --status | awk '{ print $5 }')
nv_screen="eDP-1-0" // screen when in nvidia mode
screen="eDP" // screen when in integrated,hybrid mode
if [ "$mode" = "nvidia" ]; then
xrandr --output $nv_screen --set TearFree on
xrandr --output $nv_screen --set "PRIME Synchronization" 1
elif [ "$mode" = "integrated" ]; then
xrandr --output $screen --set TearFree on
elif [ "$mode" = "hybrid" ]; then
xrandr --output $screen --set TearFree on
fi