Poor performance with amdgpu

Hi :smiley: i have manjaro sway editions, and there are two gpus on my laptop, an intel HD Graphics 520 and AMD Radeon R7 M360. i tried to install some games on my system and everything was fine, i used DRI_PRIME=1 %command% to run games with amdgpu in steam. but i saw poor performance from my AMD gpu, so i went to benchmark my AMD and Intel GPUs. i used glmark2 and unigine-heaven benchmarks for both Intel and AMD, under the same settings. and heres what i got:

    glmark2 2021.12
    OpenGL Information
    GL_VENDOR:     Intel
    GL_RENDERER:   Mesa Intel(R) HD Graphics 520 (SKL GT2)
    GL_VERSION:    4.6 (Compatibility Profile) Mesa 21.3.8
[build] use-vbo=false: FPS: 885 FrameTime: 1.130 ms
[build] use-vbo=true: FPS: 2072 FrameTime: 0.483 ms
[texture] texture-filter=nearest: FPS: 1973 FrameTime: 0.507 ms
[texture] texture-filter=linear: FPS: 1956 FrameTime: 0.511 ms
[texture] texture-filter=mipmap: FPS: 1746 FrameTime: 0.573 ms
[shading] shading=gouraud: FPS: 1849 FrameTime: 0.541 ms
[shading] shading=blinn-phong-inf: FPS: 1863 FrameTime: 0.537 ms
[shading] shading=phong: FPS: 2098 FrameTime: 0.477 ms
[shading] shading=cel: FPS: 2135 FrameTime: 0.468 ms
[bump] bump-render=high-poly: FPS: 1631 FrameTime: 0.613 ms
[bump] bump-render=normals: FPS: 1936 FrameTime: 0.517 ms
[bump] bump-render=height: FPS: 2013 FrameTime: 0.497 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 2670 FrameTime: 0.375 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 1273 FrameTime: 0.786 ms
[pulsar] light=false:quads=5:texture=false: FPS: 1910 FrameTime: 0.524 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 1105 FrameTime: 0.905 ms
[desktop] effect=shadow:windows=4: FPS: 775 FrameTime: 1.290 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 124 FrameTime: 8.065 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 253 FrameTime: 3.953 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 135 FrameTime: 7.407 ms
[ideas] speed=duration: FPS: 447 FrameTime: 2.237 ms
[jellyfish] <default>: FPS: 1754 FrameTime: 0.570 ms
[terrain] <default>: FPS: 220 FrameTime: 4.545 ms
[shadow] <default>: FPS: 1059 FrameTime: 0.944 ms
[refract] <default>: FPS: 408 FrameTime: 2.451 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 1901 FrameTime: 0.526 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 2058 FrameTime: 0.486 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 1885 FrameTime: 0.531 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 1984 FrameTime: 0.504 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 1990 FrameTime: 0.503 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 1910 FrameTime: 0.524 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 1867 FrameTime: 0.536 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 1878 FrameTime: 0.532 ms
                                  glmark2 Score: 1507 
    glmark2 2021.12
    OpenGL Information
    GL_VENDOR:     AMD
    GL_RENDERER:   AMD Radeon R7 M360 (ICELAND, DRM 3.44.0, 5.16.18-1-MANJARO, LLVM 13.0.1)
    GL_VERSION:    4.6 (Compatibility Profile) Mesa 21.3.8
[build] use-vbo=false: FPS: 289 FrameTime: 3.460 ms
[build] use-vbo=true: FPS: 344 FrameTime: 2.907 ms
[texture] texture-filter=nearest: FPS: 309 FrameTime: 3.236 ms
[texture] texture-filter=linear: FPS: 322 FrameTime: 3.106 ms
[texture] texture-filter=mipmap: FPS: 317 FrameTime: 3.155 ms
[shading] shading=gouraud: FPS: 318 FrameTime: 3.145 ms
[shading] shading=blinn-phong-inf: FPS: 313 FrameTime: 3.195 ms
[shading] shading=phong: FPS: 314 FrameTime: 3.185 ms
[shading] shading=cel: FPS: 313 FrameTime: 3.195 ms
[bump] bump-render=high-poly: FPS: 319 FrameTime: 3.135 ms
[bump] bump-render=normals: FPS: 349 FrameTime: 2.865 ms
[bump] bump-render=height: FPS: 351 FrameTime: 2.849 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 314 FrameTime: 3.185 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 278 FrameTime: 3.597 ms
[pulsar] light=false:quads=5:texture=false: FPS: 324 FrameTime: 3.086 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 269 FrameTime: 3.717 ms
[desktop] effect=shadow:windows=4: FPS: 306 FrameTime: 3.268 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 218 FrameTime: 4.587 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 168 FrameTime: 5.952 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 224 FrameTime: 4.464 ms
[ideas] speed=duration: FPS: 328 FrameTime: 3.049 ms
[jellyfish] <default>: FPS: 288 FrameTime: 3.472 ms
[terrain] <default>: FPS: 92 FrameTime: 10.870 ms
[shadow] <default>: FPS: 238 FrameTime: 4.202 ms
[refract] <default>: FPS: 100 FrameTime: 10.000 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 324 FrameTime: 3.086 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 325 FrameTime: 3.077 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 325 FrameTime: 3.077 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 324 FrameTime: 3.086 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 323 FrameTime: 3.096 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 324 FrameTime: 3.086 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 324 FrameTime: 3.086 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 323 FrameTime: 3.096 ms
                                  glmark2 Score: 290 

you can see the problem, how in the world my AMD GPU score is this lower than Intel !?!?!
unigine-heaven also gives same results, AMD score is 87 and Intel score is 177 :expressionless:
is there something wrong with my GPU ? or its my GPU driver (amdgpu) ?
i’m also not sure if im running games or benchmarks correctly so they use AMD gpu… for example i ran glmark2 for AMD with this command : DRI_PRIME=1 glmark2 --fullscreen .
shouldnt i use DRI_PRIME=1 ? or theres another way to run a process using AMD gpu?

provide formated output:
inxi -Fazy
mhwd -l
mhwd -li
and try command prime-run name of game or program

first of all , inxi was not installed, and i had to install it ( is that a problem? ). i also dont have prime-run command, and its available in nvidia-prime package, should i install that ?

❯ inxi -Fazy
  Kernel: 5.16.18-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 11.2.0
    parameters: BOOT_IMAGE=/boot/vmlinuz-5.16-x86_64
    root=UUID=289aea6f-4f1a-46c6-a927-a71014981328 rw quiet apparmor=1
    security=apparmor udev.log_priority=3
  Desktop: sway v: 1.7 info: waybar vt: 2 dm: greetd Distro: Manjaro Linux
    base: Arch Linux
  Type: Laptop System: LENOVO product: 80NT v: Lenovo ideapad 500-15ISK
    serial: <superuser required> Chassis: type: 10 v: Lenovo ideapad 500-15ISK
    serial: <superuser required>
  Mobo: LENOVO model: Lenovo ideapad 5 v: No DPK
    serial: <superuser required> UEFI: LENOVO v: CFCN26WW(V1.08)
    date: 07/09/2018
  ID-1: BAT1 charge: 15.7 Wh (78.1%) condition: 20.1/37.5 Wh (53.6%)
    volts: 16.7 min: 14.9 model: LENOVO PABAS0241231 type: Li-ion
    serial: <filter> status: charging
  Info: model: Intel Core i5-6200U bits: 64 type: MT MCP arch: Skylake
    family: 6 model-id: 0x4E (78) stepping: 3 microcode: 0xEC
  Topology: cpus: 1x cores: 2 tpc: 2 threads: 4 smt: enabled cache:
    L1: 128 KiB desc: d-2x32 KiB; i-2x32 KiB L2: 512 KiB desc: 2x256 KiB
    L3: 3 MiB desc: 1x3 MiB
  Speed (MHz): avg: 500 min/max: 400/2800 scaling: driver: intel_pstate
    governor: powersave cores: 1: 500 2: 500 3: 500 4: 500 bogomips: 19204
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3
  Type: itlb_multihit status: KVM: VMX unsupported
  Type: l1tf mitigation: PTE Inversion
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable
  Type: meltdown mitigation: PTI
  Type: spec_store_bypass
    mitigation: Speculative Store Bypass disabled via prctl
  Type: spectre_v1
    mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, IBRS_FW,
    STIBP: conditional, RSB filling
  Type: srbds mitigation: Microcode
  Type: tsx_async_abort status: Not affected
  Device-1: Intel Skylake GT2 [HD Graphics 520] vendor: Lenovo driver: i915
    v: kernel ports: active: eDP-1 empty: DP-1, DP-2, HDMI-A-1, HDMI-A-2
    bus-ID: 00:02.0 chip-ID: 8086:1916 class-ID: 0300
  Device-2: AMD Topaz XT [Radeon R7 M260/M265 / M340/M360 M440/M445 530/535
    620/625 Mobile]
    vendor: Lenovo driver: amdgpu v: kernel pcie: gen: 1 speed: 2.5 GT/s
    lanes: 4 link-max: gen: 3 speed: 8 GT/s lanes: 8 bus-ID: 01:00.0
    chip-ID: 1002:6900 class-ID: 0380
  Device-3: Acer Lenovo EasyCamera type: USB driver: uvcvideo bus-ID: 1-5:4
    chip-ID: 5986:0702 class-ID: 0e02
  Display: wayland server: Xwayland v: 22.1.1 compositor: sway v: 1.7
    driver: gpu: i915 display-ID: 1
  Monitor-1: eDP-1 model: AU Optronics 0x39ed built: 2014 res: 1920x1080
    hz: 60 dpi: 142 gamma: 1.2 scale: 1 size: 344x193mm (13.54x7.6")
    diag: 394mm (15.5") ratio: 16:9 modes: 1920x1080
  OpenGL: renderer: Mesa Intel HD Graphics 520 (SKL GT2) v: 4.6 Mesa 21.3.8
    direct render: Yes
  Device-1: Intel Sunrise Point-LP HD Audio vendor: Lenovo
    driver: snd_hda_intel v: kernel alternate: snd_soc_skl bus-ID: 00:1f.3
    chip-ID: 8086:9d70 class-ID: 0403
  Sound Server-1: ALSA v: k5.16.18-1-MANJARO running: yes
  Sound Server-2: sndio v: N/A running: no
  Sound Server-3: JACK v: 1.9.20 running: no
  Sound Server-4: PulseAudio v: 15.0 running: no
  Sound Server-5: PipeWire v: 0.3.49 running: yes
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Lenovo driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1
    port: 3000 bus-ID: 02:00.0 chip-ID: 10ec:8168 class-ID: 0200
  IF: enp2s0 state: down mac: <filter>
  Device-2: Intel Dual Band Wireless-AC 3165 Plus Bluetooth driver: iwlwifi
    v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1 bus-ID: 03:00.0
    chip-ID: 8086:3166 class-ID: 0280
  IF: wlp3s0 state: up mac: <filter>
  Device-1: Intel Bluetooth wireless interface type: USB driver: btusb v: 0.8
    bus-ID: 1-7:6 chip-ID: 8087:0a2a class-ID: e001
  Report: bt-adapter note: tool can't run ID: hci0 rfk-id: 3 state: down
    bt-service: disabled rfk-block: hardware: no software: no address: N/A
  Local Storage: total: 1.14 TiB used: 69.87 GiB (6.0%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/sda maj-min: 8:0 model: VC-500 240G size: 238.47 GiB
    block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s type: SSD
    serial: <filter> rev: 3A0 scheme: GPT
  ID-2: /dev/sdb maj-min: 8:16 vendor: Western Digital
    model: WD10JPVX-00JC3T0 size: 931.51 GiB block-size: physical: 4096 B
    logical: 512 B speed: 3.0 Gb/s type: HDD rpm: 5400 serial: <filter>
    rev: 1A01 scheme: GPT
  ID-1: / raw-size: 70 GiB size: 68.35 GiB (97.64%) used: 13.06 GiB (19.1%)
    fs: ext4 dev: /dev/sda5 maj-min: 8:5
  ID-2: /boot/efi raw-size: 4.66 GiB size: 4.65 GiB (99.80%)
    used: 26.4 MiB (0.6%) fs: vfat dev: /dev/sda2 maj-min: 8:2
  ID-3: /home raw-size: 232.93 GiB size: 228.22 GiB (97.98%)
    used: 56.78 GiB (24.9%) fs: ext4 dev: /dev/sdb4 maj-min: 8:20
  Alert: No swap data was found.
  System Temperatures: cpu: 50.0 C pch: 47.5 C mobo: N/A gpu: amdgpu
    temp: 48.0 C
  Fan Speeds (RPM): N/A
  Processes: 180 Uptime: 2h 25m wakeups: 1 Memory: 15.54 GiB
  used: 2.54 GiB (16.3%) Init: systemd v: 250 tool: systemctl Compilers:
  gcc: 11.2.0 clang: 13.0.1 Packages: pacman: 1094 lib: 295 flatpak: 0
  Shell: fish v: 3.4.1 running-in: foot inxi: 3.3.15
❯ mhwd -l
> 0000:02:00.0 (0200:10ec:8168) Network controller Realtek Semiconductor Co., Ltd.:
                  NAME               VERSION          FREEDRIVER           TYPE
         network-r8168            2016.04.20                true            PCI

> 0000:01:00.0 (0380:1002:6900) Display controller ATI Technologies Inc:
                  NAME               VERSION          FREEDRIVER           TYPE
           video-linux            2018.05.04                true            PCI

> 0000:00:02.0 (0300:8086:1916) Display controller Intel Corporation:
                  NAME               VERSION          FREEDRIVER           TYPE
           video-linux            2018.05.04                true            PCI
     video-modesetting            2020.01.13                true            PCI
            video-vesa            2017.03.12                true            PCI

❯ mhwd -li
> Installed PCI configs:
                  NAME               VERSION          FREEDRIVER           TYPE
           video-linux            2018.05.04                true            PCI

Warning: No installed USB configs!

i dont know why you didnt have installed inxi by default, it should be… no dont install the nvidia-prime package, since you dont have nvidia… i didnt know that the command prime-run is only for nvidia…maybe you could try installing video modesseting with:
sudo mhwd -i pci video-modesetting
reboot and check games

just installed video-modesetting with mhwd and tried glmark2, still poor results from AMD :frowning:

you can try different kernels, install the latest: 5.17.1-3, also 5.15 and 5.10 LTS kernels, and try with each of them, and see how it works

Since you use sway, the only way is wayland

Maybe it is supported, on xrandr to switch the gpu:

xrandr --listproviders
xrandr --setprovideroutputsource <prov-xid> <source-xid>
xrandr --setprovideroffloadsink <prov-xid> <sink-xid>

Maybe you run your game in gamescope ?

sorry i didnt understand, you say theres a problem with wayland ?
also is it normal that i get this output from xrandr --listproviders ?

❯ xrandr --listproviders
Providers: number : 0

Erm… you know that wayland development is in progress and that it is not fully compatible with everything? So should expect bugs or performance loss here and there, but yeah it is stable.