Can't switch graphic card (Intel > AMD Radeon)

I have installed Manjaro XFCE yesterday (and no, I’m not a programmer so I don’t understand code writing well, at most slightly above average) mainly because I was getting annoyed with some issues that Windows 10 updates were giving me when it comes to gaming, but now I am not only having similar problems but they are even worse because I have no idea of how to solve it.
Sometime between 2018-2019 (don’t remember well when exactly) I have acquired a Radeon RX 570 and my games’ performance improved a lot, but randomly (I believe after some Windows update) my PC set the standard/prefered graphic card to the Intel HD Graphics and even back then all I could do was manually changing the games to High Performance.
Now I have changed to Manjaro XFCE, am just learning to use it but for some reason it came with the same problem I was having for months back on Windows 10 and I tried almost everything thinkable (changed Manjaro Settings Manager unistalling Intel’s driver, tried reinstalling the drivers multiple times etc) but the problem persists and it’s being absolutely impossible for me to switch to AMD. Does someone have any idea about what can I do? If it cannot be solved all I can conclude is that it wasn’t really worth it leaving Windows if Linux Manjaro will do what I want it to do (gaming) worse than Windows 10.

What did you do here? And what state is your system in?

Are you sure you are taking the proper steps? How are you trying to use the card?

What did you do here? And what state is your system in?

I don’t know if this explains very well as I don’t really know much about Manjaro yet but I uninstalled and installed back on Manjaro Settings Manager and it was mostly my cousin (who understands much better than me) giving me the commands but I used sudo mhwd -a pci free 0300 many times and was constantly sending him video config but it didn’t switch the graphic card the way I desired in the end so he gave up and recommended me to come here.

Are you sure you are taking the proper steps? How are you trying to use the card?

Not really, but all I want is to use the card at least while gaming (I have already tested on Minecraft and Crusader Kings 3 and the performance with the Intel HD Graphics is just awful), but I don’t know if I need to install anything else or if there’s a specific command for me to use.

The link to the wiki has your answer.

Please provide the output from the first link, and of the commands shown in the second link.

(EDIT - or rather these would be better:)

glxinfo | grep 'renderer string'
DRI_PRIME=1 glxinfo | grep 'renderer string'

Have used DRI_PRIME=1 %command% on Crusader Kings 3 when launching on Steam and now it’s working fine :), though I still don’t know how to do the same to Minecraft (it’s run on Java after all) or any other game that isn’t from Steam.

Every position in your launcher/start menu is using .desktop files. They are either in ~/.local/share/applications/ (user launching files) or in usr/share/applications (default, system wide launchers).

You can either edit them directly through any text editor or through special utilities. Plasma has it built in, just look on the favorites in start menu or search for the proper app and then right-click and edit. Look for program tab and then command field (this edit program doesn’t show up for the list of most frequent used apps, so again: search for the app you need or find it in favorites).

In .desktop files you find exec line which simply has a command that launches the program.

So what you need to do is to edit that command and add DRI_PRIME=1 before it.

Unfortunately, Linux switchable graphic needs manual intervention to specify which app should use discrete graphic card, it isn’t happening automatically. The only exception is when you launch vulkan based games (so most proton games), those tend to launch on dGPU automatically, because system recognizes dGPU as the default renderer for vulkan, or at least this is how it works when you have NVIDIA card. I’m not sure if the same applies to AMD.

That is why you need to either launch the app with the proper environmental variable (DRI_PRIME=1) from the terminal or edit the exec lines of .desktop files.

So with Steam you have two options: either you DRI_PRIME=1 %command% for every game or use DRI_PRIME=1 for the whole Steam.

Thanks! But do you know how do I use AMD on Minecraft too? I have already successfully enabled it on my Steam games but Minecraft is not on Steam and also there’s that tricky detail that it runs on Java.

You can do the same thing: DRI_PRIME=1 java -jar (or whatever your Minecraft launcher is called).

But won’t it apply only to the launcher then? In this case then it won’t make difference really.

No, it will not apply only to the launcher.

As @pobrn said, it will work for launcher and the game. The same is with Steam. If you set Steam to launch on dGPU, you can get rid of the additional commands in Steam, because all games will work in dGPU as well.,

My understanding is that launching steam itself using PRIME is discouraged.

From what I saw, only responders from this forum displayed info that it’s not advised but gave no real data of why. My experience shows it works fine and has no influence on game performance. I have an older card Nvidia GTX 970 M so if this would be an issue, I should notice some difference in newer games, so far I haven’t.

Additional plus of running the whole Steam on dGPU is that I can set different launchers: default Steam, hybrid Steam, Nvidia Steam, depending which GPU setup I have at the moment (I use optimus-manager).

Changing launching options of many games within a Steam would be a burden. So for anyone who has options to change GPU setups in few clicks, it makes more sense to use per Steam setup and not per game.