Adding Kernel Arguments for My AMD Laptop

August 2, 2021
2 minutes

I’ve been using Fedora for a while, and enjoying it for the most part. I did a clean install for Fedora 34 so that I could try out moving from EXT4 to ButterFS.

I’ve also been using the Sway Window Manager for a while, and been enjoying adapting to the new workflow.

One issue I’ve been having recently is random freezes while playing video games or watching videos through Firefox. I jumped on the IRC channel on Libera Chat for suggestions, and the folks there said it looked like it was more of a kernel issue rather than a Sway issue. They recommended that I revert back to a working kernel.

Uh oh. With a rolling release, I haven’t been paying attention to version numbers as the kernel gets updated probably every week. I wasn’t even too sure how to pick a specific kernel and roll back to it. I let it go for a while, as it happened only sporadicalliy.

After getting fed up with another freeze, I decided to search for “linux ryzen 3500U randomly freezes” on DuckDuckGo. This led to an Arch forums where someone suggested to look through the logs with:

journalctl |grep -i "hardware err"

Grep results came up blank… I thought to be less restrictive and search for just err instead.

A lot of errors came up, but since I recently froze up, I looked near the bottom of the list. I saw this:

kernel: [drm:amdgpu_job_timedout [amdgpu]] *ERROR* ring gfx timeout, but soft recovered

This does look like it! So, doing another DuckDuckGo search with that resulted in another Arch forums link that recommended a fix by adding a kernel parameter iommu=pt

It was worth a shot! Now, how do I add kernel parameters? More searching yielded a helpful article on Fedora Magazine. Essentially you use grubby to add the parameters needed. Simple enough. To identify the kernel I was using, I used sudo grubby --default-kernel. After that, the command to commit the change was:

sudo grubby --update-kernel=/boot/vmlinuz-5.13.5-200.fc34.x86_64 --args="iommu=pt"

I rebooted and hoped for the best. I was personally a bit glad that it did boot up as normal and that I didn’t horribly botch up my system modifying kernel arguments. I gave it a test run by running some Civilization VI on Steam. After a few hours, no lock up. I’m cautiously optimistic that this is a success.

Day 14 of 100 of #100DaystoOffload