You are not logged in.

#1 2023-12-21 04:23:36

Crylia
Member
Registered: 2021-11-27
Posts: 8

KDE on xorg with Nvidia GPU and two different refresh rates

I have a problem with my current setup, I know that I had it fixed on a previous installation, but I can't find the information I need to do it again

I basically have two monitors where the main one is g sync compatible with 144hz and the second one that it is not compatible with 60hz.
I tried to enable VRR on xorg by going into the NVIDIA settings and enabling full composite pipelining, forcing it and checking g sync for my main monitor, but with no success.
Apparently that's all it takes according to the wiki, but it doesn't work for me. I'm still stuck at 60fps, even in full screen games. There is a rather extensive section for AMD, but I don't know if I can just copy that

The only changes I made are to the NVIDIA settings.

Could anyone help me with this issue?

https://imgur.com/a/ccFiGch

Last edited by Crylia (2023-12-21 04:24:15)

Offline

#2 2023-12-21 10:07:34

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 24,913

Re: KDE on xorg with Nvidia GPU and two different refresh rates

Don't enable the composition pipeline (that will basically guaranteed get you stuck on 60hz), just tell it to gsync against the gsync capable monitor.

FWIW chances are KWin will logically limit you here can you reproduce when disabling the compositor with Alt+Shift+F12 ? What's your output for

qdbus org.kde.KWin /KWin org.kde.KWin.supportInformation

Offline

#3 2023-12-21 11:22:12

Crylia
Member
Registered: 2021-11-27
Posts: 8

Re: KDE on xorg with Nvidia GPU and two different refresh rates

I disabled the compositor and I get indeed my 144hz

Here is the ouput:

KWin-Unterstützungsinformationen:
Benutzen Sie die folgenden Informationen, wenn Sie nach Unterstützung fragen, z. B. auf https://forum.kde.org
Sie enthalten Informationen über die momentan laufende Instanz, welche Optionen verwendet werden,
welcher OpenGL-Treiber verwendet wird und welche Effekte laufen.
Bitte geben Sie die unten stehenden Informationen bei einem Pastebin-Dienst wie https://paste.kde.org ein, anstatt sie direkt in die Hilfediskussionen zu schreiben.

==========================

Version
=======
KWin version: 5.27.10
Qt Version: 5.15.11
Qt compile version: 5.15.11
XCB compile version: 1.16

Operation Mode: X11 only

Build Options
=============
KWIN_BUILD_DECORATIONS: yes
KWIN_BUILD_TABBOX: yes
KWIN_BUILD_ACTIVITIES: yes
HAVE_X11_XCB: yes
HAVE_EPOXY_GLX: yes

X11
===
Vendor: The X.Org Foundation
Vendor Release: 12101010
Protocol Version/Revision: 11/0
SHAPE: yes; Version: 0x11
RANDR: yes; Version: 0x14
DAMAGE: yes; Version: 0x11
Composite: yes; Version: 0x4
RENDER: yes; Version: 0xb
XFIXES: yes; Version: 0x50
SYNC: yes; Version: 0x31
GLX: yes; Version: 0x0

Decoration
==========
Plugin: org.kde.klassy
Theme: 
Plugin recommends border size: None
onAllDesktopsAvailable: false
alphaChannelSupported: false
closeOnDoubleClickOnMenu: false
decorationButtonsLeft: 0, 2
decorationButtonsRight: 6, 3, 4, 5
borderSize: 3
gridUnit: 10
font: Noto Sans,10,-1,0,50,0,0,0,0,0
smallSpacing: 2
largeSpacing: 10

Output backend
==============
Name: KWin::X11StandaloneBackend

Cursor
======
themeName: breeze_cursors
themeSize: 24

Options
=======
focusPolicy: 0
xwaylandCrashPolicy: 
xwaylandMaxCrashCount: 3
nextFocusPrefersMouse: false
clickRaise: true
autoRaise: false
autoRaiseInterval: 0
delayFocusInterval: 0
shadeHover: false
shadeHoverInterval: 250
separateScreenFocus: false
activeMouseScreen: true
placement: 
activationDesktopPolicy: 0
focusPolicyIsReasonable: true
borderSnapZone: 10
windowSnapZone: 10
centerSnapZone: 0
snapOnlyWhenOverlapping: false
rollOverDesktops: false
focusStealingPreventionLevel: 1
operationTitlebarDblClick: 5000
operationMaxButtonLeftClick: 5000
operationMaxButtonMiddleClick: 5015
operationMaxButtonRightClick: 5014
commandActiveTitlebar1: 0
commandActiveTitlebar2: 28
commandActiveTitlebar3: 2
commandInactiveTitlebar1: 4
commandInactiveTitlebar2: 28
commandInactiveTitlebar3: 2
commandWindow1: 7
commandWindow2: 8
commandWindow3: 8
commandWindowWheel: 28
commandAll1: 10
commandAll2: 3
commandAll3: 14
keyCmdAllModKey: 16777250
condensedTitle: false
electricBorderMaximize: true
electricBorderTiling: true
electricBorderCornerRatio: 0.25
borderlessMaximizedWindows: false
killPingTimeout: 5000
hideUtilityWindowsForInactive: true
compositingMode: 1
useCompositing: true
hiddenPreviews: 1
glSmoothScale: 2
glStrictBinding: false
glStrictBindingFollowsDriver: true
glPreferBufferSwap: 99
glPlatformInterface: 1
windowsBlockCompositing: true
latencyPolicy: 
renderTimeEstimator: 
allowTearing: true

Screen Edges
============
desktopSwitching: false
desktopSwitchingMovingClients: true
cursorPushBackDistance: 1x1
timeThreshold: 150
reActivateThreshold: 350
actionTopLeft: 0
actionTop: 0
actionTopRight: 0
actionRight: 0
actionBottomRight: 0
actionBottom: 0
actionBottomLeft: 0
actionLeft: 0

Screens
=======
Active screen follows mouse:  yes
Number of Screens: 2

Screen 0:
---------
Name: DP-2
Enabled: 1
Geometry: 1920,0,2560x1440
Scale: 1
Refresh Rate: 143911
Adaptive Sync: incapable
Screen 1:
---------
Name: HDMI-0
Enabled: 1
Geometry: 0,93,1920x1080
Scale: 1
Refresh Rate: 60000
Adaptive Sync: incapable

Compositing
===========
Compositing is not active

Last edited by V1del (2023-12-21 14:38:08)

Offline

#4 2023-12-21 15:12:36

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 24,913

Re: KDE on xorg with Nvidia GPU and two different refresh rates

Please use [ code ] [ /code ] tags without the spaces for pasting outputs.

That's somewhat expected, the output would be more interesting with the compositor enabled.

Generally speaking, xorg as a display server does only support one refreshrate, you can only choose which one to sync on I'd assume that KWin should honor the "primary" directive to decide to sync on the higher refreshmonitor (leading to tearing on the 60Hz monitor) FWIW if you're fine with disabling the compositor on an as needed basis then you could be running that.

If you want all of this to work properly you could also test a wayland session, from what I'm hearing they are quite usable on nvidia these days, might want to note the relevant nvidia precondiiton mentioned under: https://wiki.archlinux.org/title/NVIDIA … de_setting

Offline

#5 2023-12-21 19:05:28

queenbiscuit311
Member
Registered: 2023-05-17
Posts: 64

Re: KDE on xorg with Nvidia GPU and two different refresh rates

Coincidentally I have also been researching this problem and with some searching I've managed to find a hacky solution on X11 with KDE compositor. It involves the full composite pipeline but with more environment variables:

Add the following lines to /etc/environment:

CLUTTER_DEFAULT_FPS=144
__GL_SYNC_DISPLAY_DEVICE=DP-0 [highest refresh rate display]
__GL_SYNC_TO_VBLANK=0
KWIN_X11_REFRESH_RATE=144000 [highest refresh rate, multiplied by 1000]
KWIN_X11_NO_SYNC_TO_VBLANK=1
KWIN_X11_FORCE_SOFTWARE_VSYNC=1

Then if you haven't already run nvidia-xconfig to properly unlock nvidia-settings, and restart your X session by rebooting or logging out and back in. If you're using SDDM it should pick up your environment changes as soon as you log out. Then open nvidia-settings and do the following:

Enter OpenGL Settings and disable sync to vblank and allow flipping, then go to X Server Display Configuration and set all of your displays to force full composition pipeline. What this appears to do is just disable vsync for the compositor entirely and force it to activate in the drivers.

This does appear to cause some issues. Issue 1 is vsync just doesn't work anymore for a few 3d applications like glxgears, but it seems to work in all of the applications i've tried where vsync is actually important, like all my gui apps or my games. Frame pacing is also not 100% perfect. It almost is, but every few seconds you can notice a dropped frame or so if you're looking at steady motion. Probably fixable by tweaking some of these settings, but also imperceptible most of the time.

Wayland is definitely the superior solution here if you can get it working on your system, but this appears to be better than nothing if you would like to have a compositor and must use X11. At least it is in my hardware. I have no idea if this works on all hardware or not.

Last edited by queenbiscuit311 (2023-12-21 19:08:14)

Offline

#6 2023-12-22 02:17:20

Crylia
Member
Registered: 2021-11-27
Posts: 8

Re: KDE on xorg with Nvidia GPU and two different refresh rates

It's quite annoying to turn off the compositor every time, as using the desktop with that much stuttering really sucks. I used wayland for about a month but honestly it's unusable, kde crashes at least 5 times a day or the bar freezes, so I have to restart it, and if that wasn't enough most applications I need to use barely even work and flicker/go black all the time (freecad, cura). Oh, and games are impossible to run, I already made a post, but I got no answers, well the answer might as well be nvidia...

Anyways here is the correct output now

KWin-Unterstützungsinformationen:
Benutzen Sie die folgenden Informationen, wenn Sie nach Unterstützung fragen, z. B. auf https://forum.kde.org.
Sie enthalten Informationen über die momentan laufende Instanz, welche Optionen verwendet werden,
welcher OpenGL-Treiber verwendet wird und welche Effekte laufen.
Bitte geben Sie die unten stehenden Informationen bei einem Pastebin-Dienst wie https://paste.kde.org ein, anstatt sie direkt in die Hilfediskussionen zu schreiben.

==========================

Version
=======
KWin version: 5.27.10
Qt Version: 5.15.11
Qt compile version: 5.15.11
XCB compile version: 1.16

Operation Mode: X11 only

Build Options
=============
KWIN_BUILD_DECORATIONS: yes
KWIN_BUILD_TABBOX: yes
KWIN_BUILD_ACTIVITIES: yes
HAVE_X11_XCB: yes
HAVE_EPOXY_GLX: yes

X11
===
Vendor: The X.Org Foundation
Vendor Release: 12101010
Protocol Version/Revision: 11/0
SHAPE: yes; Version: 0x11
RANDR: yes; Version: 0x14
DAMAGE: yes; Version: 0x11
Composite: yes; Version: 0x4
RENDER: yes; Version: 0xb
XFIXES: yes; Version: 0x50
SYNC: yes; Version: 0x31
GLX: yes; Version: 0x0

Decoration
==========
Plugin: org.kde.klassy
Theme: 
Plugin recommends border size: None
onAllDesktopsAvailable: false
alphaChannelSupported: true
closeOnDoubleClickOnMenu: false
decorationButtonsLeft: 0, 2
decorationButtonsRight: 6, 3, 4, 5
borderSize: 3
gridUnit: 10
font: Noto Sans,10,-1,0,50,0,0,0,0,0
smallSpacing: 2
largeSpacing: 10

Output backend
==============
Name: KWin::X11StandaloneBackend

Cursor
======
themeName: breeze_cursors
themeSize: 24

Options
=======
focusPolicy: 0
xwaylandCrashPolicy: 
xwaylandMaxCrashCount: 3
nextFocusPrefersMouse: false
clickRaise: true
autoRaise: false
autoRaiseInterval: 0
delayFocusInterval: 0
shadeHover: false
shadeHoverInterval: 250
separateScreenFocus: false
activeMouseScreen: true
placement: 
activationDesktopPolicy: 0
focusPolicyIsReasonable: true
borderSnapZone: 10
windowSnapZone: 10
centerSnapZone: 0
snapOnlyWhenOverlapping: false
rollOverDesktops: false
focusStealingPreventionLevel: 1
operationTitlebarDblClick: 5000
operationMaxButtonLeftClick: 5000
operationMaxButtonMiddleClick: 5015
operationMaxButtonRightClick: 5014
commandActiveTitlebar1: 0
commandActiveTitlebar2: 28
commandActiveTitlebar3: 2
commandInactiveTitlebar1: 4
commandInactiveTitlebar2: 28
commandInactiveTitlebar3: 2
commandWindow1: 7
commandWindow2: 8
commandWindow3: 8
commandWindowWheel: 28
commandAll1: 10
commandAll2: 3
commandAll3: 14
keyCmdAllModKey: 16777250
condensedTitle: false
electricBorderMaximize: true
electricBorderTiling: true
electricBorderCornerRatio: 0.25
borderlessMaximizedWindows: false
killPingTimeout: 5000
hideUtilityWindowsForInactive: true
compositingMode: 1
useCompositing: true
hiddenPreviews: 1
glSmoothScale: 2
glStrictBinding: false
glStrictBindingFollowsDriver: true
glPreferBufferSwap: 99
glPlatformInterface: 1
windowsBlockCompositing: true
latencyPolicy: 
renderTimeEstimator: 
allowTearing: true

Screen Edges
============
desktopSwitching: false
desktopSwitchingMovingClients: true
cursorPushBackDistance: 1x1
timeThreshold: 150
reActivateThreshold: 350
actionTopLeft: 0
actionTop: 0
actionTopRight: 0
actionRight: 0
actionBottomRight: 0
actionBottom: 0
actionBottomLeft: 0
actionLeft: 0

Screens
=======
Active screen follows mouse:  yes
Number of Screens: 2

Screen 0:
---------
Name: DP-2
Enabled: 1
Geometry: 1920,0,2560x1440
Scale: 1
Refresh Rate: 143911
Adaptive Sync: incapable
Screen 1:
---------
Name: HDMI-0
Enabled: 1
Geometry: 0,93,1920x1080
Scale: 1
Refresh Rate: 60000
Adaptive Sync: incapable

Compositing
===========
Compositing is active
Compositing Type: OpenGL
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce RTX 3070/PCIe/SSE2
OpenGL version string: 3.1.0 NVIDIA 545.29.06
OpenGL platform interface: GLX
OpenGL shading language version string: 1.40 NVIDIA via Cg compiler
Driver: NVIDIA
Driver version: 545.29.6
GPU class: Unknown
OpenGL version: 3.1
GLSL version: 1.40
X server version: 1.21.1
Linux kernel version: 6.6.7
Direct rendering: Requires strict binding: no
GLSL shaders:  yes
Texture NPOT support:  yes
Virtual Machine:  no
OpenGL 2 Shaders are used

Loaded Effects:
---------------
colorpicker
outputlocator
screenshot
zoom
blur
contrast
kwin4_effect_sessionquit
kwin4_effect_logout
kwin4_effect_login
slidingpopups
kwin4_effect_windowaperture
slide
kwin4_effect_squash
kwin4_effect_morphingpopups
kwin4_effect_maximize
kwin4_effect_fullscreen
kwin4_effect_frozenapp
kwin4_effect_fadingpopups
kwin4_effect_fade
kwin4_effect_dimscreen
kwin4_effect_dialogparent
desktopgrid
highlightwindow
overview
tileseditor
windowview
blendchanges
startupfeedback
kscreen

Currently Active Effects:
-------------------------
blur
contrast

Effect Settings:
----------------
colorpicker:

outputlocator:

screenshot:

zoom:
zoomFactor: 1.2
mousePointer: 0
mouseTracking: 0
focusTrackingEnabled: false
textCaretTrackingEnabled: false
focusDelay: 350
moveFactor: 20
targetZoom: 1

blur:

contrast:

kwin4_effect_sessionquit:
pluginId: kwin4_effect_sessionquit
isActiveFullScreenEffect: false

kwin4_effect_logout:
pluginId: kwin4_effect_logout
isActiveFullScreenEffect: false

kwin4_effect_login:
pluginId: kwin4_effect_login
isActiveFullScreenEffect: false

slidingpopups:
slideInDuration: 150
slideOutDuration: 250

kwin4_effect_windowaperture:
pluginId: kwin4_effect_windowaperture
isActiveFullScreenEffect: false

slide:
horizontalGap: 45
verticalGap: 20
slideBackground: true

kwin4_effect_squash:
pluginId: kwin4_effect_squash
isActiveFullScreenEffect: false

kwin4_effect_morphingpopups:
pluginId: kwin4_effect_morphingpopups
isActiveFullScreenEffect: false

kwin4_effect_maximize:
pluginId: kwin4_effect_maximize
isActiveFullScreenEffect: false

kwin4_effect_fullscreen:
pluginId: kwin4_effect_fullscreen
isActiveFullScreenEffect: false

kwin4_effect_frozenapp:
pluginId: kwin4_effect_frozenapp
isActiveFullScreenEffect: false

kwin4_effect_fadingpopups:
pluginId: kwin4_effect_fadingpopups
isActiveFullScreenEffect: false

kwin4_effect_fade:
pluginId: kwin4_effect_fade
isActiveFullScreenEffect: false

kwin4_effect_dimscreen:
pluginId: kwin4_effect_dimscreen
isActiveFullScreenEffect: false

kwin4_effect_dialogparent:
pluginId: kwin4_effect_dialogparent
isActiveFullScreenEffect: false

desktopgrid:
activeView: 
gridRows: 1
gridColumns: 1
animationDuration: 300
layout: 1
partialActivationFactor: 0
gestureInProgress: false
showAddRemove: true
desktopNameAlignment: 0
desktopLayoutMode: 0
customLayoutRows: 2

highlightwindow:

overview:
activeView: 
animationDuration: 300
layout: 1
ignoreMinimized: false
blurBackground: true
partialActivationFactor: 0
gestureInProgress: false
searchText: 

tileseditor:
activeView: 
animationDuration: 200

windowview:
activeView: 
animationDuration: 300
layout: 1
ignoreMinimized: false
mode: 1263709552
partialActivationFactor: 0
gestureInProgress: false
searchText: 

blendchanges:

startupfeedback:
type: 1

kscreen:


Loaded Plugins:
---------------
kwin5_plugin_krunner
kwin5_plugin_nightcolor

Available Plugins:
------------------
kwin5_plugin_buttonrebinds
kwin5_plugin_colord
kwin5_plugin_krunner
kwin5_plugin_nightcolor

Offline

#7 2023-12-22 02:21:37

Crylia
Member
Registered: 2021-11-27
Posts: 8

Re: KDE on xorg with Nvidia GPU and two different refresh rates

queenbiscuit311 wrote:

Coincidentally I have also been researching this problem and with some searching I've managed to find a hacky solution on X11 with KDE compositor. It involves the full composite pipeline but with more environment variables:

Add the following lines to /etc/environment:

CLUTTER_DEFAULT_FPS=144
__GL_SYNC_DISPLAY_DEVICE=DP-0 [highest refresh rate display]
__GL_SYNC_TO_VBLANK=0
KWIN_X11_REFRESH_RATE=144000 [highest refresh rate, multiplied by 1000]
KWIN_X11_NO_SYNC_TO_VBLANK=1
KWIN_X11_FORCE_SOFTWARE_VSYNC=1

Then if you haven't already run nvidia-xconfig to properly unlock nvidia-settings, and restart your X session by rebooting or logging out and back in. If you're using SDDM it should pick up your environment changes as soon as you log out. Then open nvidia-settings and do the following:

Enter OpenGL Settings and disable sync to vblank and allow flipping, then go to X Server Display Configuration and set all of your displays to force full composition pipeline. What this appears to do is just disable vsync for the compositor entirely and force it to activate in the drivers.

This does appear to cause some issues. Issue 1 is vsync just doesn't work anymore for a few 3d applications like glxgears, but it seems to work in all of the applications i've tried where vsync is actually important, like all my gui apps or my games. Frame pacing is also not 100% perfect. It almost is, but every few seconds you can notice a dropped frame or so if you're looking at steady motion. Probably fixable by tweaking some of these settings, but also imperceptible most of the time.

Wayland is definitely the superior solution here if you can get it working on your system, but this appears to be better than nothing if you would like to have a compositor and must use X11. At least it is in my hardware. I have no idea if this works on all hardware or not.


That seems to be working, but I get very heavy frame drops in games like Osu!, which makes them impossible to play. I don't know if it's because of those variables etc or because of something else, but I can't find anything running that would cause it

Offline

#8 2023-12-22 02:28:00

Crylia
Member
Registered: 2021-11-27
Posts: 8

Re: KDE on xorg with Nvidia GPU and two different refresh rates

Ok after disabling full composite pipelining again for both monitors it seems to work smoothly, that you both very much

Offline

Board footer

Powered by FluxBB