Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Ryzen 5500u and Gentoo
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
RIA77
Apprentice
Apprentice


Joined: 24 Feb 2016
Posts: 198

PostPosted: Mon Jan 23, 2023 2:34 pm    Post subject: Ryzen 5500u and Gentoo Reply with quote

Hello and thank you for enormous support.
I can't see any info regarding support for 5500u in Gentoo ?
There is no Amd pstate driver

Quote:
Firmware blob files selection

https://wiki.gentoo.org/wiki/AMD_microcode
I have problem regarding loading of my driver in kernel.

Code:
Device Drivers  --->
    Generic Driver Options
        Firmware loader --->
        {*} Firmware loading facility
        (amd-ucode/microcode_amd_fam17h.bin) External firmware blobs to build into the kernel binary
        (/lib/firmware) Firmware blobs root directory

Code:
make[5]: *** No rule to make target '/lib/firmware//lib/firmware/microcode_amd_fam17h.bin', needed by 'drivers/base/firmware_loader/builtin//lib/firmware/microcode_amd_fam17h.bin.gen.o'.  Stop.
make[5]: *** Waiting for unfinished jobs....
make[4]: *** [scripts/Makefile.build:500: drivers/base/firmware_loader/builtin] Error 2
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [scripts/Makefile.build:500: drivers/base/firmware_loader] Error 2
make[2]: *** [scripts/Makefile.build:500: drivers/base] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [scripts/Makefile.build:500: drivers] Error 2
make: *** [Makefile:1992: .] Error 2


Last edited by RIA77 on Thu Jan 26, 2023 11:29 am; edited 2 times in total
Back to top
View user's profile Send private message
RIA77
Apprentice
Apprentice


Joined: 24 Feb 2016
Posts: 198

PostPosted: Mon Jan 23, 2023 7:50 pm    Post subject: Reply with quote

No any temperature info.
Cpupower - no info.
XFCE sensors plugin does not show even NVME temps.
Cpupower is showing nvme and gpu temps, but not CPU. Thank you.
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4282
Location: Frankfurt, Germany

PostPosted: Mon Jan 23, 2023 8:21 pm    Post subject: Reply with quote

1) Does the file "/lib/firmware/amd-ucode/microcode_amd_fam17h.bin" exist?
Code:
# ls -la /lib/firmware/amd-ucode/microcode_amd_fam17h.bin

2) This looks good:
Code:
(amd-ucode/microcode_amd_fam17h.bin) External firmware blobs to build into the kernel binary
(/lib/firmware) Firmware blobs root directory

3) This does NOT look good:
Code:
No rule to make target '/lib/firmware//lib/firmware/microcode_amd_fam17h.bin'

Why does the error message show "lib/firmware" twice?

4) Please run
Code:
# grep EXTRA_FIRMWARE .config
-- Should be:
-- CONFIG_EXTRA_FIRMWARE="amd-ucode/microcode_amd_fam17h.bin"
-- CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware"
# make clean
# make
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 51920
Location: 56N 3W

PostPosted: Mon Jan 23, 2023 8:42 pm    Post subject: Reply with quote

mike155,

I suspect that the kernel is not being built from the config file being posted.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 2315
Location: Bavaria

PostPosted: Mon Jan 23, 2023 10:30 pm    Post subject: Re: Ryzen 5500u and Gentoo Reply with quote

RIA77 wrote:
There is no Amd pstate driver

You will need kernel version 6.1.x and then you will find:
Code:
CONFIG_X86_AMD_PSTATE:

This driver adds a CPUFreq driver which utilizes a fine grain
processor performance frequency control range instead of legacy
performance levels. _CPC needs to be present in the ACPI tables
of the system.   

For details, take a look at:
<file:Documentation/admin-guide/pm/amd-pstate.rst>.

If in doubt, say N.

Symbol: X86_AMD_PSTATE [=n]
Type  : bool
Defined at drivers/cpufreq/Kconfig.x86:37
  Prompt: AMD Processor P-State driver
  Depends on: CPU_FREQ [=y] && X86 [=y] && ACPI [=y]
  Location:     
    -> Power management and ACPI options   
      -> CPU Frequency scaling       
        -> CPU Frequency scaling (CPU_FREQ [=y])   
          -> AMD Processor P-State driver (X86_AMD_PSTATE [=n])     
Selects: ACPI_PROCESSOR [=y] && ACPI_CPPC_LIB [=y] && CPU_FREQ_GOV_SCHEDUTIL [=y]
Back to top
View user's profile Send private message
RIA77
Apprentice
Apprentice


Joined: 24 Feb 2016
Posts: 198

PostPosted: Mon Jan 23, 2023 11:40 pm    Post subject: Reply with quote

Code:
UPD     drivers/base/firmware_loader/builtin//lib/firmware/microcode_amd_fam17h.bin.gen.S
make[5]: *** No rule to make target '/lib/firmware//lib/firmware/microcode_amd_fam17h.bin', needed by 'drivers/base/firmware_loader/builtin//lib/firmware/microcode_amd_fam17h.bin.gen.o'.  Stop.
make[4]: *** [scripts/Makefile.build:500: drivers/base/firmware_loader/builtin] Error 2
make[3]: *** [scripts/Makefile.build:500: drivers/base/firmware_loader] Error 2
make[2]: *** [scripts/Makefile.build:500: drivers/base] Error 2
make[1]: *** [scripts/Makefile.build:500: drivers] Error 2
make: *** [Makefile:1992: .] Error 2


Code:
-rw-r--r-- 1 root root 9700 Jan 22 11:50 /lib/firmware/amd-ucode/microcode_amd_fam17h.bin


Code:
grep EXTRA_FIRMWARE .config
CONFIG_EXTRA_FIRMWARE="/lib/firmware/microcode_amd_fam17h.bin"
CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware"
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 2315
Location: Bavaria

PostPosted: Mon Jan 23, 2023 11:45 pm    Post subject: Reply with quote

RIA77 wrote:
Code:
grep EXTRA_FIRMWARE .config
CONFIG_EXTRA_FIRMWARE="/lib/firmware/microcode_amd_fam17h.bin"
CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware"

change to ->
Code:
CONFIG_EXTRA_FIRMWARE="amd-ucode/microcode_amd_fam17h.bin"
CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware"

and do the steps @Mike155 already explained a post before.
Back to top
View user's profile Send private message
RIA77
Apprentice
Apprentice


Joined: 24 Feb 2016
Posts: 198

PostPosted: Tue Jan 24, 2023 10:47 am    Post subject: Reply with quote

Okay, but how to change ? To make new directory ? Thank you.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 51920
Location: 56N 3W

PostPosted: Tue Jan 24, 2023 10:55 am    Post subject: Reply with quote

RIA77,

Enter
Code:
make menuconfig

Press / for seach
Enter EXTRA_FIRMWARE as the search term.
Choose EXTRA_FIRMWARE, not EXTRA_FIRMWARE_DIR and go to it. Press the number to left of the option
Edit the entry.

Save the change and rebuild the kernel.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
RIA77
Apprentice
Apprentice


Joined: 24 Feb 2016
Posts: 198

PostPosted: Tue Jan 24, 2023 6:20 pm    Post subject: Reply with quote

Okay. Recompiled kernel without errors, but there is no any changes.
Modprobed amd-pstate. No errors. lm sensors is not showing any info about cpu.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 51920
Location: 56N 3W

PostPosted: Tue Jan 24, 2023 7:14 pm    Post subject: Reply with quote

RIA77,

Run
Code:
 uname -a


Code:
$ uname -a
Linux neddy_static 6.1.1-gentoo #1 SMP PREEMPT_DYNAMIC Sat Dec 31 19:00:03 GMT 2022 x86_64 AMD Ryzen 9 5950X 16-Core Processor AuthenticAMD GNU/Linux


The time and date shown, here, Sat Dec 31 19:00:03 GMT 2022 is the build time and date of the running kernel.
If you have built the kernel today, it should be todays date. Is it ?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
RIA77
Apprentice
Apprentice


Joined: 24 Feb 2016
Posts: 198

PostPosted: Tue Jan 24, 2023 7:39 pm    Post subject: Reply with quote

Code:
SMP PREEMPT_DYNAMIC Tue Jan 24 19:10:30 -00 2023 x86_64 AMD Ryzen 5 5500U with Radeon Graphics AuthenticAMD GNU/Linux
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 51920
Location: 56N 3W

PostPosted: Tue Jan 24, 2023 8:19 pm    Post subject: Reply with quote

RIA77,

That's today's kernel. Its changed from a build fail to building.
For the P-State driver, you probably need the testing kernel. That was 6.1.7 yesterday.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
RIA77
Apprentice
Apprentice


Joined: 24 Feb 2016
Posts: 198

PostPosted: Tue Jan 24, 2023 8:39 pm    Post subject: Reply with quote

So I can copy old .config and compile it in new kernel ?
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 2315
Location: Bavaria

PostPosted: Tue Jan 24, 2023 8:43 pm    Post subject: Reply with quote

RIA77 wrote:
So I can copy old .config and compile it in new kernel ?

Yes ... BUT ... please dont forget to do a "make oldconfig".
See more here: https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Manual_kernel_configuration#Cheat_Sheets
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 51920
Location: 56N 3W

PostPosted: Tue Jan 24, 2023 8:48 pm    Post subject: Reply with quote

RIA77,

Almost ...

Copy the config file to the new kernel.

In the new kernel, run
Code:
make oldconfig

This will do three things.
1. Remove elements that are not in the new kernel.
2. Keep the settings that are valid for the new kernel
3. Ask you about all the new settings.

The prompt for new settings will show y/m/n/?
Yes makes the option built in, M makes it a module, No leaves it out and ? shows the help.
Not all four options are shown every time.
One of y/n/m will be a capital letter. This is the default, it may or may not be what you need.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 2315
Location: Bavaria

PostPosted: Tue Jan 24, 2023 10:13 pm    Post subject: Reply with quote

Neddy,

thank you very much for this short - and excellent - explanation ... I have just copied it into my wiki article ... :lol:
Back to top
View user's profile Send private message
RIA77
Apprentice
Apprentice


Joined: 24 Feb 2016
Posts: 198

PostPosted: Tue Jan 24, 2023 11:56 pm    Post subject: Reply with quote

OK, here is what I tried.
Compiled last kernel.
Cpufreq is disabled, but there is no amd pstate.
Modprobed amd pstate, but without success.
Cpufreq info is showing nothing.
Trided to recompile with cpufreq, but the same problem, modprobe won't work. But I can see some frequencies of cpu and there is cpufreq info.
Back to top
View user's profile Send private message
logrusx
Guru
Guru


Joined: 22 Feb 2018
Posts: 491

PostPosted: Wed Jan 25, 2023 4:54 am    Post subject: Reply with quote

RIA77 wrote:
Okay. Recompiled kernel without errors, but there is no any changes.
Modprobed amd-pstate. No errors. lm sensors is not showing any info about cpu.


Did you run

Code:
make install
make modules_install


after compiling the kernel?

And possibly
Code:
grub-mkconfig -o /boot/grub/grub.cfg

depending on if you just compiled a kernel version other than that already in use.
And before that create/update your initramfs if you use one.

Best Regards,
Georgi
Back to top
View user's profile Send private message
RIA77
Apprentice
Apprentice


Joined: 24 Feb 2016
Posts: 198

PostPosted: Wed Jan 25, 2023 9:23 am    Post subject: Reply with quote

Yes. Checked, I compiled last kernel. 6.1.8 
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 51920
Location: 56N 3W

PostPosted: Wed Jan 25, 2023 8:59 pm    Post subject: Reply with quote

RIA77,

The help says ...
Code:
  ┌───────────────────────────── AMD Processor P-State driver ─────────────────────────────┐
  │ CONFIG_X86_AMD_PSTATE:                                                                 │ 
  │                                                                                        │ 
  │ This driver adds a CPUFreq driver which utilizes a fine grain                          │ 
  │ processor performance frequency control range instead of legacy                        │ 
  │ performance levels. _CPC needs to be present in the ACPI tables                        │ 
  │ of the system.                                                                         │ 
  │                                                                                        │ 
  │ For details, take a look at:                                                           │ 
  │ <file:Documentation/admin-guide/pm/amd-pstate.rst>.                                    │ 
  │                                                                                        │ 
  │ If in doubt, say N.                                                                    │ 
  │                                                                                        │ 
  │ Symbol: X86_AMD_PSTATE [=y]                                                            │ 
  │ Type  : bool                                                                           │ 
  │ Defined at drivers/cpufreq/Kconfig.x86:37                                              │ 
  │   Prompt: AMD Processor P-State driver                                                 │ 
  │   Depends on: CPU_FREQ [=y] && X86 [=y] && ACPI [=y]                                   │ 
  │   Location:                                                                            │ 
  │     -> Power management and ACPI options                                               │ 
  │       -> CPU Frequency scaling                                                         │ 
  │         -> CPU Frequency scaling (CPU_FREQ [=y])                                       │ 
  │           -> AMD Processor P-State driver (X86_AMD_PSTATE [=y])                        │ 
  │ Selects: ACPI_PROCESSOR [=y] && ACPI_CPPC_LIB [=y] && \                                │ 
  │ CPU_FREQ_GOV_SCHEDUTIL [=y]                                                            │ 



Notice the
Code:
 │   Depends on: CPU_FREQ [=y] && X86 [=y] && ACPI [=y]   

Unless all these kernel options are on, X86_AMD_PSTATE will be hidden.

For temperature information you probably need lm-sensors and ryzen_monitor will tell you all about your CPU.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
RIA77
Apprentice
Apprentice


Joined: 24 Feb 2016
Posts: 198

PostPosted: Wed Jan 25, 2023 10:11 pm    Post subject: Reply with quote

Problem is that there is nothing in lm_sensors. Not any information regarding CPU.
XFCE sensors too, not any CPU information.

Code:
ryzen_monitor
SMU Driver Not Present Or Fault
Back to top
View user's profile Send private message
logrusx
Guru
Guru


Joined: 22 Feb 2018
Posts: 491

PostPosted: Thu Jan 26, 2023 7:30 am    Post subject: Reply with quote

RIA77 wrote:
Problem is that there is nothing in lm_sensors. Not any information regarding CPU.
XFCE sensors too, not any CPU information.

Code:
ryzen_monitor
SMU Driver Not Present Or Fault


lm_sensors and XFCE sensors read information from one and the same place if not even XFCE sensors rreading from lm_sensors. And they won't read it until there's a driver to provide it. This drives is either k10temp in kernel or zenpower3 out of kernel module which can be found in guru overlay.

For me, ryzen_monitor says SMU not present or fault, although I think everything with my R75800H is setup correctly including AMD-pstate:

Code:
cpupower frequency-info
analyzing CPU 0:
  driver: amd-pstate


AMD P-state needs to be compiled in, not a module. Also, if you don't see it, go to Power Management -> CPU Frequency Scaling and press z. It'll show all hidden options. Go to AMD p-state and select help from the buttons below. It'll show you what it depends on including which options should not be selected (will be marked =n).

p.s. I did some testing and concluded I don't need the microcode embedded in the kernel for it to load it. You just need to have linux-firmware emerged and the firmware directory correctly set. However I'm starting to doubt this is the correct way to embed microcode in the kernel. It's a firmware loader, not microcode loader. If somebody knows there's no difference between those two, please clarify.

p.s.2. have you set CONFIG_MICROCODE and CONFIG_MICROCODE_AMD?
what does
Code:
dmesg | grep microcode
say?

Best Regards,
Georgi
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 51920
Location: 56N 3W

PostPosted: Thu Jan 26, 2023 6:35 pm    Post subject: Reply with quote

RIA77,

lm-sensors depends on having the 'right' sensor dliver(s) available to the kernel.
ln-sensors will load the driver(s) if they are loadable modules.

What 'right' means varies from motherboard to motherboard and even motherboard batch by batch.
What motherboard do you have?

Knowing that, we can use the internet to determine a lost of possible kernel modules.

Post the output of
Code:
lspci -nnk
and use wgetpaste to put your entire kernel .config file onto a pastebin site please.

For the cpu, you need the $
Code:
lsmod | grep smu
ryzen_smu              20480  0
kernel module.

Its provided by the ryzen_smu package, which should be depended on by app-admin/ryzen_monitor.
You may need to
Code:
modprobe  ryzen_smu
to load the module.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
RIA77
Apprentice
Apprentice


Joined: 24 Feb 2016
Posts: 198

PostPosted: Sat Jan 28, 2023 10:26 am    Post subject: Reply with quote

I have been using Lenovo V15 G2 ALC, so it's 5500U AMD CPU.

Thank you. This is current situation.
After installing of k10 drivers xsensors and lm_sensors is working fine, but not xfce-sensors-plugin.
I have been running 6.1.8 kernel, but when I install ryzen_smu it's pointing at old 6.1.4 kernel.
How to delete old kernel ?

Code:
emerge --depclean -a gentoo-sources

Calculating dependencies                 ... done!
>>> No packages selected for removal by depclean

emerge --depclean -a gentoo-sources:6.1.4
--- Couldn't find 'sys-kernel/gentoo-sources:6.1.4' to depclean.
>>> No packages selected for removal by depclean

Why ryzen_smu is not instaling for running (6.1.8 ) but for old kernel ?

Code:
ryzen_smu-0.1.2_p20211205.tar.xz BLAKE2B SHA512 size ;-) ...          [ ok ]
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found sources for kernel version:
 *     6.1.4-gentoo


Code:
cd /usr/src
dhcppc2 /usr/src # dir
linux  linux-6.1.8-gentoo
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum