Skip to content

Commit

Permalink
Picom - Temporarily disable vsync
Browse files Browse the repository at this point in the history
yshui/picom#1265

After a somewhat recent update, picom with vsync enabled causes
slowdown/freezing, and I'm having other nvidia issues (e.g. various issues with
mpv failing to open).

Because I've disable vsync, screen tearing is very bad by default, so I'm
enabling force full composition pipeline now to prevent it.
  • Loading branch information
noctuid committed Jun 8, 2024
1 parent a9aa35e commit 7d83188
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 2 deletions.
3 changes: 2 additions & 1 deletion aesthetics/.config/picom.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ glx-no-rebind-pixmap = true;
use-damage = true;

# * Tearing
vsync = true;
# https://github.com/yshui/picom/issues/1265
vsync = false;

# don't unredirect all windows when there is an opaque fullscreen window (true
# maximizes performance but disables compositing)
Expand Down
13 changes: 13 additions & 0 deletions root/etc/X11/xorg.conf.d/my-xorg.conf
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,16 @@ EndSection

# * GPU
# handled by optimus-manager; not recommended to mess with

# TODO for now am doing manually; see fixtear script
# https://wiki.archlinux.org/title/NVIDIA/Troubleshooting#Multi-monitor
# fix screen tearing
# only keep screen section
# Section "Screen"
# Identifier "Screen0"
# Device "Device0"
# Monitor "Monitor0"
# Option "ForceFullCompositionPipeline" "on"
# Option "AllowIndirectGLXProtocol" "off"
# Option "TripleBuffer" "on"
# EndSection
11 changes: 11 additions & 0 deletions scripts/bin/fixtear
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
# https://wiki.archlinux.org/title/NVIDIA/Troubleshooting#Avoid_screen_tearing
# fixes screen tearing (tested and this works if applied correctly)

# had to run this with monitor connected then disconnect monitor then reconnect
# just sticking with that because it's easy, otherwise would need to specify
# both displays:
# https://wiki.archlinux.org/title/NVIDIA/Troubleshooting#Multi-monitor
nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"

# can validate with: nvidia-settings --query CurrentMetaMode
4 changes: 3 additions & 1 deletion scripts/bin/gpu-switch
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash
# probably won't use this much (will just stay in hybrid mode)
# pretty much only use nvidia mode; too many issues hybrid mode; would use
# integrated only for battery saving
# arg: (integrated|hybrid|nvidia)

echo "Run 'sudo prime-switch' after X stops."
echo "Press anything to continue"
Expand Down
2 changes: 2 additions & 0 deletions scripts/bin/helpers/xenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export QT_AUTO_SCREEN_SCALE_FACTOR=1

if monitor_is_hidpi; then
export MONITOR_IS_HIDPI=true
export POLYBAR_DPI=192

export QT_ENABLE_HIGHDPI_SCALING=1

Expand All @@ -24,6 +25,7 @@ if monitor_is_hidpi; then
# export GDK_DPI_SCALE=0.5
else
export MONITOR_IS_HIDPI=false
export POLYBAR_DPI=96
fi

# * WM and Polybar
Expand Down

2 comments on commit 7d83188

@yaaama
Copy link

@yaaama yaaama commented on 7d83188 Nov 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What nvidia drivers are you using? and which picom are you using?

I was facing the same problem but its fixed now (somehow).

Maybe copying my setup if applicable can help?

Drivers: nvidia-open-dkms

& I'm using the picom-git repo from the AUR.

Try this configuration:

backend = "glx";
detect-transient = true;
detect-client-leader = true;
use-damage = true;
shadow = true;

# vsync seems to work now | forced pipeline comp OFF
vsync = true;

# This stopped helping after upgrading to picom-git
# no-frame-pacing = true;

# Helps mask some issues
fading = true;
fade-delta = 3.0;
fade-in-step = 0.03;
fade-out-step = 0.03;

mark-wmwin-focused = false;
use-ewmh-active-win = true;
unredir-if-possible = true;
mark-ovredir-focused = true;
detect-rounded-corners = false;
use-damage = false;

@noctuid
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it was fixed: yshui/picom#1265

Please sign in to comment.