Hi, I just noticed that Gnome is adding an option to directly launch an application on a discrete GPU when one is available. https://git.gnome.org/browse/gnome-shell/commit/?id=009d021e4f93bfce69d1f4497612d804c88972b6&utm_source=anzwix Would this be easily achievable? Currently I'm using special application shortcuts that set the DRI_PRIME=1 variable. To avoid getting a black screen I have to disable compositing with Alt-Shift-F12 or switch kwin to Xrender mode. https://wiki.archlinux.org/index.php/PRIME#When_an_application_is_rendered_with_the_discrete_card.2C_it_only_renders_a_black_screen My suggestion would be: 1. Right-click application (menu entry or other shortcut i.e. desktop launcher) 2. Select "Run on discrete GPU" 3. Switch kwin to Xrender mode, set DRI_PRIME=1 and launch Thanks in advance for your feedback! Cheers!
Is choosing which card an app should run on something you do on a per-app basis or a per-execution basis? i.e would you *always* want to start Doom3 on the discrete card, or just sometimes?
I'd say I generally choose on a per app basis. I mostly use this for kdenlive (with movit) and Steam games. Sometimes I have to switch to a per-execution basis when debugging though. I once had to investigate a crash that originated in Qt's handling of DRI_PRIME.
A little correction to my initial post. Kwin has to be in Xrender mode because PRIME needs a compositor. If you deactivate it or switch to OpenGL you get a black window. My suggested procedure for launching would be: 1. Right-click application (menu entry or other shortcut i.e. desktop launcher) 2. Select "Run on discrete GPU" 4. Check if kwin's enabled or in which compositing mode it is running (i.e. to OpenGL 3.1) 3. Switch kwin to Xrender mode, set DRI_PRIME=1 and launch 5. End application 6. Restore kwin to previous compositor mode
thanks
I think this should be in KRun/KIO so you can configure an application to run on a discrete GPU just like you can configure it to run in terminal, then all places would honor this setting out of the box. Also, maybe KRun needs another flag where an application can explicitly request running on discrete GPU, when we have a "Run on discrete" option in places.
Do you think this should go into advanced options, same as "run in terminal" option? Or should it be rather more visible to the user?
Already implemented and upstreamed. Will be available with Plasma 5.9 and KDE frameworks 5.30.
Commits for reference: [1] - https://cgit.kde.org/powerdevil.git/commit/?id=e41eedbec274048b849c6705a761f85af4a31be5 [2] - https://cgit.kde.org/kservice.git/commit/?id=19ecb443b39833ac0c6ecc64eb3c03fdab94ec15 [3] - https://cgit.kde.org/kinit.git/commit/?id=610bcdfd266518638df93147f26eb9c19a47fb33 [4] - https://cgit.kde.org/kio.git/commit/?id=303aa887d870972fa2c4dfffa104f92070949083 [5] - https://cgit.kde.org/kio.git/commit/?id=1e6412cebf140cdc7a165fd49ce64c859e572f71