# Amdgpu + mesa compiled with video_cards_radeonsi

## jimmij

I have amdgpu (stoney, device 98e4) which, according to https://wiki.gentoo.org/wiki/AMDGPU, should be set in make.conf as VIDEO_CARDS='amdgpu radeonsi'. Everything works fine under gnome3 or in console, but when I log-in to mate or pure sawfish I observe very strange behavior: I can run a terminal and even firefox, but some operations (for example switching the workspace) freeze all windows. Actually they don't freeze, just the graphics don't get "refreshed", so I can hear the sound, click or even write commands (blindfold) in the terminal to get the job done. I'm able to refresh the screen manually by switching to VT and back, sometimes switching between windows works as refresher too, although not always.

Now, I was able to pinpoint the problem to media-libs/mesa; the issue exists only when mesa is compiled with "radeonsi" flag, replacing it to "radeon" solves the problem. Obviously this is not the real solution because with radeon driver I cannot get my card working properly, for example mplayer cannot run in fullscreen mode and claims my driver is wrong. So, for now I have to work in gnome3 which I really hate, but because it works there I suspect that the problem lies not in kernel or mesa but rather in Xorg.conf somewhere. I didn't play with this myself, so far everything is on auto-mode, but I don't see anything wrong in /var/log/Xorg.0.log, drivers are being detected and configured properly.

My current set-up:

kernel: gentoo-sources-4.18.3

mesa: newest git version (**9999)

xorg-drivers: **9999

Any suggestions where to dig further?

----------

## xdarma

 *jimmij wrote:*   

> I have amdgpu (stoney, device 98e4) 
> 
> [...snip...]
> 
> Obviously this is not the real solution because with radeon driver I cannot get my card working properly, for example mplayer cannot run in fullscreen mode and claims my driver is wrong. So, for now I have to work in gnome3 which I really hate, but because it works there I suspect that the problem lies not in kernel or mesa but rather in Xorg.conf somewhere.

 

Stoney is a GCN-3 card, so, if I'm correct, only amdgpu kernel module can works.

You can disable the radeon kernel driver at bootprompt with:

```
modprobe.blacklist=radeon
```

You can leave both radeon and radeonsi USE for mesa and xorg-drivers:

```
xdarma@ichigo ~ $ eix --installed-with-use --only-names video_cards_radeonsi

media-libs/mesa

x11-base/xorg-drivers
```

```
xdarma@ichigo ~ $ eix --installed-with-use --only-names video_cards_radeon

media-libs/mesa

x11-base/xorg-drivers

x11-libs/libdrm
```

```
xdarma@ichigo ~ $ eix --installed-with-use --only-names video_cards_amdgpu

virtual/opencl

x11-base/xorg-drivers

x11-libs/libdrm
```

----------

## jimmij

 *xdarma wrote:*   

>  *jimmij wrote:*   I have amdgpu (stoney, device 98e4) 
> 
> [...snip...]
> 
> Obviously this is not the real solution because with radeon driver I cannot get my card working properly, for example mplayer cannot run in fullscreen mode and claims my driver is wrong. So, for now I have to work in gnome3 which I really hate, but because it works there I suspect that the problem lies not in kernel or mesa but rather in Xorg.conf somewhere. 
> ...

 

I didn't compile radeon into the kernel, so have nothing to blacklist.

----------

## xdarma

I don't think you can use the radeon xorg driver with the amdgpu kernel driver:

```
xdarma@ichigo ~ $ grep radeon /var/log/Xorg.0.log

[    20.701] Kernel command line: BOOT_IMAGE=/boot/kernel-opencl-x86_64-4.17.12-gentoo.s1 root=/dev/md6 ro rootfstype=btrfs video=1920x1080 modprobe.blacklist=radeon amdgpu.si_support=1 amdgpu.cik_support=1

[    20.725] (II) LoadModule: "radeon"

[    20.726] (II) Loading /usr/lib64/xorg/modules/drivers/radeon_drv.so

[    20.728] (II) Module radeon: vendor="X.Org Foundation"

[    21.180] (II) UnloadModule: "radeon"

[    21.180] (II) Unloading radeon

[    21.180] (II) AMDGPU(0): [DRI2]   DRI driver: radeonsi

[    21.180] (II) AMDGPU(0): [DRI2]   VDPAU driver: radeonsi
```

My card is a GCN-1 generation (radeonsi), the radeon kernel driver is blacklisted, Xorg unload the radeon driver and keep in use the amdgpu driver.

I'm using this setup for make.conf:

```
xdarma@ichigo ~ $ grep VIDEO /etc/portage/make.conf

VIDEO_CARDS="vesa amdgpu radeon radeonsi"
```

----------

## jimmij

 *xdarma wrote:*   

> I don't think you can use the radeon xorg driver with the amdgpu kernel driver:

 

I don't use radeon driver, I use amdgpu_drv.so loaded from /usr/lib/xorg/modules/drivers/. In fact I tried to remove "radeon" everywhere to avoid any conflicts, there is only one package which forcibly, by itself, sets video_cards_radeon flag and it is x11-libs/libdrm (required by mesa); but it uses also video_cards_amdgpu, so perhaps I should try to recompile it somehow without video_cards_radeon as well?

----------

## xdarma

My system works with the opposite setup: full support for all amdgpu, radeon and radeonsi.

----------

## jimmij

If someone struggle with similar problem:

I solved this issue by disabling DRM_AMD_DC_FBC, located at

 -> Device Drivers  

    -> Graphics support

        -> Display Engine Configuration

             -> AMD DC - Enable new display engine

                  -> AMD FBC - Enable Frame Buffer Compression

----------

## xdarma

Enabling all relevant USE does not solve the various problems?

----------

