DWM can't go beyond 60FPS

When running UFO test on Dynamic Window Manager it runs at 60 frames per second. Both in chromium and firefox. I have a 240Hz display. I use NVIDIA proprietary drivers.

After setting refresh rate to 240Hz with xrandr, the cursor immediately becomes more fluent.

I also changed line 1116 of dwm.c:

if ((ev.xmotion.time - lasttime) <= (1000 / 60))

to

if ((ev.xmotion.time - lasttime) <= (1000 / 240))

It seems like it made moving windows around smoother. The UFO test still runs at 60FPS.

I tried greping values like 60 or 16, but it seems the above was the only one.

I installed KDE on this system and immediately got 240FPS on the UFO test.

Could you please help me debug this issue?

What are your xorg settings? The time shown there is the time between motion notify events to move/resize windows, this is done for performance reasons and won’t limit your frame rate. dwm doesn’t limit the refresh rates of your monitor or the X server, so if you do

xrandr DisplayPort-0 -auto -rate 240

it should do the trick, just replace the display name with your own.

This can be made to run at login with shell scripts or an xorg config file.

1 Like

Thank you for your reply. I tired this, but it did not resolve the issue. In chromium if I go to chrome://gpu it says that my refresh rate is 239Hz, but UFO test (or any other web test) won’t go above 60.

What is the output from xrandr please

You have any compositor (for example picom or compton) running in your dwm session?

Thank you for your replies. I do not have any compositor. Here’s xrandr output:

Screen 0: minimum 8 x 8, current 2560 x 1440, maximum 32767 x 32767
HDMI-0 disconnected (normal left inverted right x axis y axis)
DP-0 connected primary 2560x1440+0+0 (normal left inverted right x axis y axis) 1mm x 1mm
   2560x1440     59.95 + 239.96*  144.00   120.00
   1920x1080    239.76   143.98   119.88    60.00    59.94    50.00
   1680x1050     59.95
   1600x900      60.00
   1440x900      59.89
   1280x1024     75.02    60.02
   1280x800      59.81
   1280x720      60.00    59.94    50.00
   1152x864      75.00
   1024x768      75.03    70.07    60.00
   800x600       75.00    72.19    60.32    56.25
   720x576       50.00
   720x480       59.94
   640x480       75.00    72.81    59.94
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
DP-4 disconnected (normal left inverted right x axis y axis)
DP-5 disconnected (normal left inverted right x axis y axis)

I have also checked nvidia-settings, but relevant options seem to just be xrandr frontend.

Have you tried running the browser with vblank_mode=0 set?

For example:

vblank_mode=0 firefox

No idea if that would make a difference. My screen is a meagre 60Hz.

I am not sure if UFO Test is accurate in this case. I have a 120hz screen. UFO Test reports 60fps in xmonad (It reports 120 in Cinnamon though). However, vrrTest (Release Variance hotfix · Nixola/VRRTest · GitHub) reports 120. I am not too worried about UFO Test results unless you observed noticable frame drops.

@Head_on_a_Stick Thanks, but unfortunately it does not help

@chroot Thank you for linking that test. Everything works as expected there (I get smooth 240 FPS).

But I still noticeably get only 60 FPS in both Firefox and Chromium. I suspect there must be some parameter or variable that desktop environments set.

If I set layout.frame_rate to 240 in Firefox it solves the problem. Default value for this variable is -1. My best guess is that it means take system’s default. Any ideas how to change that default value?

Does anyone know what does preferred value in xrandr do and how to change it? I have it set to 60 and is currently my only guess on what could be the issue.