Refresh rate issues on Optimus devices

I’ve run into some strange issues with plenty of applications when using nvidia’s PRIME mechanism to render on the nvidia GPU.

Infos about my device:

  • ASUS UX32L
  • nvidia GTX840M (GM108M)
  • All outputs connected to Intel GPU
  • ArchLinux, nvidia 346.47

The issue manifests itself in the following way: Some graphics element updates way faster than the developer intended, eating up all the CPU. In some cases (if the animation speed is bound to a fixed framerate) this also means the animation is sped up.

The issue with the applications does not occur when only using the Intel GPU. It appears to be triggered by buffers swapping faster than expected.

Applications where I have seen this occur:

  • KDE, Plasma 5. See this bug comment. The status indicators spin at insane speeds.
  • Tungsten editor which uses Qt. Whenever some redraws happen, they appear to happen quite a lot.

As I said, the issue isn’t present on other configurations, which is why I’d imagine this is unusual behaviour of the nvidia driver and not per-se bugs in the individual applications.

My hypothesis is that the applications swap buffers on a vertical sync which when there is no real monitor connected might be “as soon as possible”.

Some xrandr output:

✓ fratti@archbook ~ $ xrandr
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 16384 x 16384
eDP-1-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 293mm x 165mm
   1920x1080     60.00*+  40.00  
   1400x1050     59.98  
   1280x1024     60.02  
   1280x960      60.00  
   1024x768      60.04    60.00  
   960x720       60.00  
   928x696       60.05  
   896x672       60.01  
   800x600       60.00    60.32    56.25  
   700x525       59.98  
   640x512       60.02  
   640x480       60.00    59.94  
   512x384       60.00  
   400x300       60.32    56.34  
   320x240       60.05  
DisplayPort-1-0 disconnected (normal left inverted right x axis y axis)
HDMI-1-0 disconnected (normal left inverted right x axis y axis)
HDMI-1-1 disconnected (normal left inverted right x axis y axis)
✓ fratti@archbook ~ $ xrandr --listproviders 
Providers: number : 2
Provider 0: id: 0x1f5 cap: 0x1, Source Output crtcs: 0 outputs: 0 associated providers: 1 name:NVIDIA-0
Provider 1: id: 0x46 cap: 0x2, Sink Output crtcs: 3 outputs: 4 associated providers: 1 name:modesetting


Let me know if I can provide any further assistance.