Hello everyone, I have a rather specific question ...
# compose-desktop
f
Hello everyone, I have a rather specific question related to a problem regarding Compose for desktop. I have compiled and ran a sample Compose template from IntelliJ and, to my surprise, I have ran into issues regarding the performance / UI department. First of all, unless I specify an environmental variable 
SKIKO_RENDER_API
, IntelliJ, while building Compose projects, prompts me with an error regarding my hardware. To be exact, I am greeted with the following output:
Copy code
Failed to create DirectX12 device.
Graphics card NVIDIA GeForce GTX 960M is not supported.
Graphics card Intel(R) HD Graphics 530 is not supported.
Graphics card Intel(R) HD Graphics 530 is not supported.
Graphics card NVIDIA GeForce GTX 960M is not supported.
Graphics card Intel(R) HD Graphics 530 is not supported.
Graphics card Intel(R) HD Graphics 530 is not supported.
Which I do not understand. I have done some reserach regarding hardware acceleration and that's where I found the information regarding
SKIKO_RENDER_API
. What's more, when the project built and ran, the sample windows is being shown, but all texts are blurry. I am attaching a screenshot below. If I define the environmental variable in question, the warnings go away, but unless its value is set to
SOFTWARE
, the blur persists. I have deployed an executable using
gradle createDistributable
and asked a couple of my friends to run some tests. In every single instance the resulting application was flawless, i.e., there was no blurry text. None of my friends is using my exact setup, though. Different CPUs and different GPUs. Because of that I suspect that the culprit may as well be my hardware. Is GTX 960M officially not supported by Compose / Skiko? Where can I read about the supported hardware? I am also curious about the DirectX12 error. I have it installed (the 12 edition). Did anyone encounter similar error? It may be good to add that when working with Android Studio, the whole emulator is blurry too. Regardless of the aforementioned environmental variable. I could just stick with
SKIKO_RENDER_API = "SOFTWARE"
but in the official JetBrains blog I read that:
For testing and benchmarking purposes, you can also explicitly force your application to use the specific renderer of your choice by setting the corresponding environment variable: 
SKIKO_RENDER_API="SOFTWARE"
 or 
"OPENGL"
. However, please keep in mind that this fallback renderer is significantly slower than its hardware-accelerated counterpart (up to 4 times slower).
And, well, I don't really want my app to suffer from performance penalties, even for testing. Apologies if I misused this channel in terms of things that should and should not be posted here. Any pointers will be highly appreciated.
👀 2
s
I noticed a performance improvement when they added the metal renderer to macos. I’m not specifying anything regarding
SKIKO_RENDER_API
, so I assume with doing nothing, I’m already rendering via hardware. Let me check that.
I just loaded up my desktop application and watched its GPU usage in macos. It stayed at 0. It appears that I’m software rendering, and I’m interested in seeing if I can enable hardware rendering.
o
by default on macOS we do use Metal, maybe you have two GPUs and look on not one app is using
the error you see it OKish, it just means we do not use DirectX and fallback to OpenGL or software renderer. @Roman Sedaikin [JB] do you have an idea what could be wrong here?
r
@Fureeish Could you add screenshots with
SOFTWARE
and
OPENGL
with blurry text? If you have blurry text with
OPENGL
rendering try to update graphics card drivers (for both of them) - it could help.
SOFTWARE
rendering has been improved since then and now has decent performance (unless you set
SKIKO_RENDER_API
to
SOFTWARE_COMPAT
).
f
@Roman Sedaikin [JB] sure, here they are. The blurry one appears if I don't use
SKIKO_RENDER_API
or set it to
OPENGL
. I have updated the Nvidia drivers, but I will try to update the integrated card's ones too and made sure that my Intel Graphics drivers are up to date.
@Roman Sedaikin [JB] I'd hate to disrupt you, but is there any chance that you may have some new thoughts / suggestions about the above issue?
r
@Fureeish We had a similar issue - blurry text in OpenGL on the GTX 960 - this was due to FXAA being enabled in the NVIDIA control panel. Could you check it?
f
@Roman Sedaikin [JB] disabling FXAA in NVIDIA control panel fixes the issue. Now, even without specifying
SKIKO_RENDER_API
environmental variable, the text is rendered correctly. Thank you! Are there are negative implications of disabling FXAA in regard to Compose, though?
r
@Fureeish It should be disabled by default. All hardware-accelerated applications have their own anti-aliasing method, and an extra pass of full-screen anti-aliasing by video card drivers can result in blurry images. For example, games have several anti-aliasing implementations (FXAA, SMAA, TXAA, etc.) and get a double pass anti-aliasing image frame if FXAA is enabled in the NVIDIA control panel (NVIDIA FXAA + in the game, for example, SMAA). Of course, the question remains: why was FXAA enabled in the NVIDIA Control Panel without the user's permission? There may be some bug in the drivers that set FXAA enabled during installation.
f
I am positive that I enabled it manually some years ago when I was doing some testing and just forgot about it 🙂
🕵️‍♂️ 1