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

Window corruption / magenta regions with Java OpenGL rendering enabled #281

Open
mkurz opened this issue Jan 31, 2024 · 2 comments
Open

Comments

@mkurz
Copy link

mkurz commented Jan 31, 2024

This has been bothering me for quite some time, however never got around to file a report. Eventually here we go.

I am running Asahi Linux (aarch64) and quite often magenta regions appear:

At the beginning, I thought this was a GPU driver bug, but it turned out it isn't. The Asahi developers (who are like the godfathers of reverse engineering and GPU driver hacking) are sure this is a problem in Java itself, which just goes unnoticed because only Asahi uses purple as the "error color" whereas other systems use transparent, so problems like that just don't get recognized easily.

So here is what the Asahi developes say to this:

My questions now:

  • Can you do something with that information? Like based on the information I give here, can you fix that?
  • Will this be fixed as soon as Native Wayland support arrives?
    • https://youtrack.jetbrains.com/issue/JBR-3206/Native-Wayland-support
    • AFAIK you will then support Vulkan, which is currently being worked on in Asahi as well
    • AFAIK (but correct me if I am wrong) until Vulkan support is ready in JBR with Wayland support you will "just" offer software rendering (?) with Wayland, however will the described problem be fixed with JBR Wayland software rendering already?
  • Shouldn't this get fixed upstream in OpenJDK itself?
  • Do you need more information?

Side note:
In Asahi, JetBrains IntelliJ IDEA needs to be started with

-Dsun.java2d.opengl=true
-Dsun.java2d.opengl.fbobject=false

set in Help -> Edit Custom VM Options... for GPU acceleration.

IDE details:

IntelliJ IDEA 2023.3.3 (Ultimate Edition)
Build #IU-233.14015.106, built on January 25, 2024
...
Runtime version: 17.0.9+7-b1087.11 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 6.5.0-asahi-15-1-edge-arch
GC: G1 Young Generation, G1 Old Generation
Memory: 8192M
Cores: 10
Registry:
  ide.browser.jcef.gpu.disable=true
  scala.erase.compiler.process.jdk.once=false
Non-Bundled Plugins:
  com.intellij.properties.bundle.editor (233.11799.172)
  org.jetbrains.plugins.hocon (2023.1.0)
  com.jetbrains.packagesearch.intellij-plugin (233.11799.196)
  com.intellij.ml.llm (233.14015.137)
  org.intellij.scala (2023.3.20)
Kotlin: 233.14015.106-IJ
Current Desktop: KDE
@mkartashev
Copy link
Collaborator

Will this be fixed as soon as Native Wayland support arrives?

If the problem is indeed in OpenGL, then the answer is yes as OpenGL will no longer be involved.

Shouldn't this get fixed upstream in OpenJDK itself?

Very likely.

Do you need more information?

Yes: what benefits do you see from

-Dsun.java2d.opengl=true
-Dsun.java2d.opengl.fbobject=false

? So far I have only been able to get performance improvement when running under VMWare with acceleration enabled. Enabling OpenGL gave nothing when running on hardware.

@mkurz
Copy link
Author

mkurz commented Feb 9, 2024

Yes: what benefits do you see from

-Dsun.java2d.opengl=true
-Dsun.java2d.opengl.fbobject=false

? So far I have only been able to get performance improvement when running under VMWare with acceleration enabled. Enabling OpenGL gave nothing when running on hardware.

I can definitely feel a difference when removing these two flags (or setting sun.java2d.opengl to false), so when software rendering is used the IDE definitely feels slower, e.g. scrolling behaves more sluggish (but the magenta "errors" of course do not appear in software rendering).
When enabling hardware acceleration (setting to true) and also having fbobject set to true, again the UI is slower, I can definitely see that when scrolling larger files that have many lines. With disabling the use of a framebuffer object the UI feels very very responsive, including scrolling and is very snappy.

Enabling OpenGL gave nothing when running on hardware.

So, you installed Asahi Linux? Which device are you using?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants