Mailing List Archive

need help with amdgpu driver
I have a ryzen-7900X cpu but I cannot get the amdgpu driver up and
running with my kernel 6.1.8 (uefi system)


These are the errors dmesg shows:

[ 0.668913] [drm] amdgpu: 512M of VRAM memory ready
[ 0.668915] [drm] amdgpu: 31783M of GTT memory ready.
[ 0.669819] amdgpu 0000:0d:00.0: Direct firmware load for
amdgpu/psp_13_0_5_ta.bin failed with error -2
[ 0.669823] amdgpu 0000:0d:00.0: amdgpu: fail to initialize ta microcode
[ 0.669828] [drm:amdgpu_device_init.cold] *ERROR* sw_init of IP block
<psp> failed -2
[ 0.669831] amdgpu 0000:0d:00.0: amdgpu: amdgpu_device_ip_init failed
[ 0.669833] amdgpu 0000:0d:00.0: amdgpu: Fatal error during GPU init
[ 0.669834] amdgpu 0000:0d:00.0: amdgpu: amdgpu: finishing device.
[ 0.670042] amdgpu: probe of 0000:0d:00.0 failed with error -2
[ 0.670046] amdgpu 0000:0d:00.0: devm_attr_group_remove: removing
group (____ptrval____)
[ 0.670052] [drm] amdgpu: ttm finalized
[ 0.907335] bus: 'pci': add driver pcie_mp2_amd
[ 0.907411] bus: 'platform': add driver amd_pmc
[ 1.007964] amd_hsmp: HSMP is not supported on Fam:19 model:61
[ 1.007967] amd_hsmp: Or Is HSMP disabled in BIOS ?
[ 1.007968] bus: 'platform': add driver amd-pmf


This is my .config
#
# Firmware loader
#
CONFIG_FW_LOADER=y
CONFIG_FW_LOADER_PAGED_BUF=y
CONFIG_FW_LOADER_SYSFS=y
CONFIG_EXTRA_FIRMWARE="amd-ucode/microcode_amd_fam19h.bin
amdgpu/psp_13_0_5_toc.bin"
CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware"
CONFIG_FW_LOADER_USER_HELPER=y
# CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
CONFIG_FW_LOADER_COMPRESS=y
CONFIG_FW_LOADER_COMPRESS_XZ=y
CONFIG_FW_LOADER_COMPRESS_ZSTD=y
# CONFIG_FW_UPLOAD is not set
# end of Firmware loader


I do not even get a console because of amdgpu gets not loaded.

But I can log into the system via ssh because the system is
a copy of my well running mbr system.

My questions are:

What firmware blobs of linux-firmware has to be installed to support
the gpu of a ryzen-7900X?
CONFIG_EXTRA_FIRMWARE=?

I do not use initrd nor initramfs and all neccessary drivers
are not installed as modules but compiled into the kernel.

I it possible that a that moment the kernel cannot get blobs
because the ext4 filesystem is not mounted already?
So does one have to use initrd to get the blobs loaded?

What is the meaning of "failed with error -2"?


--
regards Klaus
Re: need help with amdgpu driver [ In reply to ]
Hello Klaus,

have you made your kernel again after changing EXTRA_FIRMWARE ?

Maybe you want read this:

https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/
Manual_kernel_configuration#Driver_needs_Firmware

Greetings,
Peter

Am Freitag, 27. Januar 2023, 11:08:58 CET schrieb Klaus Dittrich:
> I it possible that a that moment the kernel cannot get blobs
> because the ext4 filesystem is not mounted already?
> So does one have to use initrd to get the blobs loaded?
>
> What is the meaning of "failed with error -2"?
Re: need help with amdgpu driver [ In reply to ]
On 27.01.23 12:17, Peter Böhm wrote:
> Hello Klaus,
>
> have you made your kernel again after changing EXTRA_FIRMWARE ?
>
> Maybe you want read this:
>
> https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/
> Manual_kernel_configuration#Driver_needs_Firmware
>
> Greetings,
> Peter
>
> Am Freitag, 27. Januar 2023, 11:08:58 CET schrieb Klaus Dittrich:
>> I it possible that a that moment the kernel cannot get blobs
>> because the ext4 filesystem is not mounted already?
>> So does one have to use initrd to get the blobs loaded?
>>
>> What is the meaning of "failed with error -2"?
>
>
>
>
>
Peter,
thanks for your answer.

Sure, the machine is fast so a recompilation of the kernel is no
problem.

The error happens with and without "amdgpu/psp_13_0_5_ta.bin" in
CONFIG_EXTRA_FIRMWARE as I discoverd meanwqhile.

--
Regards Klaus
Re: need help with amdgpu driver [ In reply to ]
Hello Klaus,

Klaus Dittrich <kladit@t-online.de> writes:

>
> The error happens with and without "amdgpu/psp_13_0_5_ta.bin" in
> CONFIG_EXTRA_FIRMWARE as I discoverd meanwqhile.

Your issue is most likely that you are missing firmware in the
CONFIG_EXTRA_FIRMWARE setting. In my case there at 10 firmware blobs
that I need in the kernel.

Have you read the AMDGPU page on the Gentoo Wiki? Particularly the part
about incorporating firmware blobs in the kernel?
https://wiki.gentoo.org/wiki/Amdgpu#Unknown_firmware_blobs

What I suggest is you change the AMDGPU driver back to a module rather
than built it, and reboot once. Check DMESG (as explain in the link
above) and it will show you every firmware that is loaded during boot.
What that information you can update your CONFIG_EXTRA_FIRMWARE
parameter with the proper values and put the AMDGPU driver back to built-in.

--
Regards,
Julien
Re: need help with amdgpu driver [ In reply to ]
Hi Klaus,

> CONFIG_EXTRA_FIRMWARE="amd-ucode/microcode_amd_fam19h.bin
> amdgpu/psp_13_0_5_toc.bin"
> CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware"
[...]
> What firmware blobs of linux-firmware has to be installed  to support
> the gpu of a  ryzen-7900X?
> CONFIG_EXTRA_FIRMWARE=?
>
> I do not use initrd nor initramfs and all neccessary drivers
> are not installed as modules but compiled into the kernel.

like you, I also use amdgpu hardcompiled into the kernel. It seems to be
safe to include _all_ blobs in /lib/firmware/amdgpu. Then you can boot
that kernel and check which blobs are actually necessary just by
grepping though dmesg. Then you can boil down CONFIG_EXTRA_FIRMWARE to
that set.

This worked with several different AMD GPUs, RX 7900 included, but I
never tried an integrated GPU/APU.

Cheers
Björn
Re: need help with amdgpu driver [ In reply to ]
Klaus Dittrich <kladit@t-online.de> writes:
> as I do not use a initrd or initramfs I am, as far as I know, forced
> to compile the driver amdgpu into the kernel, not as modules to be
> loaded.

No, you can use modules even without an initrd.

> I looked at https://wiki.gentoo.org/wiki/Amdgpu#Unknown_firmware_blobs
> but I still do not know what name is relevant to the built-in-gpu
> of a AMD-7900X processor.(!?)
>
> Does this gpu really needs all these blobs of the list there?
>
No, these blobs are given as examples. They vary per GPU models and in
fact there are several hundred different blobs available:

ls -l /lib/firmware/amdgpu | wc -l
479

So you have to figure out which ones you need. The easiest method is to
let the kernel load them itself by having the driver built as a module,
otherwise it may take several iterations of modifying the
CONFIG_EXTRA_FIRMWARE value until you get it to work.

--
Regards,
Julien
Re: need help with amdgpu driver [ In reply to ]
On 27.01.23 15:30, Julien Roy wrote:
> Klaus Dittrich <kladit@t-online.de> writes:
>> as I do not use a initrd or initramfs I am, as far as I know, forced
>> to compile the driver amdgpu into the kernel, not as modules to be
>> loaded.
>
> No, you can use modules even without an initrd.
>
>> I looked at https://wiki.gentoo.org/wiki/Amdgpu#Unknown_firmware_blobs
>> but I still do not know what name is relevant to the built-in-gpu
>> of a AMD-7900X processor.(!?)
>>
>> Does this gpu really needs all these blobs of the list there?
>>
> No, these blobs are given as examples. They vary per GPU models and in
> fact there are several hundred different blobs available:
>
> ls -l /lib/firmware/amdgpu | wc -l
> 479
>
> So you have to figure out which ones you need. The easiest method is to
> let the kernel load them itself by having the driver built as a module,
> otherwise it may take several iterations of modifying the
> CONFIG_EXTRA_FIRMWARE value until you get it to work.
>

Julien and Peter,

now I (assume I) understand what you mean.

The kernel needs the entries to CONFIG_EXTRA_FIRMWARE
just for drivers to be compiled in and for modules just
to reduce the seeking in /lib/firmware/amdgpu ?

So when I set CONFIG_DRM_AMDGPU=m and then look at dmesg
of the so compiled kernel it detects the type of
hardware I have (here the type of the cpu-built-in gpui
and tells me (via dmesg) which blobs are needed
to satisfy the driver for the hardware it has detected.

I will try that, moment please ..
--
Regars Klaus
Re: need help with amdgpu driver [ In reply to ]
On 27.01.23 16:05, Klaus Dittrich wrote:
> On 27.01.23 15:30, Julien Roy wrote:
>> Klaus Dittrich <kladit@t-online.de> writes:
>>> as I do not use a initrd or initramfs I am, as far as I know, forced
>>> to compile the driver amdgpu into the kernel, not as modules to be
>>> loaded.
>>
>> No, you can use modules even without an initrd.
>>
>>> I looked at https://wiki.gentoo.org/wiki/Amdgpu#Unknown_firmware_blobs
>>> but I still do not know what name is relevant to the built-in-gpu
>>> of a AMD-7900X  processor.(!?)
>>>
>>> Does this gpu really needs all these blobs of the list there?
>>>
>> No, these blobs are given as examples. They vary per GPU models and in
>> fact there are several hundred different blobs available:
>>
>> ls -l /lib/firmware/amdgpu | wc -l
>> 479
>>
>> So you have to figure out which ones you need. The easiest method is to
>> let the kernel load them itself by having the driver built as a module,
>> otherwise it may take several iterations of modifying the
>> CONFIG_EXTRA_FIRMWARE value until you get it to work.
>>
>
> Julien and Peter,
>
> now I (assume I) understand what you mean.
>
> The kernel needs the entries to CONFIG_EXTRA_FIRMWARE
> just for drivers to be compiled in and for modules just
> to reduce the seeking  in /lib/firmware/amdgpu ?
>
> So when I set CONFIG_DRM_AMDGPU=m and then look at dmesg
> of the so compiled kernel it detects the type of
> hardware I have (here the type of the cpu-built-in gpui
> and tells me (via dmesg) which blobs  are needed
> to satisfy the driver for the hardware it has detected.
>
> I will try that, moment please ..

Julien and Peter,

I got no errors or messages form dmesg saying that some blobs
are missed.
I got some console messsages written in an very big font-
So I compiled the the kernel again with AMDGPU=y this time
and now I got all the messages of the kernel boot
in normal fonts (my screen is 3840x2160).

dmesg:
[ 0.666078] amdgpu 0000:0d:00.0: amdgpu: Fetched VBIOS from VFCT
[ 0.666079] amdgpu: ATOM BIOS: 102-RAPHAEL-008
[ 0.666084] [drm] VCN(0) decode is enabled in VM mode
[ 0.666085] [drm] VCN(0) encode is enabled in VM mode
[ 0.666087] amdgpu 0000:0d:00.0: vgaarb: deactivate vga console
[ 0.666089] amdgpu 0000:0d:00.0: amdgpu: Trusted Memory Zone (TMZ)
feature not supported
[ 0.666091] amdgpu 0000:0d:00.0: amdgpu: PCIE atomic ops is not supported
[ 0.666299] [drm] vm size is 262144 GB, 4 levels, block size is
9-bit, fragment size is 9-bit
[ 0.666303] amdgpu 0000:0d:00.0: amdgpu: VRAM: 512M
0x000000F400000000 - 0x000000F41FFFFFFF (512M used)
[ 0.666305] amdgpu 0000:0d:00.0: amdgpu: GART: 1024M
0x0000000000000000 - 0x000000003FFFFFFF
[ 0.666307] amdgpu 0000:0d:00.0: amdgpu: AGP: 267419648M
0x000000F800000000 - 0x0000FFFFFFFFFFFF
[ 0.666311] [drm] Detected VRAM RAM=512M, BAR=512M
[ 0.666312] [drm] RAM width 128bits DDR5
[ 0.666327] [drm] amdgpu: 512M of VRAM memory ready
[ 0.666329] [drm] amdgpu: 31782M of GTT memory ready.
[ 0.666525] [drm] GART: num cpu pages 262144, num gpu pages 262144
[ 0.666639] [drm] PCIE GART of 1024M enabled (table at
0x000000F41FC00000).
[ 0.666963] amdgpu 0000:0d:00.0: amdgpu: PSP runtime database doesn't
exist
[ 0.666967] amdgpu 0000:0d:00.0: amdgpu: PSP runtime database doesn't
exist
[ 0.667073] [drm] Loading DMUB firmware via PSP: version=0x05000500
[ 0.668329] [drm] use_doorbell being set to: [true]
[ 0.668408] [drm] Found VCN firmware Version ENC: 1.24 DEC: 2 VEP: 0
Revision: 0
[ 0.668411] amdgpu 0000:0d:00.0: amdgpu: Will use PSP to load VCN
firmware
[ 0.691438] [drm] reserve 0xa00000 from 0xf41e000000 for PSP TMR
[ 0.760009] amdgpu 0000:0d:00.0: amdgpu: RAS: optional ras ta ucode
is not available
[ 0.767012] amdgpu 0000:0d:00.0: amdgpu: RAP: optional rap ta ucode
is not available
[ 0.767016] amdgpu 0000:0d:00.0: amdgpu: SECUREDISPLAY: securedisplay
ta ucode is not available
[ 0.767276] amdgpu 0000:0d:00.0: amdgpu: smu driver if version =
0x00000004, smu fw if version = 0x00000005, smu fw program = 0, smu fw
version = 0x00544fcc (84.79.204)
[ 0.768927] [drm] Display Core initialized with v3.2.207!
[ 0.769472] [drm] DMUB hardware initialized: version=0x05000500
[ 0.815836] amdgpu 0000:0d:00.0: adding component (ops
0xffffffff827288f0)
[ 0.816440] device: 'i2c-0': device_add
[ 0.816442] bus: 'i2c': add device i2c-0
[ 0.843548] device: 'i2c-1': device_add
[ 0.843549] bus: 'i2c': add device i2c-1
[ 0.843778] device: 'i2c-2': device_add
[ 0.843778] bus: 'i2c': add device i2c-2
[ 0.843809] device: 'i2c-3': device_add
[ 0.843810] bus: 'i2c': add device i2c-3
[ 0.844448] [drm] kiq ring mec 2 pipe 1 q 0
[ 0.846850] [drm] VCN decode and encode initialized
successfully(under DPG Mode).
[ 0.847968] kfd kfd: amdgpu: Allocated 3969056 bytes on gart
[ 0.848003] amdgpu: sdma_bitmap: 3
[ 0.848271] amdgpu: Virtual CRAT table created for GPU
[ 0.848480] amdgpu: Topology: Add dGPU node [0x164e:0x1002]
[ 0.848482] kfd kfd: amdgpu: added device 1002:164e
[ 0.848489] amdgpu 0000:0d:00.0: amdgpu: SE 1, SH per SE 1, CU per SH
2, active_cu_number 2
[ 0.848557] device: 'hwmon0': device_add
[ 0.848701] amdgpu 0000:0d:00.0: amdgpu: ring gfx_0.0.0 uses VM inv
eng 0 on hub 0
[ 0.848703] amdgpu 0000:0d:00.0: amdgpu: ring comp_1.0.0 uses VM inv
eng 1 on hub 0
[ 0.848704] amdgpu 0000:0d:00.0: amdgpu: ring comp_1.1.0 uses VM inv
eng 4 on hub 0
[ 0.848705] amdgpu 0000:0d:00.0: amdgpu: ring comp_1.2.0 uses VM inv
eng 5 on hub 0
[ 0.848707] amdgpu 0000:0d:00.0: amdgpu: ring comp_1.3.0 uses VM inv
eng 6 on hub 0
[ 0.848708] amdgpu 0000:0d:00.0: amdgpu: ring comp_1.0.1 uses VM inv
eng 7 on hub 0
[ 0.848710] amdgpu 0000:0d:00.0: amdgpu: ring comp_1.1.1 uses VM inv
eng 8 on hub 0
[ 0.848711] amdgpu 0000:0d:00.0: amdgpu: ring comp_1.2.1 uses VM inv
eng 9 on hub 0
[ 0.848712] amdgpu 0000:0d:00.0: amdgpu: ring comp_1.3.1 uses VM inv
eng 10 on hub 0
[ 0.848717] amdgpu 0000:0d:00.0: amdgpu: ring vcn_dec_0 uses VM inv
eng 0 on hub 1
[ 0.848718] amdgpu 0000:0d:00.0: amdgpu: ring vcn_enc_0.0 uses VM inv
eng 1 on hub 1
[ 0.848719] amdgpu 0000:0d:00.0: amdgpu: ring vcn_enc_0.1 uses VM inv
eng 4 on hub 1
[ 0.848829] device: 'renderD128': device_add
[ 0.848854] device: 'card0': device_add
[ 0.848864] device: 'card0-HDMI-A-1': device_add
[ 0.848872] device: 'card0-DP-1': device_add
[ 0.848876] device: 'i2c-4': device_add
[ 0.848877] bus: 'i2c': add device i2c-4
[ 0.848940] device: 'card0-DP-2': device_add
[ 0.848942] device: 'i2c-5': device_add
[ 0.848943] bus: 'i2c': add device i2c-5
[ 0.849073] device: 'card0-DP-3': device_add
[ 0.849144] device: 'i2c-6': device_add
[ 0.849145] bus: 'i2c': add device i2c-6
[ 0.849149] [drm] Initialized amdgpu 3.49.0 20150101 for 0000:0d:00.0
on minor 0
[ 0.856232] device: 'fb0': device_add
[ 0.856319] fbcon: amdgpudrmfb (fb0) is primary device
[ 0.856325] device: 'vtcon1': device_add
[ 0.856509] [drm] DSC precompute is not needed.
[ 1.131925] [drm] REG_WAIT timeout 1us * 100000 tries -
optc31_disable_crtc line:136
[ 1.201847] Console: switching to colour frame buffer device 240x67
[ 1.220757] amdgpu 0000:0d:00.0: [drm] fb0: amdgpudrmfb frame buffer
device
[ 1.221296] driver: 'amdgpu': driver_bound: bound to device
'0000:0d:00.0'
[ 1.221307] bus: 'pci': really_probe: bound device 0000:0d:00.0 to
driver amdgpu



The only suspicious lines are

[ 0.760009] amdgpu 0000:0d:00.0: amdgpu: RAS: optional ras ta ucode
is not available
[ 0.767012] amdgpu 0000:0d:00.0: amdgpu: RAP: optional rap ta ucode
is not available
[ 0.767016] amdgpu 0000:0d:00.0: amdgpu: SECUREDISPLAY: securedisplay
ta ucode is not available

It seems I made a step forward and I will try to get get X11 up next.

Thanks to all of you for your help

--
Regard Klaus
Re: need help with amdgpu driver [ In reply to ]
Klaus,

> [    0.760009] amdgpu 0000:0d:00.0: amdgpu: RAS: optional ras ta ucode
> is not available
> [    0.767012] amdgpu 0000:0d:00.0: amdgpu: RAP: optional rap ta ucode
> is not available
> [    0.767016] amdgpu 0000:0d:00.0: amdgpu: SECUREDISPLAY: securedisplay
> ta ucode is not available
>
> It seems I made a step forward  and I will try to get get X11 up next.

yep, that is normal.

The firmware for encrypted display connection is not released yet.

Cheers,
Björn