- Ryzen
- Contents
- Enable microcode support
- Tweaking Ryzen
- Power/temperature monitoring
- Power managing
- Overclocking
- Compiling a kernel
- Troubleshooting
- Random reboots
- Screen-tearing (APU)
- Soft lock freezing
- Freeze on shutdown, reboot and suspend
- Arch Linux User Repository
- Search Criteria
- Package Details: linux-amd 5.14.v.11-1
- Package Actions
- Dependencies (15)
- Required by (0)
- Sources (5)
- Pinned Comments
- eggz commented on 2020-10-26 18:15
- eggz commented on 2019-11-10 15:23
- Latest Comments
- adekmaulana commented on 2021-09-30 22:32
- eggz commented on 2021-09-30 20:52
- adekmaulana commented on 2021-09-30 20:13
- eggz commented on 2021-09-29 09:44
- eggz commented on 2021-09-29 06:11
- Linux kernel amd ryzen
Ryzen
Contents
Enable microcode support
Install the amd-ucode package to enable microcode updates and enable it with the help of the Microcode page. These updates provide bug fixes that can be critical to the stability of your system. It is highly recommended to use it despite it being proprietary.
Tweaking Ryzen
Power/temperature monitoring
lm_sensors should be able to monitor temperatures out of the box. However, for more detailed information such as power consumption and voltage, zenpower-dkms AUR is needed. For GUI based monitoring tools, use zenmonitor AUR or zenmonitor3-git AUR for Zen 3 CPUs.
Power managing
- RyzenAdj — RyzenAdj is a command-line tool that can adjust power management settings for Ryzen processors.
https://github.com/FlyGoat/RyzenAdj || ryzenadj-gitAUR
- Ryzen Controller — Ryzen Controller is a GUI for RyzenAdj.
https://gitlab.com/ryzen-controller-team/ryzen-controller || ryzen-controller-binAUR
Overclocking
zenstates-git AUR (CLI) is a tool made by r4m0n to adjust the clock speed and voltage. A detailed example was given in Level1Techs’ forums by catsay for you to understand it.
Compiling a kernel
See Gentoo:Ryzen#Kernel on enabling Ryzen support.
Troubleshooting
Random reboots
Screen-tearing (APU)
If you are using Xorg and are experiencing screen-tearing, enabling the «TearFree» option will fix the problem.
Soft lock freezing
Some laptops with Ryzen CPUs such as the HP Envy x360 15-bq100na may experience CPU soft locks which result in a frozen system. These can be avoided with the «idle=nomwait» boot option.
Freeze on shutdown, reboot and suspend
This seems to be related to the C6 c-state, that does not seem to be well supported (if at all) in Linux.
To fix this issue, go into your BIOS settings for your motherboard and search for an option labeled something like this: «Power idle control». Change its value to «Typical current idle». Note that these names are dependent on what the motherboard manufacturer calls them, so they may be a little different in your particular case.
Источник
Arch Linux User Repository
Search Criteria
Package Details: linux-amd 5.14.v.11-1
Package Actions
Git Clone URL: | https://aur.archlinux.org/linux-amd.git (read-only, click to copy) |
---|---|
Package Base: | linux-amd |
Description: | Linux kernel aimed at the latest AMD Ryzen CPU based hardware (ZNVER3/MZEN3) |
Upstream URL: | https://www.kernel.org/ |
Licenses: | GPL2 |
Submitter: | eggz |
Maintainer: | eggz (NhaMeh) |
Last Packager: | eggz |
Votes: | 11 |
Popularity: | 0.61 |
First Submitted: | 2019-11-10 15:20 |
Last Updated: | 2021-10-09 21:19 |
Dependencies (15)
- coreutils (coreutils-git, coreutils-selinux, coreutils-hybrid)
- kmod (kmod-git, kmod-minimal-git)
- linux-firmware (linux-firmware-git, linux-firmware-iwlwifi-git, linux-libre-firmware)
- lzop
- mkinitcpio>=0.7 (mkinitcpio-nosystemd, mkinitcpio-nohooks-git, mkinitcpio-git)
- bc (bc-gh) (make)
- docbook-xsl(make)
- git (git-git, git-vfs) (make)
- inetutils (gettext-hostname, inetutils-git) (make)
- kmod (kmod-git, kmod-minimal-git) (make)
- libelf (elfutils-git, libelf-minimal-git) (make)
- lzop(make)
- xmlto (xmlto-git) (make)
- gcc>=10.3 (fastgcc, gcc-multilib-git, gcc-git) (make)
- crda (crda-git, wireless-regdb-pentest) (optional) – to set the correct wireless channels of your country
Required by (0)
Sources (5)
Pinned Comments
eggz commented on 2020-10-26 18:15
GCC11.1 is mainlined in arch, so this means znver3 support can kick off on this kernel. The graysky compile patches have been updated too.
This kernel now natively supports the znver3 arch, but this kernel will most likely keep working on all AMD ryzen hardware. It’s better to be able to address certain small perks or issues per architecture now and in the future.
eggz commented on 2019-11-10 15:23
Tired of compiling? Use this binary repo instead! Add this at the end of /etc/pacman.conf :
Latest Comments
adekmaulana commented on 2021-09-30 22:32
oooh i see thank you!!
eggz commented on 2021-09-30 20:52
3500U ==> AMD Picasso ==> a 12 nm refresh of Raven Ridge ==> znver1. this package is znver3
You would probably want https://aur.archlinux.org/packages/linux-amd-raven, but thats an LTS kernel (alot of ravenridge hardware have problems getting past linux 5.4, I have one of those laptops, thats why it is on LTS)
If https://aur.archlinux.org/pkgbase/linux-amd-znver2/ works for you, I recommend going with that kernel. (unless you have no problems with running an LTS kernel)
adekmaulana commented on 2021-09-30 20:13
i’m on amd ryzen 5 3500U so the correct one is i raven right? because it’s zen+ and i’m confused
eggz commented on 2021-09-29 09:44
I am unable to detach the CONFIG_AS_AVX512 component from a (working) kconfig. It seems to be rooted in too many important core modules as a dependency. Things that first came to mind is raid6, kvm, and encryptions like chacha and blake2s, but the scope seems to be even bigger than that. I do not know the full list of dependencies.
To be completely clear on things: Sure, you can disable the config and then turn a blind eye, but the «makeconfig» part will reenable the module just before the kernel is compiled. The kconfig I post in PKGBUILDs will always be reflective of what the «makeconfig» has decided to do for full transparancy. I do a copy right after the compilement of the effective endresult kconfig.
If anyone can find the true dependencies of CONFIG_AS_AVX512, I am all ears, but atleast for me, the roots go way too deep.
eggz commented on 2021-09-29 06:11
@RCheese Good catch, but its being enabled by default by some other module(s?). Ill keep searching.
Источник
Linux kernel amd ryzen
N.B. Images above shows the potential capabilities of this driver, retrieved using the monitor_cpu utility. Other processors will require tweaking on the user’s part or additional tools.
Ryzen SMU is a Linux kernel driver that exposes access to the SMU (System Management Unit) for certain AMD Ryzen Processors. Use at your own risk, the author takes no responsibility over potential damages that may result from the misuse of this driver or programs dependent upon it.
The following processor code names are supported:
In addition, for the following models, the power metrics/monitoring (PM) table (seen in screenshot) can also be accessed:
- Vermeer ( Ryzen 5000 Desktop Series )
- Matisse ( Ryzen 3000 Desktop Series )
- Cezanne ( Ryzen 5000[GE] APU Series )
- Renoir ( Ryzen 4000[UGHS] APU Series )
- Picasso ( Ryzen 3000[UGHS] APU Series )
- Raven Ridge ( Ryzen 2000[GEU] APU Series )
- Raven Ridge 2
When loaded, the driver exposes several files under sysfs which can only be read with root permissions (for obvious reasons) at the root path /sys/kernel/ryzen_smu_drv :
- drv_version
- version
- mp1_if_version
- codename
- smu_args
- mp1_smu_cmd
- smn
- rsmu_cmd (Not present on Rembrandt , Vangogh )
For supported PM table models where RSMU is also supported, the following files are additionally exposed:
- pm_table_version
- pm_table_size
- pm_table
The kernel module may be installed either by DKMS or manually building and inserting the module.
Be sure kernel headers, dev utilities such as gcc and make are installed beforehand.
Available on the AUR.
Install it using your AUR helper of choice, example:
The module may be built and inserted into the running kernel manually as follows:
Auto-Loading On System Startup
Assuming you are using systemd , the kernel module may be loaded automatically upon system startup using modules-load.d by adding the module name to /etc/modules-load.d/ .conf
Confirming Module Works
Upon loading the module, you should see output in your dmesg window listing the SMU version:
After which you can verify the existence of the sysfs files and attempt to read them:
Following which, you can run the test.py script to verify that SMU and SMN functionality is working:
Explaining Sysfs Files
Lists the string-representation of the driver (and thus interface) version. For userspace applications, they should make sure this version is within the expected range.
Lists the current SMU firmware version in relation to the currently installed AGESA.
The following are several lists of SMU to AGESA versions for Matisse on the ComboPiAM4 (Pre-X570/B550):
SMU Version | AGESA Version |
---|---|
46.62 | 1.0.0.6 |
46.54 | 1.0.0.4 B |
46.53 | 1.0.0.4 |
46.49 | 1.0.0.3 ABBA |
46.37 | 1.0.0.3 A |
43.18 | 1.0.0.2 A |
The following are few known lists of SMU to AGESA RavenPI versions for Raven Ridge and Picasso APUs found on various notebooks:
SMU Version | AGESA Version |
---|---|
30.79 | 1.1.0.8 |
30.74 | 1.1.0.6 |
Note: This file returns a string encoded version represented by the «SMU Version» above.
Lists the interface version for the MP1 mailbox.
This can range from v9 to v13 and is indicated by the following table:
Value | Interface Version |
---|---|
0 | v9 |
1 | v10 |
2 | v11 |
3 | v12 |
4 | v13 |
5 | Undefined |
Note: This file returns a string representation of the «Value» field above.
Returns a numeric index containing the running processor’s codename based on the following enumeration:
Hex | Decimal | Code Name |
---|---|---|
00h | 0 | Unknown |
01h | 1 | Colfax |
02h | 2 | Renoir |
03h | 3 | Picasso |
04h | 4 | Matisse |
05h | 5 | Threadripper |
06h | 6 | Castle Peak |
07h | 7 | Raven Ridge |
08h | 8 | Raven Ridge 2 |
09h | 9 | Summit Ridge |
0Ah | 10 | Pinnacle Ridge |
0Bh | 11 | Rembrandt |
0Ch | 12 | Vermeer |
0Dh | 13 | Vangogh |
0Eh | 14 | Cezanne |
0Fh | 15 | Milan |
10h | 16 | Dali |
Note: This file returns 2 characters of the ‘Decimal’ encoded index.
/sys/kernel/ryzen_smu_drv/rsmu_cmd or /sys/kernel/ryzen_smu_drv/mp1_smu_cmd
This file allows the user to initiate an RSMU or MP1 SMU request. It accepts either an 8-bit or 32-bit command ID that is platform-dependent.
When this file is read, it produces the result on the status of the operation, as a 32 bit little-endian encoded value.
The SMU returns the following possible values which indicate the result of a command execution:
Hex | Decimal | Explanation |
---|---|---|
00h | 0 | WAITING |
01h | 1 | OK |
FFh | 255 | FAILED |
FEh | 254 | UNKNOWN COMMAND |
FDh | 253 | REJECTED — PREREQUISITE UNMET |
FCh | 252 | REJECTED — BUSY |
In addition to this, several custom error codes are also implemented by the driver:
Hex | Decimal | Explanation |
---|---|---|
FBh | 251 | COMMAND TIMEOUT |
FAh | 250 | INVALID ARGUMENT |
F9h | 249 | UNSUPPORTED PLATFORM |
F8h | 248 | INSUFFICIENT BUFFER SIZE |
F7h | 247 | MEMORY MAP ERROR |
F6h | 246 | PCI PROGRAMMING ERROR |
When written to, this file accepts 6x 32-bit words (a total of 192 bits) that specify the arguments used when executing an SMU command.
When read from, it lists either:
- The last values that were written to it before an SMU request was initiated
- The responses from the SMU after a request was completed
Note: All values sent to and read from this file must be in 6x 32-bit words encoded in little-endian order, arguments numbered from 1 to 6.
Allows reading and writing 32 bit values from the SMN address space. To perform an operation, write a value then read the file for the result.
The amount of bytes written indicates the operation performed:
Bits Written | Operation | Action Taken |
---|---|---|
32 | Read | Reads 32 bit address and returns the result |
64 | Write | Writes the second 32-bit value to the address specified by the first 32 bits |
Note: All values sent to and read from the device must are in little-endian binary format.
On supported platforms, this lists the maximum size of the /sys/kernel/ryzen_smu_drv/pm_table file, in bytes.
Note: File is a 64 bit word encoded in little-endian binary order.
On supported platforms, listed in the table below, this indicates the version of the metrics table.
Each version corresponds to a specific table size and layout that differs across processors.
The following table lists the known characteristics per version:
Hex | Platform | Table Size (Hex) |
---|---|---|
0x1E0004 | Raven Ridge | 0x6AC |
0x1E0005 | Raven Ridge | 0x6AC |
0x1E0101 | Raven Ridge | 0x6AC |
0x240802 | Matisse | 0x7E0 |
0x240803 | Matisse | 0x7E4 |
0x240902 | Matisse | 0x514 |
0x240903 | Matisse | 0x518 |
0x2D0803 | Vermeer | 0x894 |
0x380804 | Vermeer | 0x8A4 |
0x380805 | Vermeer | 0x8F0 |
0x2D0903 | Vermeer | 0x594 |
0x380904 | Vermeer | 0x5A4 |
0x380905 | Vermeer | 0x5D0 |
0x370000 | Renoir | 0x794 |
0x370001 | Renoir | 0x884 |
0x370002 | Renoir | 0x88C |
0x370004 | Renoir | 0x8AC |
0x370005 | Renoir | 0x8C8 |
0x400005 | Cezanne | 0x944 |
0x2D0008 | Milan | 0x1AB0 |
Note: File is a 32 bit word encoded in little-endian binary order.
On supported platforms, this file contains the PM table for the processor, as updated by the SMU.
Note: This file is encoded directly by the SMU and contains an array of 32-bit floating point values whose structure is determined by the version of the table.
The driver supports the following module parameter(s):
When executing an SMU command, either by reading pm_table or manually, via smu_args and smu_cmd , the driver will retry this many times before considering the command to have timed out.
For example, on slower or busy systems, the SMU may be tied up resulting in commands taking longer to execute than normal. Allowed range is from 500 to 32768 , defaulting to 8192 .
Included in this project is a userspace library, located at /lib to allow easy interaction with the driver. More details of the methods provided may be found in libsmu.h.
Example usage of the library is detailed below:
N.B. This header file must be compatible with the version of the driver installed.
For Matisse & Vermeer processors, there are several commands that are known to work. See rsmu_commands.md for more information.
Commands may be executed either programatically using the library or under a shell by writing to the designated files.
Example usage via shell:
As to the rest of the commands, we leave that as an exercise up to the user. 🙂
Источник