Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

G-SYNC causes stuttering and flickering #1648

Closed
lars-reimann opened this issue Dec 28, 2021 · 6 comments
Closed

G-SYNC causes stuttering and flickering #1648

lars-reimann opened this issue Dec 28, 2021 · 6 comments
Assignees
Labels
desktop enhancement New feature or request

Comments

@lars-reimann
Copy link

Problem

When G-SYNC is active and an app that uses Compose MPP is focused, the refresh rate of the display is lowered considerably, so moving the mouse causes stuttering and flickering. While G-SYNC can simply be turned off during development, this also affects end users of an application. For example, this problem also occurs with the new Jetbrains Toolbox.

Video

Compose.mp4

Sorry for the terrible phone recording, but funnily the problem disappears when observed by OBS.

Versions

OS: Windows 11 Build 22000.376
Compose: id("org.jetbrains.compose") version "1.0.1" (building a desktop app)
NVIDIA driver: 497.29

@akurasov akurasov added desktop enhancement New feature or request AK labels Dec 28, 2021
@akurasov akurasov added this to the 1.1? milestone Jan 11, 2022
Rsedaikin added a commit to JetBrains/skiko that referenced this issue Feb 4, 2022
…475)

To disable VRR support, we create a transparent JPanel with size (1, 1) and add it on top of the SkiaLayer. This causes mixed rendering technologies (java2d and OpenGL/DirectX) to work simultaneously in the same window and VRR cannot be enabled.
see:
JetBrains/compose-multiplatform#1648
https://youtrack.jetbrains.com/issue/TBX-6507#focus=Comments-27-5482439.0-0
manu-unter pushed a commit to manu-unter/skiko that referenced this issue May 16, 2022
…etBrains#475)

To disable VRR support, we create a transparent JPanel with size (1, 1) and add it on top of the SkiaLayer. This causes mixed rendering technologies (java2d and OpenGL/DirectX) to work simultaneously in the same window and VRR cannot be enabled.
see:
JetBrains/compose-multiplatform#1648
https://youtrack.jetbrains.com/issue/TBX-6507#focus=Comments-27-5482439.0-0
@igordmn igordmn removed this from the 1.1? milestone May 26, 2022
@badmannersteam
Copy link
Contributor

badmannersteam commented Aug 28, 2022

Hi, any news about this?
Compose development and usage of compose apps make my eyes hurt due to flickering :(

The worst thing is that flickering and stuttering occur even when G-SYNC is enabled only for fullscreen apps, not for windowed.

Maybe there is some way to fix it at least for development time, e.g. use another render api/etc?
I know that i can disable g-sync completely for specific app in nvidia panel, but it causes the whole screen go black for seconds on every focus gain/loss, so this in not a solution either.

UPD:
As a temporary workaround for saving eyes during development SOFTWARE_COMPAT, SOFTWARE or OPENGL renderer can be used instead of DIRECT3D, that causes the flickering.
Renderer can be set via environment variable SKIKO_RENDER_API or system propety skiko.renderApi.
So System.setProperty("skiko.renderApi", "OPENGL") in main() should be enough.

@drakeet
Copy link
Contributor

drakeet commented Aug 28, 2022

This is indeed a common and serious problem with the JVM GUI and hopefully it will be resolved.

@igordmn igordmn removed the AK label Oct 11, 2022
@terryschmidt
Copy link

This is horrendous what is going on with this I bought a gaming computer with the fastest CPU and GPU available on the market and this grinds my computer to a halt randomly and it took me months on end to stumble on to this

@terryschmidt
Copy link

Hi, any news about this? Compose development and usage of compose apps make my eyes hurt due to flickering :(

The worst thing is that flickering and stuttering occur even when G-SYNC is enabled only for fullscreen apps, not for windowed.

Maybe there is some way to fix it at least for development time, e.g. use another render api/etc? I know that i can disable g-sync completely for specific app in nvidia panel, but it causes the whole screen go black for seconds on every focus gain/loss, so this in not a solution either.

UPD: As a temporary workaround for saving eyes during development SOFTWARE_COMPAT, SOFTWARE or OPENGL renderer can be used instead of DIRECT3D, that causes the flickering. Renderer can be set via environment variable SKIKO_RENDER_API or system propety skiko.renderApi. So System.setProperty("skiko.renderApi", "OPENGL") in main() should be enough.

This is also correct in my experience. The bug happens even if you only tell GSYNC to activate for full screen apps and Jetbrains Toolbox is not a full screen app

@malliaridis
Copy link

malliaridis commented May 16, 2024

I can confirm the issue with Compose 1.6.10-beta02 and Kotlin 1.9.22. However, the entire screen is flickering only when I hover over buttons. Disabling G-Sync also fixes the issue, but that is only a temporary solution for development.

The issue is present in the toolbox too, but not during the first window opening when it is manually started. Only if I minimize it to the tray and reopen it. Hope this information is useful for fixing it.

Additionally, marking the window as undecorated and transparent seems to fix the issue too.

@okushnikov
Copy link
Collaborator

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

@JetBrains JetBrains locked and limited conversation to collaborators Dec 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
desktop enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

9 participants