Switching graphic cards on Manjaro KDE 21.0

I have read a manjaro wiki of how to use DRI_PRIME=0, or 1 for using a specific card on the go, but I want a drop down menu of selecting intel, nvidia and hybrid mode on the go withou having to reboot?
I am a newbie here, but my laptop’s battery suffers as it is showing intel graphics in systems menu but nvidia card is also running.

Also, if I try to install video-nvidia using hardware configuration gui, it shows a error message: Starting
Error: config ‘video-nvidia’ conflicts with config(s): video-hybrid-intel-nvidia-prime

I think GitHub - Askannz/optimus-manager: A Linux program to handle GPU switching on Optimus laptops. with GitHub - Shatur95/optimus-manager-qt: An interface for Optimus Manager that allows to switch GPUs on Optimus laptops. is the solution you’re looking for :slight_smile:

Also the reason you get the error is because you can’t install 2 nvidia drivers at once.
You would have to uninstall video-hybrid-intel-nvidia-prime first. but since you wanna be able to select the one you use, keep the current driver.

1 Like

I have seen that pop os gives a functionality to start an application when clicked on the right button of the mouse, the option to launch with dedicated graphics card,

So, I looked on the manjaro wiki and found that I can launch an app from terminal that uses my dedicated graphics card using prime-run , but my knowledge to start app from terminal is low, as I am learning now.

So, can you please suggest how to enable the feature in the right click button menu. My last resort will be to use the optimus manager and log out then in to use my nvidia card, but if it would be great if this feature is implemented
]

Oh i know what you mean. I remember that from when i used Pop_os.
I found this extention for the Gnome desktop environment. GNOME Run With PRIME - GNOME Shell Extensions
It does exactly what you want :slight_smile: I hope that works!

1 Like

But I am using Manjaro KDE not gnome, how can I work it out? Please let me know

Hmmm… i can’t find anything to automate it like with Gnome. But one thing you COULD do is for example you have a game that you have installed. Go to the KDE Plasma launcher, or menu, or whatever its called on KDE, and go to KDE Menu editor.

From there you can select an application like a game you have installed, then where it says “Command”, write prime-run infront of it. So for example if the command is currently kate, change it to prime-run kate.
Or if you have a game like world of warcraft for example and the command is wine Wow.exe, change it to prime-run wine Wow.exe.
Then save what you changed, and then everytime you launch the application/game it will launch using the nvidia graphics card when starting it through the KDE app launcher.

image

Sorry i can’t find an easier option for KDE :disappointed:

Thank you, I got that from the manjaro wiki . I have used in steam games by writing “prime-run %command%” in the launch script. I have asked on support, for this. I tried your method . I have to go root and use edit the .desktop file’s Exec line like say I want my app i.e steam to use my dgpu, so I will cd to /usr/share/applications then edit steam.desktop file’s Exec line and append prime-run in the beginning.

No, copy the desktop file to ~/.local/share/applications/steam.desktop and modify it there.

For the right click menu it should be easy to make, I’ll edit this message if I come up with something.

//EDIT:

maybe this can work, create a file ~/.local/share/kservices5/ServiceMenus/runwithprime.desktop

[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=inode/directory;application/octet-stream;
Icon=nvidia
Actions=PRIMERUN

[Desktop Action PRIMERUN]
Icon=nvidia
Exec=prime-run "%U"
Name=Run with Prime

Try at your own risk but if you start Dolphin after creating this, you should have a new right click item. If it doesn’t work properly then maybe you can start from there and fix it for your needs.

I tried your way omano. It works. Thank you, but I tried the same for firefox, it is listed in ~/.local/share/applications but not on desktop, when I try to make it appear on desktop , its properties shows that it points to ~/usr/share/applications . So, how to make ~/.local/share/applications files appear on desktop or anywhere else?

Now I see both firefox.desktop and steam.desktop in ~/.local/share/applications but on adding firefox to desktop using add to desktop using app launcher menu, its properties show that it points to /usr/share/applications/ , so how to launch those apps in ~/.local/share/applications

It should override them, try reboot.

I tried rebooting, but still firefox on the desktop points to ~/usr/share/applications , so even if I change the firefox.desktop, in the ~/.local/share/applications , I am unable to launch it

Then recreate the shortcut on the desktop from the Application Menu?

Wow omano, It worked. First I add to desktop the firefox. It pointed to ~/usr/share/applications . Again, I add it, as you said, and it asked for overwrite, and I allowed it, and now it gets pointed to ~/.local/share/applications and again overwritten is possible but with a different name but still it points to ~/.local/share/applications , I don’t know why, but thank you for your help. I have observed if I delete firefox.desktop from ~/.local/share/applications, then again add to desktop points to ~/usr/share/applications , and that was what I did, because I did not want the firefox to use dgpu

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.