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

Automatic fallback to softwarecontext renderer #2878

Open
selsta opened this issue May 1, 2020 · 10 comments
Open

Automatic fallback to softwarecontext renderer #2878

selsta opened this issue May 1, 2020 · 10 comments

Comments

@selsta
Copy link
Collaborator

selsta commented May 1, 2020

This wasn't fixed. Please re-open.

I also have 100% CPU using monero GUI v0.15.0.4 in a VirtualBox VM (Whonix-Workstation). It's just the first screen (language selection screen). No monero installed ever in that VM before.

QMLSCENE_DEVICE=softwarecontext ./monero-wallet-gui helps as a workaround but it's not a solution. Users shouldn't be required to figure that out the hard way. Should be the default or some other fix.

Also my CPU use is now down to 30% which still seems to much for just an idle language selection screen.

Originally posted by @adrelanos in #2238 (comment)

@selsta
Copy link
Collaborator Author

selsta commented May 1, 2020

The best solution would be automatic fallback to softwarecontext in systems which have trouble with OpenGL. If this is not possible then I guess this will be a wontfix.

Should be the default

Setting the softwarecontext renderer as default will result in a worse experience for the majority of users. The renderer has worse quality, supports less features AFAIK also uses more CPU. See https://doc.qt.io/QtQuick2DRenderer/qtquick2drenderer-performance.html

@adrelanos
Copy link

Btw as for Whonix integration (which runs mostly in VMs), I guess would be best if some script [1] checked if hardware rending is enabled. And if not, set QMLSCENE_DEVICE=softwarecontext as global environment variable by default.

How to test from command line if hardware acceleration is available?

selsta:

Should be the default

Setting the softwarecontext renderer as default will result in a worse experience for the majority of users. The renderer has worse quality, supports less features AFAIK also uses more CPU. See https://doc.qt.io/QtQuick2DRenderer/qtquick2drenderer-performance.html

I agree. softwarecontext renderer should if anything only be default when needed. Not for everyone that doesn't need it.


[1] Has nothing to do with monero. The name of package is vm-config-dist. I don't suggest to implement such a script in monero that changes environment variables globally. Just wondering for a good solution for Whonix / VMs.

@adrelanos
Copy link

Test command from inside VM to detect if VirtualBox 3D acceleration is enabled or disabled?

@adrelanos
Copy link

I guess this needs a separate ticket.
30% CPU in Debian buster based VirtualBox VM
#2880

adrelanos pushed a commit to Kicksecure/vm-config-dist that referenced this issue May 2, 2020
Automatic fallback to softwarecontext renderer
monero-project/monero-gui#2878

Not great to set this unconditionally in VirtualBox but there is no known
tool which can find out from inside the VM if VirtualBox 3D acceleration
is enabled from inside the VM, see:
Test command from inside VM to detect if VirtualBox 3D acceleration is enabled or disabled?
https://forums.virtualbox.org/viewtopic.php?f=3&t=97983

export QMLSCENE_DEVICE=softwarecontext
@selsta
Copy link
Collaborator Author

selsta commented May 4, 2020

Forget my comment, glxinfo is what you wrote above already.

Anyway, I think this is VirtualBox related as I never had any issues with VMWare Fusion.

Maybe you can add the info to only use softwarecontext if the GUI has high CPU usage: https://github.com/Whonix/monero-gui#vm-users

@adrelanos
Copy link

Sure. Writing now:

Due to this VM specific Monero GUI upstream bug setting envrionment variable QMLSCENE_DEVICE=softwarecontext is required inside some virtual machines (VMs). Known affected are to VirtualBox and KVM based VMs on Debian buster. Reported unaffected is VMWare Fusion, in that case setting QMLSCENE_DEVICE=softwarecontext can be omitted.

Pull requests against VM (or anything) are also welcome.

adrelanos pushed a commit to adrelanos/vm-config-dist that referenced this issue Dec 9, 2020
"Automatic fallback to softwarecontext renderer"

monero-project/monero-gui#2878

`export QMLSCENE_DEVICE=softwarecontext`
@mmortal03
Copy link

mmortal03 commented Nov 16, 2022

Is this only supposed to be an issue with virtual machines? I'm currently seeing constant high CPU usage on a Windows laptop with AMD graphics switching on monero-wallet-gui.exe v0.18.1.2, even after it has synced. 72%+ constant CPU usage at the password entry screen, and 12%+ constant CPU usage after entering the wallet password. I am using a Trezor and a remote node. I tried adding monero-wallet-gui.exe to the AMD switchable graphics application settings, but doing that doesn't seem to affect the CPU usage, whether I'm configuring it to use the graphics card or the CPU graphics, I get the same high CPU usage. Lowering the affinity of CPUs or the process priority also doesn't seem to make a difference.

@selsta
Copy link
Collaborator Author

selsta commented Nov 16, 2022

@mmortal03 does starting "low-graphics-mode.bat" make a difference?

@mmortal03
Copy link

@mmortal03 does starting "low-graphics-mode.bat" make a difference?

Oh, wow, yes, that solves it. I wonder what the cause is, though?

@selsta
Copy link
Collaborator Author

selsta commented Nov 16, 2022

It seems so GPU driver related issue. low-graphics-mode.bat uses CPU software rendering, in regular mode OpenGL is used.

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

4 participants
@adrelanos @selsta @mmortal03 and others