# Setup Radeon RX 5700 XT

## argil

Yes I know that this "properly" isn't supported yet. However I recently installed this gpu and wondering how to setup the kernel and the firmware to properly support it.

----------

## nvaert1986

You'll need to use bleeding edge. Kernel 5.3-rc series with Mesa 19.2 from portage and the latest linux-firmware from the GIT tree.

With the items above you should be able to pull it off and get it working. In this case I'd also suggest reading articles on Phoronix to check for exact details of what you need, as they've got it up and running.

----------

## MisteR_TwO

Like nvaert1986 said, you'll need to get on the 5.3 bandwagon. Fortunately it's not so bad on RC4. RC5 is probably out now. Be sure to compile the AMDGPU support as a module so you can load the firmware (which isn't in linux-firmware.git yet...) dynamically. That can be found here:  https://people.freedesktop.org/~agd5f/radeon_ucode/navi10/

Here's what helped me to get things running within Portage. The following is what I have in my package.accept_keywords/amdgpu file:

```
#=media-libs/mesa-18.0.5 ~amd64

>=sys-kernel/linux-firmware-20180730 ~amd64

# required by radeontop (argument)

=app-misc/radeontop-1.1 ~amd64

# required for navi support (for now)

=media-libs/mesa-9999 **

=x11-libs/libdrm-2.4.99 ~amd64

# required by =linux-firmware-99999999 (argument)

=sys-kernel/linux-firmware-99999999 **

# required by sys-devel/clang-9.0.0.9999::gentoo

# required by sys-libs/compiler-rt-9.0.0.9999::gentoo[clang]

=sys-devel/clang-runtime-9.0.0.9999 **

# required by =clang-9.0.0.9999 (argument)

=sys-devel/clang-9.0.0.9999 **

# required by sys-devel/clang-runtime-9.0.0.9999::gentoo[sanitize,compiler-rt]

# required by sys-devel/clang-9.0.0.9999::gentoo

# required by sys-libs/compiler-rt-9.0.0.9999::gentoo[clang]

=sys-libs/compiler-rt-sanitizers-9.0.0.9999 **

# required by sys-devel/clang-runtime-9.0.0.9999::gentoo[openmp]

# required by sys-devel/clang-9.0.0.9999::gentoo

# required by sys-libs/compiler-rt-9.0.0.9999::gentoo[clang]

=sys-libs/libomp-10.0.0.9999 **

# required by sys-devel/clang-runtime-9.0.0.9999::gentoo[compiler-rt]

# required by sys-devel/clang-9.0.0.9999::gentoo

# required by sys-libs/compiler-rt-sanitizers-9.0.0.9999::gentoo[clang]

=sys-libs/compiler-rt-9.0.0.9999 **

```

And here's what I have in my package.use/amdgpu file that's relevant to the discussion:

```
# required for navi support (for now)

=media-libs/mesa-9999 opencl

```

With this (and Steam/Proton) I've been able to play Rage 2 at 4K/~60 fps without too much noise from the fan. Haven't tried VR yet on this rig (VR works great on Ubuntu/Vega64), but that's a can of worms I'm not ready to open up on Gentoo.

Hope this helps!

----------

## argil

 *MisteR_TwO wrote:*   

> Like nvaert1986 said, you'll need to get on the 5.3 bandwagon. Fortunately it's not so bad on RC4. RC5 is probably out now. Be sure to compile the AMDGPU support as a module so you can load the firmware (which isn't in linux-firmware.git yet...) dynamically. That can be found here:  https://people.freedesktop.org/~agd5f/radeon_ucode/navi10/
> 
> Here's what helped me to get things running within Portage. The following is what I have in my package.accept_keywords/amdgpu file:
> 
> ```
> ...

 

Argh forgot to make libomp git as well. I did find the firmware last night though, by manually extracting and shifting though the Ubuntu package. Is this all that is required to get X to work?

----------

## MisteR_TwO

I *think* that's everything required to get a Navi card running under Gentoo. If that doesn't work, let me know, and I'll dig back through what available portage history I have to see if there was anything else I'd touched. I believe most of the changes made for Navi support were on the driver-ish side.

----------

## dimko

Fellow nerds, pls someone post dmesg output.

When I modprobe amdgpu module, i get this in dmesg:

```
[  177.199881] no MTRR for e0000000,3000000 found

[  192.467439] [drm] amdgpu kernel modesetting enabled.

[  192.467576] Parsing CRAT table with 1 nodes

[  192.467657] Ignoring ACPI CRAT on non-APU system

[  192.467737] Virtual CRAT table created for CPU

[  192.467816] Parsing CRAT table with 1 nodes

[  192.467894] Creating topology SYSFS entries

[  192.467980] Topology: Add CPU node

[  192.468059] Finished initializing topology

[  299.700307] no MTRR for e0000000,3000000 found

```

x only works in VESA

compiling *** latest mesa currently.(llvm8 actually, as its requirement)

[Moderator edit: added [code] tags to preserve output layout. -Hu]

----------

## dimko

 *MisteR_TwO wrote:*   

> Like nvaert1986 said, you'll need to get on the 5.3 bandwagon. Fortunately it's not so bad on RC4. 

 

black screen at boot.

i know OS loads. i can login as root and start X, screen changes fron black to black. after that system hard locks. and i have to raise flying elephants.

5.3.6 and 5.3.6+ were tried

in 5.2 system loads but doesnt find driver.

----------

## dimko

from Dmesg:

I try to start X after boot.

sec 110 after boot seems to be when I startx manually.

```
[   59.997887] [drm] amdgpu kernel modesetting enabled.

[   59.998025] Parsing CRAT table with 1 nodes

[   59.998107] Ignoring ACPI CRAT on non-APU system

[   59.998212] Virtual CRAT table created for CPU

[   59.998292] Parsing CRAT table with 1 nodes

[   59.998371] Creating topology SYSFS entries

[   59.998455] Topology: Add CPU node

[   59.998532] Finished initializing topology

[  110.694190] tracker-miner-a[784]: segfault at ffffffff ip 00007f2ed5616560 sp 00007ffd6a890ff0 error 4 in libglib-2.0.so.0.5800.3[7f2ed55e6000+82000]

[  110.694205] Code: 33 e8 14 ff ff ff 48 8b 5b 08 48 85 db 75 eb 48 8b 45 58 48 8b 58 18 48 85 db 74 2c 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 <48> 8b 33 48 8b 7d 20 e8 e4 fe ff ff 48 8b 5b 08 48 85 db 75 eb 48

[  111.629641] systemd-coredum (1016) used greatest stack depth: 12616 bytes left

[  118.053704] usb 1-7: reset high-speed USB device number 4 using xhci_hcd

[  220.121814] no MTRR for e0000000,3000000 found

[  505.063242] tracker-miner-a[8633]: segfault at ffffffff ip 00007fc55a72d560 sp 00007fffa0a03c70 error 4 in libglib-2.0.so.0.5800.3[7fc55a6fd000+82000]

[  505.063256] Code: 33 e8 14 ff ff ff 48 8b 5b 08 48 85 db 75 eb 48 8b 45 58 48 8b 58 18 48 85 db 74 2c 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 <48> 8b 33 48 8b 7d 20 e8 e4 fe ff ff 48 8b 5b 08 48 85 db 75 eb 48
```

[Moderator edit: added [code] tags to preserve output layout. -Hu]

----------

## dimko

LLVM 9 or above is required for this driver with 5.3-r6 kernel.

enabled SSHD, connected to black screened machine remotely and got that message when tried to start x as root.

emerging version 10 llvm

Also, while black screened, error messages from dmesg are gone.

black screen seems to be related to load of AMDGPU. i did ot save log, but from my limited understanding of english, it looks like amdgpu disabled vga console somehow.

i have nvme, but for less than a second I do see working console.

----------

## argil

Ok so yeah that package list worked. Something I should note is that nomodeset should NOT be set in the kernel params, but otherwise it wfm. Now I have to reinstall due to my hard drive failing and the backup I made not saving the perms. Oh well. musl or glibc?

EDIT: Reinstalled, mesa does not need opencl in order to get desktop. 

```
Portage 2.3.69 (python 3.6.5-final-0, default/linux/amd64/17.1/no-multilib, gcc-9.2.0, glibc-2.29-r2, 5.3.1-gentoo-x86_64 x86_64)

=================================================================

                         System Settings

=================================================================

System uname: Linux-5.3.1-gentoo-x86_64-x86_64-AMD_Ryzen_5_2600_Six-Core_Processor-with-gentoo-2.6

KiB Mem:    16412872 total,  14166028 free

KiB Swap:   59302928 total,  59302928 free

Timestamp of repository gentoo: Sun, 22 Sep 2019 20:30:01 +0000

Head commit of repository gentoo: c563fa5f8d2bbb80c3c11b9627cf7501f4b8237a

Timestamp of repository cg: Fri, 13 Sep 2019 19:43:42 +0000

Head commit of repository cg: ddf2e3445bb538ec3f9cbc5f17dee38932c5e9de

Timestamp of repository libressl: Fri, 13 Sep 2019 19:43:10 +0000

Head commit of repository libressl: 65477ff0668527d76bb3700ece6bc7aafe0f2631

Timestamp of repository lto-overlay: Sun, 15 Sep 2019 17:48:23 +0000

Head commit of repository lto-overlay: 1cab037d45d1ec6bdd034eb111b3ea163cf2812b

Timestamp of repository mv: Wed, 18 Sep 2019 21:45:43 +0000

Head commit of repository mv: 9c7826d953587a7c8377e565a5f7f08b1f392a49

Head commit of repository rocm: e0e77aa31bc33ddbd693b0b4b7a052f3552d8cea

sh bash 4.4_p23-r1

ld GNU ld (Gentoo 2.32 p2) 2.32.0

ccache version 3.7.2 [enabled]

app-shells/bash:          4.4_p23-r1::gentoo

dev-lang/perl:            5.28.2-r1::gentoo

dev-lang/python:          2.7.16-r102::lto-overlay, 3.6.5::gentoo, 3.7.4-r2::lto-overlay

dev-util/ccache:          3.7.2::gentoo

dev-util/cmake:           3.14.6::gentoo

sys-apps/baselayout:      2.6-r1::gentoo

sys-apps/openrc:          0.41.2::gentoo

sys-apps/sandbox:         2.13::gentoo

sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo

sys-devel/automake:       1.16.1-r1::gentoo

sys-devel/binutils:       2.32-r1::gentoo

sys-devel/gcc:            9.2.0::gentoo

sys-devel/gcc-config:     2.0::gentoo

sys-devel/libtool:        2.4.6-r3::gentoo

sys-devel/make:           4.2.1-r4::gentoo

sys-kernel/linux-headers: 4.19::gentoo (virtual/os-headers)

sys-libs/glibc:           2.29-r2::gentoo

Repositories:

gentoo

    location: /var/db/repos/gentoo

    sync-type: rsync

    sync-uri: rsync://rsync.gentoo.org/gentoo-portage

    priority: -1000

    sync-rsync-verify-metamanifest: yes

    sync-rsync-verify-jobs: 1

    sync-rsync-verify-max-age: 24

    sync-rsync-extra-opts: 

cg

    location: /var/db/repos/cg

    sync-type: git

    sync-uri: https://github.com/gentoo-mirror/cg.git

    masters: gentoo

libressl

    location: /var/db/repos/libressl

    sync-type: git

    sync-uri: https://github.com/gentoo-mirror/libressl.git

    masters: gentoo

lto-overlay

    location: /var/db/repos/lto-overlay

    sync-type: git

    sync-uri: https://github.com/gentoo-mirror/lto-overlay.git

    masters: gentoo mv

mv

    location: /var/db/repos/mv

    sync-type: git

    sync-uri: https://github.com/gentoo-mirror/mv.git

    masters: gentoo

rocm

    location: /var/db/repos/rocm

    sync-type: git

    sync-uri: https://github.com/justxi/rocm.git

    masters: gentoo

ACCEPT_KEYWORDS="amd64"

ACCEPT_LICENSE="@FREE"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-O2 -pipe -march=native -flto=12 -ftree-vectorize -ftree-loop-distribution -ftree-loop-distribute-patterns -floop-interchange"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /etc/conf.d/xdm /etc/default/grub /etc/locale.gen /usr/share/config /usr/share/gnupg/qualified.txt"

CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"

CXXFLAGS="-O2 -pipe -march=native -flto=12 -ftree-vectorize -ftree-loop-distribution -ftree-loop-distribute-patterns -floop-interchange"

DISTDIR="/var/cache/distfiles"

ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"

FCFLAGS="-O2 -pipe -march=native -flto=12 -ftree-vectorize -ftree-loop-distribution -ftree-loop-distribute-patterns -floop-interchange"

FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs ccache config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"

FFLAGS="-O2 -pipe -march=native -flto=12 -ftree-vectorize -ftree-loop-distribution -ftree-loop-distribute-patterns -floop-interchange"

GENTOO_MIRRORS="http://gentoo.mirrors.pair.com/ http://gentoo.osuosl.org/ http://mirror.sjc02.svwh.net/gentoo/ http://mirror.csclub.uwaterloo.ca/gentoo-distfiles/ http://mirrors.rit.edu/gentoo/"

LANG="en_US.utf8"

LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-flto -Wl,-O2"

MAKEOPTS="-j12"

PKGDIR="/var/cache/binpkgs"

PORTAGE_CONFIGROOT="/"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"

PORTAGE_TMPDIR="/var/tmp"

USE="X acl amd64 berkdb bzip2 cli crypt cxsparse cxx cycles dri elogind extra ffmpeg fortran fuse gdbm gif graphite gtk i3wm iconv icu ipv6 jemalloc jpeg jpeg2k lapack libressl libtirpc llvm lto lzma metis mp3 mtp ncurses network networkmanager nls nptl opencl openexr opengl openimageio openmp pam pcre pgo png printsupport pulseaudio python qt5 readline seccomp sparse split-usr ssl tbb tcpd threads tiff tools unicode vim-syntax vorbis x265 xattr zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" CURL_SSL="libressl" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6 python3_7" RUBY_TARGETS="ruby24 ruby25" USERLAND="GNU" VIDEO_CARDS="amdgpu radeonsi" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"

Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================

                        Package Settings

=================================================================

media-libs/mesa-19.2.0_rc4::gentoo was built with the following:

USE="X classic dri3 egl gallium gbm gles2 llvm -d3d9 -debug -gles1 (-libglvnd) -lm-sensors -opencl -osmesa -pax_kernel (-selinux) -test -unwind -vaapi -valgrind -vdpau -vulkan -vulkan-overlay -wayland -xa -xvmc" VIDEO_CARDS="radeonsi (-freedreno) -i915 -i965 -intel -iris (-lima) -nouveau (-panfrost) -r100 -r200 -r300 -r600 -radeon (-vc4) -virgl (-vivante) -vmware"

CFLAGS="-O2 -pipe -march=native -ftree-vectorize -ftree-loop-distribution -ftree-loop-distribute-patterns -floop-interchange -Wl,-O1 -Wl,--as-needed -Wl,-flto -Wl,-O2"

CXXFLAGS="-O2 -pipe -march=native -ftree-vectorize -ftree-loop-distribution -ftree-loop-distribute-patterns -floop-interchange -Wl,-O1 -Wl,--as-needed -Wl,-flto -Wl,-O2"

FEATURES="network-sandbox binpkg-logs assume-digests ipc-sandbox strict unknown-features-warn sandbox parallel-fetch unmerge-logs ccache usersync ebuild-locks distlocks binpkg-dostrip merge-sync config-protect-if-modified usersandbox multilib-strict news xattr protect-owned binpkg-docompress pid-sandbox sfperms userpriv userfetch fixlafiles preserve-libs unmerge-orphans"

```

 However, I would like opencl, the only reason I have disabled it here is that I know that mesa opencl is bad, blah blah blah. Do I use amdgpu-pro or rocm for opencl?

----------

## Ghoraab

Hey fellow gentooists,

thanks for the hints, without these I would not have managed to get my Sapphire RX 5700 up and running. Now everytings seems to work fine. For everybody else struggeling to get this card running:

My initial error was 

```
/dev/dri/card0 no such file or directory
```

and something like "could not start glamor" in the Xorg log. 

Right now I'm running only ~amd64 packages, there's no need to use external resources or 9999-builds anymore (at least since yesterday 23.11.19). I'm running gentoo-sources-5.3.12, llvm-9.0.0, mesa-19.3.0_rc4 and linux-firmware-20191108 and load the respective kernel modules as a module on startup, like proposed here. I did  the rest of the installation along these lines as well. 

make.conf USE flags and other stuff are

```
USE="X elogind -consolekit -systemd ogg vorbis pulseaudio dbus cups"

ACCEPT_LICENSE="no-source-code linux-fw-redistributable"

VIDEO_CARDS="amdgpu radeonsi"

INPUT_DEVICES="evdev"

```

Maybe this helps somebody.

Good luck on the path.

Ghoraab

----------

## tonkinet

I'm suffering from very frequent freezes since launch day on my 5700 XT. 

```
Portage 2.3.81 (python 3.6.9-final-0, default/linux/amd64/17.1/desktop, gcc-9.2.0, glibc-2.30-r3, 5.4.2-gentoo-x86_64 x86_64)                                        

=================================================================                 

System uname: Linux-5.4.2-gentoo-x86_64-x86_64-Intel-R-_Core-TM-_i9-9900K_CPU_@_3.60GHz-with-gentoo-2.6                                                              

KiB Mem:    49273620 total,  47655268 free                                        

KiB Swap:    2097148 total,   2097148 free                                        

Timestamp of repository gentoo: Sun, 08 Dec 2019 14:15:01 +0000                   

Head commit of repository gentoo: f4768f465acc530c2038bef926b394d45d717231        

Timestamp of repository alesharik: Sat, 07 Dec 2019 14:56:50 +0000                

Head commit of repository alesharik: 422c7a784103fb1dab55f3572fee399c69e58a4d     

                                                                                  

Timestamp of repository bleeding-edge: Sat, 07 Dec 2019 14:55:40 +0000            

Head commit of repository bleeding-edge: 915b8afe78b4672fde7a533c52e157e4329c2fb3 

                                         

Timestamp of repository rasdark: Sat, 07 Dec 2019 15:49:59 +0000

Head commit of repository rasdark: a469990d17a6c1d13aee17c66304b82a608a3467       

                                                                                  

Timestamp of repository steam-overlay: Sat, 07 Dec 2019 14:56:06 +0000            

Head commit of repository steam-overlay: 440b30f334f57b85d824f1c66407cc386b35b46c 

                                         

sh bash 5.0_p11                  

ld GNU ld (Gentoo 2.33.1 p1) 2.33.1

app-shells/bash:          5.0_p11::gentoo                                         

dev-java/java-config:     2.2.0-r4::gentoo                                        

dev-lang/perl:            5.30.1::gentoo

dev-lang/python:          2.7.17::gentoo, 3.6.9::gentoo, 3.7.5-r1::gentoo         

dev-util/cmake:           3.16.0::gentoo                                          

sys-apps/baselayout:      2.6-r1::gentoo

sys-apps/openrc:          0.42.1::gentoo 

sys-apps/sandbox:         2.18::gentoo

sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo

sys-devel/automake:       1.16.1-r2::gentoo                                       

sys-devel/binutils:       2.33.1::gentoo                                          

sys-devel/gcc:            9.2.0-r2::gentoo                                        

sys-devel/gcc-config:     2.1::gentoo    

sys-devel/libtool:        2.4.6-r5::gentoo                                        

sys-devel/make:           4.2.1-r4::gentoo                                                                                                                           

sys-kernel/linux-headers: 5.3-r1::gentoo (virtual/os-headers)                     

sys-libs/glibc:           2.30-r3::gentoo                                         

Repositories:              

                                                                                  

gentoo                                                                                                                                                                   location: /var/db/repos/gentoo

    sync-type: rsync              

    sync-uri: rsync://rsync.us.gentoo.org/gentoo-portage/                         

    priority: -1000                                                                                                                                                      sync-rsync-verify-max-age: 24

    sync-rsync-verify-jobs: 1    

    sync-rsync-verify-metamanifest: yes                                                                                                                                  sync-rsync-extra-opts:                                                                                                                                                                                    

alesharik                       

    location: /var/db/repos/alesharik                                                                                                                                

    sync-type: git

    sync-uri: https://github.com/gentoo-mirror/alesharik.git                      

    masters: gentoo              

                                         

bleeding-edge              

    location: /var/db/repos/bleeding-edge                                         

    sync-type: git                                                                                                                                                       sync-uri: https://github.com/gentoo-mirror/bleeding-edge.git           

    masters: gentoo      

                                                                                                                                                                     

orion                                                                                                                                                                

    location: /var/db/repos/orion                                                                                                                                        masters: gentoo                                                                                                                                                                                                                                                                                                                       rasdark                                                                                                                                                                  location: /var/db/repos/rasdark                                                                                                                                  

    sync-type: git                                                                                                                                                       sync-uri: https://github.com/gentoo-mirror/rasdark.git                                                                                                           

    masters: gentoo                                                                                                                                                                                                                                                                                                                       steam-overlay                                                                                                                                                            location: /var/db/repos/steam-overlay                                                                                                                                sync-type: git                                                                                                                                                       sync-uri: https://github.com/gentoo-mirror/steam-overlay.git                                                                                                     

    masters: gentoo

ACCEPT_KEYWORDS="amd64 ~amd64"           

ACCEPT_LICENSE="@FREE linux-fw-redistributable no-source-code intel-ucode AMD-GPU-PRO-EULA ValveSteamLicense"                                                        

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-march=native -O2 -pipe"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"

CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/ter

minfo"

CXXFLAGS="-march=native -O2 -pipe"

DISTDIR="/var/cache/distfiles"

ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_H

OME XDG_RUNTIME_DIR"

FCFLAGS="-march=native -O2 -pipe"

FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-st

rict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch 

userpriv usersandbox usersync xattr"

FFLAGS="-march=native -O2 -pipe"

GENTOO_MIRRORS="http://gentoo.osuosl.org/ http://mirror.leaseweb.com/gentoo/ https://mirrors.evowise.com/gentoo/"

LANG="en_US.utf8"

LC_ALL="en_US.UTF-8"

LDFLAGS="-Wl,-O1 -Wl,--as-needed"

MAKEOPTS="-j16"

PKGDIR="/var/cache/binpkgs"

PORTAGE_CONFIGROOT="/"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180

 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"

PORTAGE_TMPDIR="/var/tmp"

USE="X a52 aac acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo cli consolekit crypt cryptsetup cxx dbus dri dts emboss encode exif fam flac fortran gdbm gi

f gpm gtk iconv icu ipv6 jpeg jpeg2k lcms libnotify libtirpc lto mad mng mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp pam pango pcre pdf pgo png policyki

t ppds pulseaudio python readline sdl seccomp spell split-usr sqlite ssl svg tcpd threads tiff truetype udev unicode upower usb v4l vaapi vdpau vorbis vulkan wxwidge

ts x264 xattr xcb xft xml xv xvid zlib zsh-completion" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k

1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core s

ocache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner 

authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cac

he mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df 

interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmint

xt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" I

NPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="pre

senter-console presenter-minimizer" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websv

ccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="pytho

n2_7 python3_6" RUBY_TARGETS="ruby24 ruby25" USERLAND="GNU" VIDEO_CARDS="amdgpu radeonsi intel i965" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipse

t ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"

Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, P

ORTAGE_RSYNC_EXTRA_OPTS
```

I get freezes from just using firefox alone.

Any ideas what might be wrong with my setup? I haven't tried Archlinux or Windows to see if those also freeze to single out a hardware fault.[/code]

----------

## loki_val

There' s a patch attached to this bug. It's known to fix a number of hangs.

This patch for llvm-9 also fixes a hang.

Otherwise, there are a number of hangs fixed in Mesa-20-git which requires unmasking llvm-10-git.

I'm rock stable in day-to-day use with the following packages -9999 plus the kernel patch above:

```
llvm

llvm-common

llvmgold

mesa
```

If you want a better diagnosis of your hangs, start with making sure to use Magic SYSRQ (ALT+PRTSC + R,E,I,S,U,B ) to reboot so you have some log of the kernel error message.

----------

## tonkinet

The particular crash I get every 30-60 mins seems to be:

```
[ 4906.193673] [drm:amdgpu_dm_commit_planes.constprop.0] *ERROR* Waiting for fences timed out!

[ 4910.801663] [drm:amdgpu_job_timedout] *ERROR* ring gfx_0.0.0 timeout, signaled seq=182778, emitted seq=182780

[ 4910.801670] [drm:amdgpu_job_timedout] *ERROR* Process information: process X pid 18901 thread X:cs0 pid 18903

[ 4910.801673] [drm] GPU recovery disabled.
```

I do have llvm + mesa-git unmasked. I'll try the patch you mentioned tonight. Thanks!

----------

## siodor

Here's my story.

I'm having this card https://www.msi.com/Graphics-card/Radeon-RX-5700-XT-GAMING-X

I first tried it with the following package.keywords:

```

=sys-devel/llvm-9.0.0 ~amd64

=sys-devel/llvm-common-9.0.0 ~amd64

=media-libs/mesa-19.3.0_rc6 ~amd64

=sys-devel/clang-9.0.0 ~amd64

=sys-devel/clang-common-9.0.0 ~amd64

=sys-devel/clang-runtime-9.0.0 ~amd64

=sys-libs/compiler-rt-9.0.0-r1 ~amd64

=sys-libs/compiler-rt-sanitizers-9.0.0 ~amd64

=sys-libs/libomp-9.0.0 ~amd64

=app-misc/radeontop-1.2 ~amd64

=sys-kernel/gentoo-sources-5.3.15 ~amd64

```

But no luck.

During boot at the following stage the screen turned purple:

```
 fb0: switching to amdgpudrmfb from EFI VGA
```

Only way to continue was through SSH which I used to start xdm (/etc/init.d/xdm start) but this only made things weirder because the screen turned blue (don't remember if it was during X start or after I've tried to kill it which resulted in OpenRC failing to stop it and dmesg gave a Call trace)

After posting my issue on FreeNode in #radeon I got from the user Venemo the suggestion to try with a 5.4 kernel because he saw some weird issues with his RX 5700 XT too, so I added to my package.keywords the following:

```
=sys-kernel/gentoo-sources-5.4.2 ~amd64
```

After rebooting I suddenly got a proper framebuffer (all the text changed to tiny on my 4K screen) and yay! finally xdm worked too  :Smile: 

----------

## siodor

Further, the user Venemo said that there's some critical hang problem with certain games (eg. Rise of the Tomb Raider) which can lock up the GPU with LLVM 9.0.0 but LLVM 9.0.1 should fix this so I've upgraded to LLVM 9.0.1_rc2 by adding the following to my accept.keywords:

```

=sys-devel/llvm-9.0.1_rc2 ~amd64

=sys-devel/llvm-common-9.0.1_rc2 ~amd64

=sys-devel/clang-9.0.1_rc2 ~amd64

=sys-devel/clang-common-9.0.1_rc2 ~amd64

=sys-devel/clang-runtime-9.0.1_rc2 ~amd64

=sys-libs/compiler-rt-9.0.1_rc2 ~amd64

=sys-libs/compiler-rt-sanitizers-9.0.1_rc2 ~amd64

=sys-libs/libomp-9.0.1_rc2 ~amd64

```

----------

## Banana

I can add this card to the working list: https://www.sapphiretech.com/en/consumer/pulse-radeon-rx-5700-8g-gddr6

I had to set the following

```
sys-kernel/gentoo-sources ~amd64

>=sys-devel/llvm-9.0.1 ~amd64

>=sys-devel/llvm-common-9.0.0 ~amd64

>=media-libs/mesa-19.3.0 ~amd64

>=sys-devel/clang-9.0.0 ~amd64

>=sys-devel/clang-common-9.0.0 ~amd64

```

Other packages are not installed currently.

----------

## davydm

I have one of these: https://www.xfxforce.com/gpus/radeon-tm-rx-5700-dd-ultra-8gb-gddr6

I have these accept_keywords, but X crashes at startup with:

```

X.Org X Server 1.20.6

X Protocol Version 11, Revision 0

Build Operating System: Linux 5.4.6-gentoo-x86_64 x86_64 Gentoo

Current Operating System: Linux nea.local 5.4.11-gentoo-x86_64 #4 SMP Sat Jan 18 07:53:10 SAST 2020 x86_64

Kernel command line: BOOT_IMAGE=/vmlinuz-5.4.11-gentoo-x86_64 root=UUID=f6c68918-a995-4054-8a6e-a6fe7a780543 ro scsi_mod.use_blk_mq=1

Build Date: 06 January 2020  08:53:24AM

 

Current version of pixman: 0.38.4

   Before reporting problems, check http://wiki.x.org

   to make sure that you have the latest version.

Markers: (--) probed, (**) from config file, (==) default setting,

   (++) from command line, (!!) notice, (II) informational,

   (WW) warning, (EE) error, (NI) not implemented, (??) unknown.

(==) Log file: "/var/log/Xorg.0.log", Time: Sat Jan 18 08:57:26 2020

(==) Using config directory: "/etc/X11/xorg.conf.d"

(==) Using system config directory "/usr/share/X11/xorg.conf.d"

(II) AMDGPU(0): [KMS] Kernel modesetting enabled.

X: /usr/include/xorg/privates.h:121: dixGetPrivateAddr: Assertion `key->initialized' failed.

(EE)

(EE) Backtrace:

(EE) 0: /usr/bin/X (xorg_backtrace+0x4d) [0x5598724e28ed]

(EE) 1: /usr/bin/X (0x55987233d000+0x1a95b8) [0x5598724e65b8]

(EE) 2: /lib64/libpthread.so.0 (0x7f1c9613c000+0x14590) [0x7f1c96150590]

(EE) 3: /lib64/libc.so.6 (gsignal+0x141) [0x7f1c95fa6df1]

(EE) 4: /lib64/libc.so.6 (abort+0x121) [0x7f1c95f90535]

(EE) 5: /lib64/libc.so.6 (0x7f1c95f6e000+0x2240f) [0x7f1c95f9040f]

(EE) 6: /lib64/libc.so.6 (0x7f1c95f6e000+0x30862) [0x7f1c95f9e862]

(EE) 7: /usr/lib64/xorg/modules/drivers/amdgpu_drv.so (0x7f1c95afa000+0x8fd3) [0x7f1c95b02fd3]

(EE) 8: /usr/lib64/xorg/modules/drivers/amdgpu_drv.so (0x7f1c95afa000+0x931e) [0x7f1c95b0331e]

(EE) 9: /usr/lib64/xorg/modules/drivers/amdgpu_drv.so (0x7f1c95afa000+0x183f5) [0x7f1c95b123f5]

(EE) 10: /usr/lib64/xorg/modules/drivers/amdgpu_drv.so (0x7f1c95afa000+0x1a22b) [0x7f1c95b1422b]

(EE) 11: /usr/bin/X (MapWindow+0x204) [0x5598723bdf54]

(EE) 12: /usr/bin/X (0x55987233d000+0x5a1f5) [0x5598723971f5]

(EE) 13: /lib64/libc.so.6 (__libc_start_main+0xeb) [0x7f1c95f91f2b]

(EE) 14: /usr/bin/X (_start+0x2a) [0x5598723810aa]

(EE)

(EE)

Fatal server error:

(EE) Caught signal 6 (Aborted). Server aborting

(EE)

(EE)

Please consult the The X.Org Foundation support

    at http://wiki.x.org

 for help.

(EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.

(EE)

(EE) Server terminated with error (1). Closing log file.

xinit: giving up

xinit: unable to connect to X server: Connection refused

xinit: unexpected signal 2 

```

Now, I've noticed that I have llvm:8 as well as llvm:9 -- not being an expert on slotting, could this cause a problem, since there's a common thread to have clang & llvm 9? Is there any way to tell what was used to build? I do see:

```

/usr/libexec/gcc/x86_64-pc-linux-gnu/9.2.0/cc1

```

running at merge time for mesa, though equery says that comes from sys-devel/gcc, so again, I have to wonder if I'm just doing something wrong here ): if I specifically unmerge llvm:8 and clang:8 and then emerge with --new-use --changed-use --update --deep @world, the packages come back, but equery d shows no dependencies on those specific slots.

The amdgpu kernel module appears to load fine (no errors in /var/log/messages) -- its' just that X won't start up. This card works fine under Windows on the same machine, so at least I'm quite sure it's not a hardware fault. 

Any assistance greatly appreciated. I'm really quite stuck here )':

----------

## lperkins2

So I just got this set up today, I treat the 5700XT as a headless card, but that *probably* won't change things (other than that I had a graphical shell for fiddling, since the other GPU was happy).  

You've identified the problem, probably (need mesa built with clang:9 or later, using gcc).  To use clang, you need to have the llvm USE flag enabled for mesa.  To make sure you're using clang:9, you can check in the build log which compiler is found.  If you don't need clang:8 for anything, you *could* remove it.  As a stop-gap measure, you can also set CC=$path_to_clang9 CXX=$path_to_clang9++ and then emerge mesa, it should make it use the right clang version for you.

That said, your error message is different than mine was, since mine only came up when trying to run vulkaninfo or similar (as the card is unused until that point).  If getting mesa built with clang:9 doesn't fix it, let us know.

----------

## davydm

Thanks for the reply

`equery u mesa` does show that I have the llvm flag set, even though I'm not entirely sure where it's being set from (my /etc/portage/package.use/mesa file only mentions d3d9 and opencl. My machine originally had an nvidia 660ti in it, which I've had to put back for the moment because I can't do much without X, so my VIDEO_CARDS value in make.conf is set to "nvidia radeonsi amdgpu" so that I can swap between cards.

Also attempting an emerge -1 mesa, I do see the following in the output:

```

        llvm:            yes

        llvm-version:    9.0.1

```

So I guess that at least answers my original question, though now I'm once again back at just not knowing what the problem is. I'm open for any other suggestions or ideas and really appreciate the help.

----------

## bulkin

davydm, it looks like you didn't change the opengl library used from nvidia. Run 

```
eselect opengl set xorg-x11
```

 and everything should work.

----------

## davydm

zomg, that's rather silly of me. I'll try re-adding the card tonight to try that out, but I'm dead-sure that's my problem (or at least one of them). Thanks!

----------

## davydm

Ok, cool, I just needed:

1. make.conf => INPUT_DEVICES="${INPUT_DEVICES} evdev"

2. eselect opengl set xorg-x11

So now I'm on to the next problem -- before this, I was playing quite a few game via steam-play / proton (but some that I wanted to play were a little too much for my 660ti to deal with, hence the upgrade). Most of them b0rk now, and it looks like the problem is related to vulkan

https://wiki.gentoo.org/wiki/Vulkan#Driver_Support suggests that amdgpu should have support "via radv", but doesn't elaborate and my google-fu isn't getting me very far.

Allegedly the closed-source drivers have vulkan support, but https://wiki.gentoo.org/wiki/AMDGPU-PRO isn't all that helpful with going that route.

Has anyone else had joy with vulkan?

----------

## davydm

btw, I'm also not sure if this issue is just an artifact of still having NVIDIA stuff lying around, as vulkaninfo reports:

```

ERROR: [Loader Message] Code 0 : libGLX_nvidia.so.0: cannot open shared object file: No such file or directory

Cannot create Vulkan instance.

This problem is often caused by a faulty installation of the Vulkan driver or attempting to use a GPU that does not support Vulkan.

/var/tmp/portage/dev-util/vulkan-tools-1.1.124/work/Vulkan-Tools-119e7c3bbae122f6cc5d778d068fb91e0e85d6a9/vulkaninfo/vulkaninfo.h:291: failed with ERROR_INCOMPATIBLE_DRIVER

```

I've removed "nvidia" from my VIDEO_CARDS config & am busy emerging @world with --newuse --change-use --deep --changed-deps --update. Perhaps that will help -- but I'll only find out tomorrow as this is going to take a while and it's time for zZzZz. Thanks again for all assistance here -- it's been greatly appreciated.

----------

## NeddySeagoon

davydm,

 *Quote:*   

> So now I'm on to the next problem -- 

 

Gentoo does not have problems, only learning opportunities. :)

Its just a matter of perspective.

The nvidia junk just lying around is harmless. Attempting to use it is not.

What does 

```
eselect opengl list
```

tell?

nvidia is the wrong answer.

----------

## bulkin

Mesa should be built with vulkan support, then vulkan-loader should succeed in finding radv.

```

bulkin@bc:~$ vulkaninfo 

ERROR: [Loader Message] Code 0 : libGLX_nvidia.so.0: cannot open shared object file: No such file or directory

ERROR: [Loader Message] Code 0 : /usr/lib32/libvulkan_radeon.so: wrong ELF class: ELFCLASS32

WARNING: radv is not a conformant vulkan implementation, testing use only.

```

----------

## davydm

Before completing a cleanup of nvidia drivers, I had this:

```

$ eselect opengl list

Available OpenGL implementations:

  [1]   nvidia

  [2]   xorg-x11 *

```

(ie, correct opengl selected); however vulkaninfo kept trying to use libGLX from nvidia. So having done

```

emerge --depclean nv-codec-headers nvidia-drivers

```

(nv-codec-headers was pulling in nvidia drivers), I now have an nvidia-free system and vulkaninfo errors with:

```

$ vulkaninfo 

Cannot create Vulkan instance.

This problem is often caused by a faulty installation of the Vulkan driver or attempting to use a GPU that does not support Vulkan.

/var/tmp/portage/dev-util/vulkan-tools-1.1.124/work/Vulkan-Tools-119e7c3bbae122f6cc5d778d068fb91e0e85d6a9/vulkaninfo/vulkaninfo.h:291: failed with ERROR_INCOMPATIBLE_DRIVER

```

naturally, there's only one opengl implementation now, and it's selected:

```

$ eselect opengl list

Available OpenGL implementations:

  [1]   xorg-x11 *

```

The problem now isn't opengl -- native opengl games (eg quake3) are working fine, high framerate and glxinfo reports (amongst a lot of other data):

```

Extended renderer info (GLX_MESA_query_renderer):

    Vendor: X.Org (0x1002)

    Device: AMD NAVI10 (DRM 3.35.0, 5.4.13-gentoo-x86_64, LLVM 9.0.1) (0x731f)

    Version: 19.3.2

    Accelerated: yes

    Video memory: 8192MB

    Unified memory: no

    Preferred profile: core (0x1)

    Max core profile version: 4.5

    Max compat profile version: 4.5

    Max GLES1 profile version: 1.1

    Max GLES[23] profile version: 3.2

```

My current challenge is to get vulkan working since the proton compatibility tool (and other native games like Rise Of The Tomb Raider) depends on it. Searching a bit more after last night, it seems that "radv" is the radeonsi vulkan implementation that should be in mesa, and I've seen a report at Phoronix of mesa 20.0 outperforming the closed-source amdgpu-pro driver in recent vulkan testing (https://www.phoronix.com/scan.php?page=article&item=mesa20radv-aco-amdvlk&num=1). I don't see a release for version 20 of mesa, even at GitHub (https://github.com/mesa3d/mesa/releases): latest there is 19.3.2 -- same version I currently have installed, so this is leading me to believe that either I should wait for 20.0 to drop or give mesa-9999 a go. I'd really appreciate input on this -- I'm not sure if I'm on the right track, really, mostly guessing.

----------

## davydm

Thanks for all the help, everyone. I haven't been sleeping properly for the last few weeks and it shows. I could have sworn I read the use flags for mesa many many times without spotting:

```

vulkan               : Enable Vulkan drivers

```

setting that on, rebuilding mesa & rebooting to ensure it's correctly loaded and vulkaninfo is happy with me:

```

Vulkan Instance Version: 1.1.125

```

and Hellblade starts up fine.

Thanks again for all the help.

----------

