Switchable GPU AMD/Intel - Can't switch to AMD for Gaming!

Hi Guys, I’m new here it’s my first time on Manjaro, My Laptop is Dell insprion 3537 . My problem is I can’t switch from Intel to AMD even when I was on Ubuntu I couldn’t do that! so I will list what i tried and its outpost:

 Operating System: Manjaro Linux
KDE Plasma Version: 5.20.4
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2
Kernel Version: 5.10.2-2-MANJARO
OS Type: 64-bit
Processors: 4 × Intel® Core™ i5-4200U CPU @ 1.60GHz
Memory: 3.7 GiB of RAM
Graphics Processor: Mesa DRI Intel® HD Graphics 4400
   $ xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x44 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 1 name:modesetting
Provider 1: id: 0xb0 cap: 0x5, Source Output, Source Offload crtcs: 0 outputs: 0 associated providers: 1 name:modesetting

then did:

xrandr --setprovideroffloadsink 0xb0 0x44  

didn’t work so did:

 DRI_PRIME=1 glxinfo | grep 'renderer string'
(output):
 OpenGL renderer string: AMD HAINAN (DRM 2.50.0, 5.10.7-3-MANJARO, LLVM 11.0.1)

Also didn’t launch the game on AMD still every game runs on Intel! And yeah every game I launch i do: DRI_PRIME=1 %command% still no progress.

I Also tried to configure the file of the game so I went to:

/usr/share/applications/

Changed lutris and tried to change one of the games directly but didn’t work! Strange!

[Desktop Entry]
Name=Lutris
Comment=open source gaming platform
Categories=Game;
Keywords=gaming;wine;emulator;
> DRI_PRIME=1
Exec=lutris %U
Icon=lutris
Terminal=false
Type=Application
MimeType=x-scheme-handler/lutris;

Also did the same to one of my games still no progress!
PS. How to know which driver I installed for my AMD GPU.

Please someone, help :slight_smile:

Hello,

That is wrong. You have to use:
Exec=DRI_PRIME=1 lutris %U

Same as you would use from terminal

thanks man for pointing me on this mistake.

I did as you said and changed it, but stangly it didn’t work also

i’m thinking of trying OPTIMUS I don’t know if it will work on not.

i think of tryig this: https://forum.manjaro.org/t/optimus-solutions-direction-please/49295/2?u=asker123

update: I installed OPTIMUS and still trying but until now no progress.

You can always use lutris for gaming and toggle the prime render offload option. That will launch all games on the dedicated gpu

Well my dedicated GPU for gaming isn’t Nividia it’s AMD so…

but I get it i enabled (Use discrete grahpics)

I even tried your suggestion and still those two didn’t work

lately i tried to use DRI=1 on lutris

here is output it seems intel will always show up LOL!!

$ DRI_PRIME=1 lutris
Unsupported locale setting. Fix your locales
Unable to load locale dir, translations won't work.

(lutris:6498): Gtk-WARNING **: 10:07:14.291: Locale not supported by C library.
Using the fallback 'C' locale.

(lutris:6498): Gtk-WARNING **: 10:07:14.308: Theme parsing error: gtk.css:68:35: The style property GtkButton:ch
ild-displacement-x is deprecated and shouldn't be used anymore. It will be removed in a future version

(lutris:6498): Gtk-WARNING **: 10:07:14.308: Theme parsing error: gtk.css:69:35: The style property GtkButton:ch
ild-displacement-y is deprecated and shouldn't be used anymore. It will be removed in a future version

(lutris:6498): Gtk-WARNING **: 10:07:14.308: Theme parsing error: gtk.css:73:46: The style property GtkScrolledW
indow:scrollbars-within-bevel is deprecated and shouldn't be used anymore. It will be removed in a future versio
n
2021-01-20 10:07:15,364: Your version of python-magic is too old.
2021-01-20 10:07:15,471: Initializing lutris
2021-01-20 10:07:16,281: Runtime up-to-date. Initialization complete.
2021-01-20 10:07:16,287: Lutris 0.5.8.1
2021-01-20 10:07:16,288: Running AMD Mesa driver 20.3.3 on AMD HAINAN (DRM 2.50.0, 5.10.7-3-MANJARO, LLVM 11.0.1
) (0x6660)
2021-01-20 10:07:16,288: GPU: 1002:6660 1028:05EA (radeon drivers)
2021-01-20 10:07:16,288: GPU: 8086:0A16 1028:05EA (i915 drivers)
MESA-INTEL: warning: Haswell Vulkan support is incomplete

(lutris:6498): Gtk-WARNING **: 10:07:16.461: Theme parsing error: gtk.css:68:35: The style property GtkButton:ch
ild-displacement-x is deprecated and shouldn't be used anymore. It will be removed in a future version

(lutris:6498): Gtk-WARNING **: 10:07:16.461: Theme parsing error: gtk.css:69:35: The style property GtkButton:ch
ild-displacement-y is deprecated and shouldn't be used anymore. It will be removed in a future version

(lutris:6498): Gtk-WARNING **: 10:07:16.461: Theme parsing error: gtk.css:70:34: The style property GtkCheckButt
on:indicator-size is deprecated and shouldn't be used anymore. It will be removed in a future version

(lutris:6498): Gtk-WARNING **: 10:07:16.461: Theme parsing error: gtk.css:71:36: The style property GtkCheckMenu
Item:indicator-size is deprecated and shouldn't be used anymore. It will be removed in a future version

(lutris:6498): Gtk-WARNING **: 10:07:16.461: Theme parsing error: gtk.css:73:46: The style property GtkScrolledW
indow:scrollbars-within-bevel is deprecated and shouldn't be used anymore. It will be removed in a future versio
n

(lutris:6498): Gtk-WARNING **: 10:07:16.461: Theme parsing error: gtk.css:76:30: The style property GtkExpander:
expander-size is deprecated and shouldn't be used anymore. It will be removed in a future version
2021-01-20 10:07:59,516: Game still running (state: running)
2021-01-20 10:07:59,517: Stopping The Three Kingdoms (linux)

even the games won’t launch on AMD all do it on Intel!!!

Can you post the output of inxi -Gazy?

$ inxi -Gazy
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "",
        LC_ALL = (unset),
        LC_ADDRESS = "en_US.UTF-8",
        LC_NAME = "en_US.UTF-8",
        LC_MONETARY = "en_US.UTF-8",
        LC_PAPER = "en_US.UTF-8",
        LC_IDENTIFICATION = "en_US.UTF-8",
        LC_TELEPHONE = "en_US.UTF-8",
        LC_MEASUREMENT = "en_001.UTF-8",
        LC_TIME = "ar_EG.UTF-8",
        LC_NUMERIC = "en_001.UTF-8",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
Graphics:
  Device-1: Intel Haswell-ULT Integrated Graphics vendor: Dell driver: i915 
  v: kernel bus ID: 00:02.0 chip ID: 8086:0a16 
  Device-2: AMD Sun XT [Radeon HD 8670A/8670M/8690M / R5 M330 / M430 / Radeon 
  520 Mobile] 
  vendor: Dell driver: radeon v: kernel alternate: amdgpu bus ID: 03:00.0 
  chip ID: 1002:6660 
  Device-3: Microdia Dell Laptop Integrated Webcam HD type: USB 
  driver: uvcvideo bus ID: 1-1.8:5 chip ID: 0c45:64ad 
  Display: x11 server: X.Org 1.20.10 compositor: kwin_x11 driver: 
  loaded: ati,intel,radeon unloaded: modesetting alternate: fbdev,vesa 
  display ID: :0 screens: 1 
  Screen-1: 0 s-res: 1366x768 s-dpi: 96 s-size: 361x203mm (14.2x8.0") 
  s-diag: 414mm (16.3") 
  Monitor-1: eDP1 res: 1366x768 hz: 60 dpi: 102 size: 340x190mm (13.4x7.5") 
  diag: 389mm (15.3") 
  OpenGL: renderer: Mesa DRI Intel HD Graphics 4400 (HSW GT2) 
  v: 4.5 Mesa 20.3.3 compat-v: 3.0 direct render: Yes

What’s the output of DRI_PRIME=1 glxinfo -B | grep renderer?

Perhaps Lutris launch on AMD GPU as intended, but it spawns child processes (games) which don’t inherit that setting.

In game options in Lutris, go to your game, click Configure, on Game Options tab add DRI_PRIME=1 to Executable field (on the beginning) and try again.

$ DRI_PRIME=1 glxinfo -B | grep renderer
Extended renderer info (GLX_MESA_query_renderer):
OpenGL renderer string: AMD HAINAN (DRM 2.50.0, 5.10.7-3-MANJARO, LLVM 11.0.1)

cryptocurious?
Did I do it right ?

I feel I done it wrong can you please explain it a bit more?
Screenshot_20210121_135243

You don’t need the / at the beginning. It’s just DRI_PRIME=1 /home/....

that is strange whenever I do as you said it changes to it>

Screenshot_20210121_135742

by the way about the command I posted earlier, so what does this mean about my problem ?

Wait, that’s not where you should set DRI_PRIME. Please remove it from that field. What options are under “Runner options”?

If Lutris wont let you begin Executable field with something else than / (means it expects path to file), then put DRI_PRIME=1 to that start.sh it points to.
Meaning: put that into start.sh file, just before command to actually start the game. If in doubt, paste start.sh file contents here.

so you mean I write it like that:

/home/ramysaber/G/Games/Total War: Three Kingdoms/ThreeKingdoms/DRI_PRIME=1 start.sh

As for the file, here:

#!/bin/bash
APP_PATH=$(dirname "$0";)
APP_NAME="./ThreeKingdoms.sh"
APP_ID=779340
CONFIG_PATH=$(dirname "$0")
STEAM_RUNTIME="steam-runtime/run.sh"

CUR_DIR=$(pwd)
cd "$CONFIG_PATH"
mkdir -p ~/.steam/sdk64
mkdir -p ~/.steam/sdk32
#make a backup of original files
mv ~/.steam/steam.pid ~/.steam/steam.pid.orig || true
mv ~/.steam/sdk64/steamclient.so ~/.steam/sdk64/steamclient.so.orig || true
mv ~/.steam/sdk32/steamclient.so ~/.steam/sdk32/steamclient.so.orig || true
#copy our files
cp x86/steamclient.so ~/.steam/sdk32/steamclient.so
cp x86_64/steamclient.so ~/.steam/sdk64/steamclient.so
echo $BASHPID > ~/.steam/steam.pid
cd "$APP_PATH"
if [ -z "$STEAM_RUNTIME" ]
then
SteamAppPath="$APP_PATH" SteamAppId=$APP_ID SteamGameId=$APP_ID "$APP_NAME"
else
SteamAppPath="$APP_PATH" SteamAppId=$APP_ID SteamGameId=$APP_ID "$STEAM_RUNTIME" "$APP_NAME"
fi

cd "$CUR_DIR"
#restore original
rm -f ~/.steam/steam.pid
rm -f ~/.steam/sdk64/steamclient.so
rm -f ~/.steam/sdk32/steamclient.so
mv ~/.steam/steam.pid.orig ~/.steam/steam.pid
mv ~/.steam/sdk64/steamclient.so.orig ~/.steam/sdk64/steamclient.so || true
mv ~/.steam/sdk32/steamclient.so.orig ~/.steam/sdk32/steamclient.so || true

did as you say…

Screenshot_20210121_141309

The “Use discrete graphics” option is checked, are you sure that’s not working?

I’m very very sad that it’s not working.

I will post…

lutris-wrapper: The Three Kingdoms
Running /home/ramysaber/G/Games/Total War: Three Kingdoms/ThreeKingdoms/start.sh
Initial process has started with pid 7846
Start monitoring process.
/home/ramysaber/G/Games/Total War: Three Kingdoms/ThreeKingdoms/config/steam-check.sh: line 2: [: too many argum
ents
/home/ramysaber/G/Games/Total War: Three Kingdoms/ThreeKingdoms/config/steam-check.sh: line 9: [: too many argum
ents
MESA-INTEL: warning: Haswell Vulkan support is incomplete
ThreeKingdoms: crash reporter initialised with path "/home/ramysaber/.local/share/feral-interactive/Three Kingdo
ms/crashes"
SDL2 initialised [built against 2.0.9, running with 2.0.9]
Setting breakpad minidump AppID = 779340
Steam_SetMinidumpSteamID:  Caching Steam ID:  76561199281203856 [API loaded no]
MESA-INTEL: warning: Haswell Vulkan support is incomplete
[0121/141940.659541:ERROR:gpu_process_transport_factory.cc(1026)] Lost UI shared context.
[0121/141941.011169:INFO:CONSOLE(8672)] "Synchronous XMLHttpRequest on the main thread is deprecated because of
its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.", sourc
e: file:///home/ramysaber/G/Games/Total%20War%3A%20Three%20Kingdoms/ThreeKingdoms/share/FeralUI/Core/3rdParty/jq
uery-ui-1.10.4.custom/js/jquery-1.10.2.js (8672)
[0121/141941.042897:INFO:CONSOLE(0)] "Styling master document from stylesheets defined in HTML Imports is deprec
ated. Please refer to https://goo.gl/EGXzpw for possible migration paths.", source:  (0)
[0121/141941.171282:INFO:CONSOLE(6569)] "The specified value "!" does not conform to the required format.  The f
ormat is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.", source: file:///home/ramysaber/G/Games/
Total%20War%3A%20Three%20Kingdoms/ThreeKingdoms/share/FeralUI/Core/3rdParty/jquery-ui-1.10.4.custom/js/jquery-1.
10.2.js (6569)

Revert Lutris Executable field as it was, delete any modifications. Make sure it’s fixed and start normally (on Intel). When this is done:

Now, put
DRI_PRIME=1 in in second line of start.sh file you pasted, like this:

#!/bin/bash
DRI_PRIME=1
(...)

And see how that goes.