Very bad GPU performance

Been trying to switch my main station from windows to linux and chose Manjaro, since I already use it for work and like it a lot. Now, the problem is that the performance is really bad when playing games on Steam or trough Lutris. For ex. in Hell let loose game I only get like ~20fps where as in Windows I would usually get ~60+. Same goes for other games I tested. The overall performance is bad in other programs as well, such as Google chrome. Watching videos is very laggy and slow, which makes me think there is something wrong with how my GPU is set up. Here is my system:

inxi -b

System:
  Host: matas-b450gamingx Kernel: 6.6.8-2-MANJARO arch: x86_64 bits: 64
    Desktop: KDE Plasma v: 5.27.10 Distro: Manjaro Linux
Machine:
  Type: Desktop Mobo: Gigabyte model: B450 GAMING X v: x.x
    serial: <superuser required> UEFI: American Megatrends LLC. v: F61c
    date: 05/10/2021
CPU:
  Info: 6-core AMD Ryzen 5 3600 [MT MCP] speed (MHz): avg: 2240
    min/max: 2200/4208
Graphics:
  Device-1: AMD Ellesmere [Radeon RX 470/480/570/570X/580/580X/590]
    driver: amdgpu v: kernel
  Display: x11 server: X.Org v: 21.1.10 with: Xwayland v: 23.2.3 driver: X:
    loaded: amdgpu unloaded: modesetting dri: radeonsi gpu: amdgpu resolution:
    1: 1920x1080~60Hz 2: 1920x1080
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd mesa v: 23.3.3-manjaro1.1
    renderer: AMD Radeon RX 590 Series (radeonsi polaris10 LLVM 16.0.6 DRM 3.54
    6.6.8-2-MANJARO)
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    driver: r8169
Drives:
  Local Storage: total: 942.7 GiB used: 357.35 GiB (37.9%)
Info:
  Processes: 312 Uptime: 35m Memory: total: 32 GiB available: 31.29 GiB
  used: 4.13 GiB (13.2%) Shell: Zsh inxi: 3.3.31

inxi -Gazy

Graphics:
  Device-1: AMD Ellesmere [Radeon RX 470/480/570/570X/580/580X/590]
    vendor: Gigabyte driver: amdgpu v: kernel arch: GCN-4 code: Arctic Islands
    process: GF 14nm built: 2016-20 pcie: gen: 1 speed: 2.5 GT/s lanes: 16
    link-max: gen: 3 speed: 8 GT/s ports: active: DP-2,DP-3
    empty: DP-1,HDMI-A-1 bus-ID: 07:00.0 chip-ID: 1002:67df class-ID: 0300
    temp: 49.0 C
  Display: x11 server: X.Org v: 21.1.10 with: Xwayland v: 23.2.3
    compositor: kwin_x11 driver: X: loaded: amdgpu unloaded: modesetting
    alternate: fbdev,vesa dri: radeonsi gpu: amdgpu display-ID: :0 screens: 1
  Screen-1: 0 s-res: 3840x1080 s-dpi: 96 s-size: 1016x285mm (40.00x11.22")
    s-diag: 1055mm (41.54")
  Monitor-1: DP-2 mapped: DisplayPort-1 pos: right model: Philips PHL 273V7
    serial: <filter> built: 2021 res: 1920x1080 hz: 60 dpi: 82 gamma: 1.2
    size: 598x336mm (23.54x13.23") diag: 686mm (27") ratio: 16:9 modes:
    max: 1920x1080 min: 720x400
  Monitor-2: DP-3 mapped: DisplayPort-2 pos: primary,left
    model: BenQ ZOWIE XL LCD serial: <filter> built: 2019 res: 1920x1080 dpi: 92
    gamma: 1.2 size: 531x298mm (20.91x11.73") diag: 609mm (24") ratio: 16:9
    modes: max: 1920x1080 min: 720x400
  API: EGL v: 1.5 hw: drv: amd radeonsi platforms: device: 0 drv: radeonsi
    device: 1 drv: swrast surfaceless: drv: radeonsi x11: drv: radeonsi
    inactive: gbm,wayland
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd mesa v: 23.3.3-manjaro1.1
    glx-v: 1.4 direct-render: yes renderer: AMD Radeon RX 590 Series (radeonsi
    polaris10 LLVM 16.0.6 DRM 3.54 6.6.8-2-MANJARO) device-ID: 1002:67df
    memory: 7.81 GiB unified: no
  API: Vulkan v: 1.3.274 layers: 9 device: 0 type: discrete-gpu name: AMD
    Radeon RX 590 Series (RADV POLARIS10) driver: mesa radv
    v: 23.3.3-manjaro1.1 device-ID: 1002:67df surfaces: xcb,xlib

mhwd -li

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


Warning: No installed USB configs!

Note: I do have gamemode installed and added it to Steam as launch option for each game, but it does not help at all.

I appreciate your answers.

It may or may not be due to upstream Mesa removed various encoders due to possible patent violations.

This is unfortunately hitting AMD GPU users hard.

Please search the forum (top right corner :mag: ) - Search results for 'mesa non free' - Manjaro Linux Forum - as this has been discussed frequently.

Various solution has been proposed and devised and is available either as third party repo or custom build from AUR.

Using either requires your system to be on Manjaro unstable as this most closely resembles an Arch Linux installation which is required to use AUR or third party repo.

1 Like

BIOS is out of date.
(updates include things like ryzen support)
If my search is correct:

If this is the case, we can official say that nvidia gives today better Linux support than AMD does :scream_cat:

AMD users on Stable branch just need to install the relevant amdonly-gaming packages from the AUR to enable patented codecs again. I even made a little bash script for myself that I run (as normal user - no sudo) every week or so (and after any system updates) to rebuild the amdonly packages to the latest version of Mesa. Please note: amdonly-gaming will install Mesa development, not the latest stable release. The first build will be a download of 600-700MB, however rebuilds will be a lot smaller (as long as the user does not empty the build files folder).

#!/bin/bash

# amdonlybuild - a script to install Mesa packages with patented codecs.
# Customised for a system without multilib (32 bit)repo. Users with multilib may need to also install 32-bit versions.

pamac build directx-headers-git amdonly-gaming-mesa amdonly-gaming-libva-mesa-driver amdonly-gaming-mesa-vdpau amdonly-gaming-vulkan-radeon

exit 0

vainfo now shows the following for my system:

vainfo
Trying display: wayland
vainfo: VA-API version: 1.20 (libva 2.20.1)
vainfo: Driver version: Mesa Gallium driver 24.1.0-devel for AMD Radeon Graphics (radeonsi, renoir, LLVM 16.0.6, DRM 3.56, 6.7.0-0-MANJARO)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc
2 Likes

I don’t understand… is amdonly-gaming now compatible with the Stable branch or not?

Why wouldn’t it be? I’ve been using it on my Stable system for a month or so without any problems. But I do rebuild it after any system updates in case anything it depends upon has changed (as is recommended with any AUR packages). The only issue I’ve had so far is that I had to build directx-headers-git from the AUR as Manjaro Stable branch’s directx-headers was an earlier version than the one required by amdonly-gaming.

amdonly-gaming packages is build from source - thus they will run - this is not a branch compatibility issue.

Any software which is build from source and packaged on the user’s system will work with the user’s system.

Those old enough to remember knows this is how Linux and GNU systems is build - from scratch.

Many, many GNU/Linux users today have grown up with a packages being available in binary format and that it is those distributing the binary packages which are to blame when packages does not provide the expected content and their system does not perform as expected.

There is this grab, consume and complain mentality amongst a group of younger free software consumers.

There is a huge amount of time spent by the people bringing binary packages to you - and when you build the packages yourself - you very quickly learn how much work there is going into this task.

What you need to keep in mind - when syncing your system - depending on the packages synced, you may get issues pertaining to your custom package(s).

Building mesa is not one-time - kipi’ai’a, done that - you must maintain it on a regular base.

1 Like

The videos issue is likely because of mesa codecs as others have already explained. Apart from that you can’t set that GPU up wrong, it just uses amdgpu driver and end of story.

Gaming on Linux isn’t perfect and you may run into issues which you need to solve yourself. The best place to look when that happens is https://www.protondb.com . E.g. for Hell Let Loose there are numerous reports that it runs better with dx12;

gamemoderun %command% -dx12

How do you get MPEG2 and VC1 Profile?
In my system MPEG2 is missing, but I have AV1…?

vainfo                                                                      ✔ 
Trying display: wayland
Trying display: x11
vainfo: VA-API version: 1.20 (libva 2.20.1)
vainfo: Driver version: Mesa Gallium driver 24.1.0-devel for AMD Radeon Graphics (radeonsi, gfx1103_r1, LLVM 16.0.6, DRM 3.56, 6.7.0-2-MANJARO)
vainfo: Supported profile and entrypoints
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileAV1Profile0            : VAEntrypointVLD
      VAProfileAV1Profile0            : VAEntrypointEncSlice
      VAProfileNone                   : VAEntrypointVideoProc

I don’t think AV1 hardware decoding is possible with my AMD 5800H, which is used in mini-PCs & laptops. I’m pretty sure I read something recently that said the next AMD series (AMD 7XXXH etc) does have inbuilt AV1 capacity. So I guess I’ll have to wait until I decide to replace the Beelink SER5 MAX mini-PC I bought a few months ago with a Beelink SER7.

Regarding the MPEG2 & VC1 codecs, I have no idea why I have hardware decoding & you don’t. Perhaps a look at the amdonly-gaming PKGBUILD - aur.git - AUR Package Repositories might provide some clues. Line 174 (which I believe contains the codecs to be activated) says:

-D video-codecs=vc1dec,h264dec,h264enc,h265dec,h265enc,av1dec,av1enc,vp9dec

Hm, APU Specs ( AMD Ryzen™ 9 7940HS) show support for H265, VC1 and MPEG2:

Is the GPU (AMD 780M) not yet fully supported in Linux? Or maybe it’s a Mesa issue?

These are proprietary video codecs.

No, Manjaro and some distro companies have removed these video codecs from mesa due to the patent issue.

You can use AV1 codecs instead of the proprietary codecs.
Your modern CPU can handle the proprietary decoder without hardware acceleration while watching videos (1x speed, that is extremely cheap for the CPU), in future you should never use the proprietary encoder such as H265 when rendering/creating new videos.