Custom Kernels with Ryzen

I know this question has been asked to no end on various forums across the web, but after experimenting for a few days with about 5-6 various kernels to compare performance across different games and production applications, I was curious if anyone else here is using a custom kernel with Ryzen desktop CPUs and what your experience has been like. I know I’m limiting my responses by asking specifically for Ryzen, so if you’re also using a custom kernel with another CPU architecture I’d like to hear about it as well.

I use linux-zen works a treat.

2 Likes

Zen is what I’ve been using for awhile but because I love to tinker, and I’ve got my hardware tuned to as perfect as I can get it, I figured I’d start working on the software. So far I’ve tried linux-tkg-pds-zen2, linux-tkg-muqss-zen2, linux-lts, as well as the standard Linux kernel. I haven’t had enough time to test extremely thoroughly but linux-zen does appear to be in the lead for me at the moment.

1 Like

I use linux-ck-zen for my Ryzen 1700-based laptop (there’s a zen2 version too). I’ll probably switch to @torvic9’s kernel once the VirtualBox host modules support kernel 5.8.

2 Likes

That was actually on my list to try as well. I attempted to install just now but it seems there is an issue with the key linked on the ArchWiki

gpg: keyserver receive failed: General error
==> ERROR: Remote key not fetched correctly from keyserver.

Ah, that still. keyserver.ubuntu.com works, pool.sks-keyservers.net is having problems:

2 Likes

Thanks, working now. Getting ready to give it a go!

1 Like

may be this will change on size kernel ,
that differs from generic

1 Like

Purely out of interest, how many nano-seconds do you save with a specialist-build kernel?

1 Like

If you’re being serious, I have yet to test memory latency between the different kernels although once I find adequate software to do so I will be looking at that, as memory speed, inter-ccx latency, and FCLK stability are extremely important for getting the most out of the Zen CPU architecture. If you’re question was sarcastic, the truth is that in most of my testing, it seems a 5-10 FPS advantage is the maximum gained. However, I have found that the use of certain schedulers can have very different effects on how the CPU load is handled. For example, the MuQSS scheduler seems to divide heavy CPU load much more evenly, resulting in a somewhat lower temperature on a Ryzen 3900X system, which has 24 threads spread across 2 CCDs.

:astonished:

1 Like

It should be noted this result was not universal, and could only be seen in a couple of titles. Most had little to no difference, and some even had slightly worse performance.

2 Likes

Building your own kernels can be an interesting hobby. Most of my experience is with baytrail debian type kernels.

Advantages of building your own:

  • enabling (experimental?) hardware support that is already in the kernel
  • disabling unneeded hardware support (e.g. floppy disk drivers, etc) (much smaller kernel, faster boot)
  • selecting a specific CPU as a compiler option vs a generic CPU (optimization control)
  • adding patch sets for features or bug fixes not yet (or never will be) in the mainstream kernel

The disadvantages

  • There are thousands of .config options. Blindly altering options easily yields an un-bootable kernel.
  • Build time, twice+ weekly kernel maintenance releases
  • Setting up a new kernel series every other month (new config options, migrating/dropping patches or waiting for patch set updates)
  • There aren’t a lot of guides that accurately describe the whole process and each distro has its own variations. Nearly every guide I’ve seen misses some details. The config/build/install details can change with each kernel series. Tool updates can cause problems with older kernels that used to build fine…

All that said, it is pretty cool to see your own customized kernel boot up and do something that a standard kernel won’t.

Where a custom kernel can shine, is building a Mint (baytrail) kernel using only the kernel.org sources. Ubuntu adds quite a lot of bloat to their kernel. I don’t know what all the extra code does, but I suspect it is mainly related to telemetry, hardware support backports and maybe better self-recovery from run-time errors. My kernels seem to run a little snappier on my baytrail. My custom Manjaro kernels seemed to run about the same as the standard Manjaro kernels.

For my AMD laptop with EOS, there are a lot of AUR kernel options. So far the standard kernel seems to work best for my 4500U. The linux-zen had some issues with my backlight control. I did not see obvious improvements with the linux-amd kernel. But with frequent kernel maintenance releases, I’ll need to keep checking those options.

I don’t think I’ll have the same need for a custom kernel with the new laptop compared to my old baytrail, where kernel 4.2 barely supported anything baytrail in the mainstream kernel. Baytrail still doesn’t have camera support as of 5.9-rc0.5, but almost everything else worked well as of kernel 4.16…

5 Likes

Yea it’s definitely something I like to experiment with even if the results may be less than apparent. Since you have a Zen2 chip I would like to ask if you’ve had any hardware errors that show up when running dmesg | grep -i "hardware error" It seems that no matter what BIOS settings, voltages, kernels, etc. that I use, I inevitably get a “link error” that at least from my research seems to point to inadequate VDDG or SOC voltages and/or unstable FCLK. One of the reasons I started looking at experimenting with custom kernels on this system was to see if any of them would be able to rid myself of that pesky, albeit non-intrusive, error. But so far I have yet to succeed. I am hoping that newer 5.8 kernels may be able to alleviate the issue.

My dmesg is clean, no "error"s at all. I did find that tlp was giving me problems when running a terminal while on battery. The < tab> key for auto-complete would cause a loud beep from the BIOS (my linux sounds are usually turned off.) Once I disabled tlp, the beeps stopped. My battery life seems fine without tlp.

My laptop BIOS doesn’t give me a lot of options, it seems pretty dumbed down and basic. I found the new 5.8.0 kernel still has some regressions that affect my 4500U (but not my baytrail!). Usually, a new series needs a couple of maintenance releases before it’s really ready.

2 Likes

I got my Zen2+Navi when kernel 5.4 was released, and it wasn’t a very nice experience. Good news is that things started improving fast, and now with 5.8 and the latest BIOS it’s much better already.

Oh yes. The default kernel is one-size-fits-all, and desktop users can throw out a lot of drivers. make localmodconfig is a quick way to create a kernel config with currently loaded modules only. Obviously not very practical, but interesting.

2 Likes

Yeah, there aren’t too many systems that need humidity sensors, etc… :rofl: One trick for localmodconfig is to plug in once, every USB device ever used, before running it. Still, I think I’d use the new local .config as a diff reference point.

1 Like