# [SOLVED] Problems with amdgpu

## prestige787

I'm in the process of installing gentoo, or rather, have already installed it but am having some issues with getting a display output. FWIW I'm using a 6800xt. I'm trying to make a custom kernel, this is the first time I'm doing this, but I did spend many hours trying to understand how the process works. My first attempt at compiling the kernel failed, and I don't know why. I'm not sure if there is any way I can attach my .config. I was trying to compile it without initramfs, and with amdgpu built in rather than as a module. I therefore followed the instructions on the amdgpu page of the gentoo wiki to include the firmware in the kernel, using kernel blobs. I believe this is what causes the crash, I got the following error shortly after 'make -j24' : 

```
make: *** [makefile:1851: drivers] Error 2 amdgpu
```

 I then used that same config, but deleted the .bin stuff from the firmware blobs, enabled initramfs and changed amdgpu to M. This compiled with no issues, but gets me to a black screen. The system appears to work, however, as if i login (blindly), I can for example successfully reboot, so I believe the only issue is with the graphics. If anyone has any suggestions, or even some documentation I could read up on, it would be much appreciated.Last edited by prestige787 on Sun Sep 19, 2021 7:58 pm; edited 1 time in total

----------

## mike155

Hi prestige787,

welcome to the Gentoo forums!

Please post the output of "emerge --info" and your kernel config.

You could install and use wgetpaste to post large files.

Mike

----------

## prestige787

Thank you! 

Here is the output of emerge --info: http://dpaste.com/4Y4RRUUUS (with chroot)

And the .config: http://dpaste.com/CUYNKMTS3 (this is the one that wont compile)

----------

## mike155

Thanks for the files.

You used "make -j 24" to compile the kernel. That's much faster than "make". But if something goes wrong, you won't see the full error message.

If "make -j24" aborts with an error, run "make -j1" afterwards to get the full error message. 

In your case, the full error message is:

```
make[4]: *** No rule to make target '/lib/firmware/amdgpu/sienna-cichlid_ce.bin', needed by 'drivers/base/firmware_loader/builtin/amdgpu/sienna-cichlid_ce.bin.gen.o'.  Stop.

make[3]: *** [scripts/Makefile.build:514: drivers/base/firmware_loader/builtin] Error 2

make[2]: *** [scripts/Makefile.build:514: drivers/base/firmware_loader] Error 2

make[1]: *** [scripts/Makefile.build:514: drivers/base] Error 2

make: *** [Makefile:1858: drivers] Error 2
```

The AMDGPU Wiki page recommends to use the firmware files below:

```
echo amdgpu/sienna_cichlid_{ce,dmcub,me,mec2,mec,pfp,rlc,sdma,smc,sos,ta,vcn}.bin
```

which expands to:

```
amdgpu/sienna_cichlid_ce.bin amdgpu/sienna_cichlid_dmcub.bin amdgpu/sienna_cichlid_me.bin amdgpu/sienna_cichlid_mec2.bin amdgpu/sienna_cichlid_mec.bin amdgpu/sienna_cichlid_pfp.bin amdgpu/sienna_cichlid_rlc.bin amdgpu/sienna_cichlid_sdma.bin amdgpu/sienna_cichlid_smc.bin amdgpu/sienna_cichlid_sos.bin amdgpu/sienna_cichlid_ta.bin amdgpu/sienna_cichlid_vcn.bin
```

In your kernel config, CONFIG_EXTRA_FIRMWARE looks similar. But there are typos. You used "sienna-cichlid" instead of "sienna_cichlid" (hyphen instead of underscore). You also added "amdgpu/sienna-cichlid_k_smc.bin", which is not in the list above.

Correct the firmware filenames in CONFIG_EXTRA_FIRMWARE. Run "echo amdgpu/sienna_cichlid_{ce,dmcub,me,mec2,mec,pfp,rlc,sdma,smc,sos,ta,vcn}.bin" in a shell window and Copy&Paste the result to that variable.

----------

## mike155

There's a number of issues in your kernel config.

Enable IRQ_REMAP. 

Enable options shown at https://wiki.gentoo.org/wiki/Ryzen#Kernel.

You may want to switch to CONFIG_NO_HZ_IDLE.

----------

## prestige787

Ok, so I made all of the changes you recommended. The kernel now compile fine, but unfortunately I still get a black screen after the 'loading linux' prompt from grub. Here is the new .config: http://dpaste.com/3FLHNRG2X

I might try to just go through every single option again, though I'm not sure if anything else beyond the basic amdgpu settings could cause a black screen.

----------

## mike155

Please post the output of 'dmesg'.   :Smile: 

----------

## prestige787

Ok, so I logged in as root blindly and got the dmesg: https://pastebin.com/c0rwMx0Q

I think the two lines of interest are:

platform regulatory.0: Direct firmware load for regulatory.db failed with error -2

and

cfg80211: failed to load regulatory.db

I'm wondering if maybe I should try this same .config on a fresh install. since I did generate an initramfs for the original kernel. Not sure if that could have anything to do with it though.

----------

## Hu

Those two messages are both wifi related.  Your wireless may not work properly until they are fixed, but you should be able to get a working display without fixing those.

----------

## mike155

 *Quote:*   

> Ok, so I logged in as root blindly and got the dmesg: https://pastebin.com/c0rwMx0Q

 

Great!   :Smile: 

```
platform regulatory.0: Direct firmware load for regulatory.db failed with error -2

cfg80211: failed to load regulatory.db 
```

That's related to WIFI...

dmesg shows that the amdgpu driver loads the firmware and that initialization works now:

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

[    1.826069] amdgpu: Ignoring ACPI CRAT on non-APU system

[    1.826071] amdgpu: Virtual CRAT table created for CPU

[    1.826076] amdgpu: Topology: Add CPU node

[    1.826096] amdgpu 0000:0e:00.0: vgaarb: deactivate vga console

[    1.826111] amdgpu 0000:0e:00.0: enabling device (0006 -> 0007)

[    1.826129] amdgpu 0000:0e:00.0: amdgpu: Trusted Memory Zone (TMZ) feature not supported

[    1.828105] amdgpu 0000:0e:00.0: amdgpu: Fetched VBIOS from VFCT

[    1.828107] amdgpu: ATOM BIOS: 113-V395TRIO-1OC

[    1.828131] amdgpu 0000:0e:00.0: amdgpu: MEM ECC is not presented.

[    1.828132] amdgpu 0000:0e:00.0: amdgpu: SRAM ECC is not presented.

[    1.828142] amdgpu 0000:0e:00.0: amdgpu: VRAM: 16368M 0x0000008000000000 - 0x00000083FEFFFFFF (16368M used)

[    1.828143] amdgpu 0000:0e:00.0: amdgpu: GART: 512M 0x0000000000000000 - 0x000000001FFFFFFF

[    1.828145] amdgpu 0000:0e:00.0: amdgpu: AGP: 267894784M 0x0000008400000000 - 0x0000FFFFFFFFFFFF

[    1.828176] [drm] amdgpu: 16368M of VRAM memory ready

[    1.828177] [drm] amdgpu: 16368M of GTT memory ready.

[    1.828470] Loading firmware: amdgpu/sienna_cichlid_sos.bin

[    1.828472] Loading firmware: amdgpu/sienna_cichlid_ta.bin

[    1.828475] amdgpu 0000:0e:00.0: amdgpu: PSP runtime database doesn't exist

[    4.221956] Loading firmware: amdgpu/sienna_cichlid_smc.bin

[    4.221988] Loading firmware: amdgpu/sienna_cichlid_dmcub.bin

[    4.221993] Loading firmware: amdgpu/sienna_cichlid_pfp.bin

[    4.221994] Loading firmware: amdgpu/sienna_cichlid_me.bin

[    4.221995] Loading firmware: amdgpu/sienna_cichlid_ce.bin

[    4.221997] Loading firmware: amdgpu/sienna_cichlid_rlc.bin

[    4.221998] Loading firmware: amdgpu/sienna_cichlid_mec.bin

[    4.221999] Loading firmware: amdgpu/sienna_cichlid_mec2.bin

[    4.222571] Loading firmware: amdgpu/sienna_cichlid_sdma.bin

[    4.222681] Loading firmware: amdgpu/sienna_cichlid_vcn.bin

[    4.534117] amdgpu 0000:0e:00.0: amdgpu: SECUREDISPLAY: securedisplay ta ucode is not available

[    4.534140] amdgpu 0000:0e:00.0: amdgpu: smu driver if version = 0x0000003d, smu fw if version = 0x00000040, smu fw version = 0x003a4700 (58.71.0)

[    4.534143] amdgpu 0000:0e:00.0: amdgpu: SMU driver if version not matched

[    4.534147] amdgpu 0000:0e:00.0: amdgpu: use vbios provided pptable

[    4.605551] amdgpu 0000:0e:00.0: amdgpu: SMU is initialized successfully!

[    5.034422] kfd kfd: amdgpu: Allocated 3969056 bytes on gart

[    5.049331] amdgpu: HMM registered 16368MB device memory

[    5.049390] amdgpu: SRAT table not found

[    5.049391] amdgpu: Virtual CRAT table created for GPU

[    5.049487] amdgpu: Topology: Add dGPU node [0x73bf:0x1002]

[    5.049490] kfd kfd: amdgpu: added device 1002:73bf

[    5.049492] amdgpu 0000:0e:00.0: amdgpu: SE 4, SH per SE 2, CU per SH 10, active_cu_number 72

[    5.053603] amdgpu 0000:0e:00.0: [drm] fb0: amdgpu frame buffer device

[    5.053660] amdgpu 0000:0e:00.0: amdgpu: ring gfx_0.0.0 uses VM inv eng 0 on hub 0

...

[    5.054850] amdgpu 0000:0e:00.0: amdgpu: Using BACO for runtime pm

[    5.054947] [drm] Initialized amdgpu 3.42.0 20150101 for 0000:0e:00.0 on minor 0
```

We are close! Give me a few minutes to think about it.

----------

## mike155

prestige787, 

enable CONFIG_FRAMEBUFFER_CONSOLE  

no wonder that you can't see anything  :Very Happy: 

----------

## prestige787

Awesome, it works now! Thank you very much for your help!

----------

