Couple of years ago, while sitting around waiting for some virus to peter out, I decided to do a major hardware upgrade on my main desktop. CPU was Ryzen 5 1600AF (2nd gen, 12nm, slightly detuned 2600) which for about $100 was amazing. Add a B450M motherboard from Aorus (Gigabyte) and 16GB RAM and I was away.
Performance was great, but there were occasional glitches, mainly DE freezes. Over time the freezes and crashes extended to other programs, Firefox being the worst but LibreOffice and various others. Absolutely no clues in any logs though. It was as though I'd simply turned off the power switch. That was using Bullseye. Bookworm was even worse. By late last week the computer was essentially unusable and I started thinking about selling and and going to (Shock! Horror!) Intel. Didn't want to but decided to have one last go at finding out why.
Already done the CPU cleaning and reseating the cooler plus cleaning the whole inside of the box, remove and reseat every single connection, compressed air and contact cleaner wash. Determined Googling did yield some hits, as it had before, but no-one really knew what the problem was and because it only happens in Linux....well there weren't that many affected. But this time there were a few more than last time.
From what I can gather the problem affects various Ryzen CPUs (no definitive list that I could find) and seems to happen when the CPU's been idle for a little while. When asked to do something it jumps up and falls flat on its face. (Technical jargon). In Firefox the tab crashes, in other programs the program crashes and sometimes the whole desktop freezes needing a power off restart. Sometimes Firefox tabs will crash 6-8 times and then remain stable for an hour. Completely unpredictable and impossible to recreate. And, ZERO, ZILCH, NOTHING, NADA in any log file.
There were some clues though in my searches. One was to prevent the CPU from going into a full idle state by adjusting voltages and another mentioned the C6 state. So it was worth trying some of the suggestions.
First loaded the latest BIOS from Gigabyte. Didn't make any difference but there are lots more settings there to play with.
The got down to actually changing settings.
SVM Mode - Enabled
Power Loading - Enabled
CEC2019Ready - Disabled
ERP - Enabled
Global C State - Auto
IOMMU - Disabled
Pity about the IOMMU setting because I'd become somewhat used to not having to chroot to reconfigure GRUB every time, but changing one of the other settings forced a return to the old way. The Auto setting for Global C State was a bit of a surprise - I expected that Disabled would work, but it didn't.
Different BIOS's will have different settings so best just to take what I've done as indicative.
So, how does it go? Well, I've been using it for 3 days with not a single crash or freeze in either Bullseye or Bookworm, both with KDE Plasma. Over the moon happy.
What I'm kind of hoping here is that others with the same problem might chime in with their experiences and we can build a little knowledge base here, on something that is pretty sparsely documented elsewhere.
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Crashes and freezes in Linux with (some) Ryzen CPUs
-
- Posts: 7
- Joined: 2023-07-19 22:43
Re: Crashes and freezes in Linux with (some) Ryzen CPUs
Why didn't you examine a few of your Linux log files for an error code? Your problem may not be hardware specific, unless AMD has published comments related to your CPU and Linux. (and perhaps your mobo vendor). And you didn't mention your present kernel version? If I were you, I'd backup the existing system drive, then perform a clean O/S install, using the latest version of Debian 12. Also, it sounds to me like your A/C power source may have some hiccups. You might want to purchase a simple power tester for your wall outlet and see if you're getting 'clean' power, and if your PSU supports a removeable power cord, purchase a hospital grade A/C power cord and connectors, and plug that in, instead of the default one that came with your PSU. You may be surprised.
-
- df -h | grep > 20TiB
- Posts: 1418
- Joined: 2012-10-06 05:31
- Location: /dev/chair
- Has thanked: 80 times
- Been thanked: 191 times
Re: Crashes and freezes in Linux with (some) Ryzen CPUs
There is a long history of issues regarding ryzen and power management (particularly c-state) bugs, as even a cursory websearch will reveal. It's also possible this is a memory stability problem, something ryzen is also fairly well known for.flatroncom wrote: ↑2023-10-09 22:05Your problem may not be hardware specific, unless AMD has published comments related to your CPU and Linux.
Given the large number of reports regarding GNU/Linux on ryzen and power-management / idle-transition bugs, I'd absolutely consider this the most likely avenue to pursue... Especially as fiddling with MMU and sleep-state settings in BIOS have apparently solved it.
Unless the power cable is actually defective, this is almost certainly a waste of time and money. No fancy "hospital grade" power cable will fix a poor supply, that's what UPS and filters are for.flatroncom wrote: ↑2023-10-09 22:05if your PSU supports a removeable power cord, purchase a hospital grade A/C power cord and connectors, and plug that in, instead of the default one that came with your PSU.
Modern switchmode power supplies (with active PFC) are extremely tolerant of input voltage fluctuations anyway.
Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.
- NFT5
- df -h | grep > 20TiB
- Posts: 598
- Joined: 2014-10-10 11:38
- Location: Canberra, Australia
- Has thanked: 10 times
- Been thanked: 43 times
Re: Crashes and freezes in Linux with (some) Ryzen CPUs
Appreciate your response, but.....
I live in Australia and in the capital city, Canberra. Power here is about as clean and plentiful as you'd get because we couldn't have the government running out. Domestic supply is 240V and the owner of the house, before me, was an electrician so multiple extra circuits and power points. Better than you'd get in a new home. When I rebuilt the PC I did actually change the PSU for a brand new Cooler Master 650W unit. This PC only has a GT710 graphics card so the PSU is probably way overspecced. Power leads here have to meet Australian Standards but even a standard 10A lead will carry 3-4 times what the PC will draw. Valid point, though.
flatroncom wrote: ↑2023-10-09 22:05 Why didn't you examine a few of your Linux log files for an error code?
flatroncom wrote: ↑2023-10-09 22:05 Your problem may not be hardware specific, unless AMD has published comments related to your CPU and Linux.
True, I didn't. Kernel is current stable 6.1.13.
Again, true, I didn't mention that I had done a fresh installation of Bookworm. But I did. Didn't make any difference and Bullseye was still suffering from the problem, until I updated the BIOS settings.flatroncom wrote: ↑2023-10-09 22:05 I'd backup the existing system drive, then perform a clean O/S install, using the latest version of Debian 12.
I live in Australia and in the capital city, Canberra. Power here is about as clean and plentiful as you'd get because we couldn't have the government running out. Domestic supply is 240V and the owner of the house, before me, was an electrician so multiple extra circuits and power points. Better than you'd get in a new home. When I rebuilt the PC I did actually change the PSU for a brand new Cooler Master 650W unit. This PC only has a GT710 graphics card so the PSU is probably way overspecced. Power leads here have to meet Australian Standards but even a standard 10A lead will carry 3-4 times what the PC will draw. Valid point, though.
Re: Crashes and freezes in Linux with (some) Ryzen CPUs
I have a similar issue, and I am using a 3950x. My system is ultra stable right after boot and for days, but it crashes when I try to handle images in a large directory with "Rawtherapee". The computer just shuts down, no signs of a crash in any log file, much like yours. Its as if someone pulls the power plug.
I've checked the rest of the system, but I've not tweaked any BIOS settings yet. However, I never had to tinker with any BIOS settings with any Intel based system in the past.
At this stage, this is my third AMD CPU after a rough ride with the 2950 TR, that I even RMA'd, but was just unstable and would randomly freeze.
At this point, I'm out of patience trying to debug this, so I'm considering switching over to Intel. Its just not worth it.
I've checked the rest of the system, but I've not tweaked any BIOS settings yet. However, I never had to tinker with any BIOS settings with any Intel based system in the past.
At this stage, this is my third AMD CPU after a rough ride with the 2950 TR, that I even RMA'd, but was just unstable and would randomly freeze.
At this point, I'm out of patience trying to debug this, so I'm considering switching over to Intel. Its just not worth it.
- NFT5
- df -h | grep > 20TiB
- Posts: 598
- Joined: 2014-10-10 11:38
- Location: Canberra, Australia
- Has thanked: 10 times
- Been thanked: 43 times
Re: Crashes and freezes in Linux with (some) Ryzen CPUs
It pains me to say so, but I'm leaning the same way, in thought anyway. I've been a staunch supporter of AMD since the 386DX40 which blitzed Intel's 486SX25. Similar situation when the Pentium came out and then all the way through to a few machines I have which have which have FX CPUs, including the awesome FX-8350 Black which is quite close to the Ryzen in everyday use, but just chews a lot more power. I built machines 10 years ago with FX-4350 CPUs that are still going strong. My notebook is a 7th Gen A9 and I even have an Athlon specifically set up for audio file work.
One thing I've done since my earlier post is to change the Global C State setting to off, rather than auto. I was getting occasional recurrences of the problem but since that change it has been absolutely rock solid. The only exception is Firefox which crashes repeatedly after running without problem for hours. Program crashes only, not desktop. Pretty sure this is just Firefox related though - doesn't happen with other browsers but I haven't really investigated it yet.
Re: Crashes and freezes in Linux with (some) Ryzen CPUs
One thing I should've mentioned: when my computer crashes, the "CPU debug" light on my motherboard lights up (red). The same happens when I input incorrect memory frequency/timings (quick fix: CMOS reset). Do you also observe something similar?NFT5 wrote: ↑2024-03-08 01:15It pains me to say so, but I'm leaning the same way, in thought anyway. I've been a staunch supporter of AMD since the 386DX40 which blitzed Intel's 486SX25. Similar situation when the Pentium came out and then all the way through to a few machines I have which have which have FX CPUs, including the awesome FX-8350 Black which is quite close to the Ryzen in everyday use, but just chews a lot more power. I built machines 10 years ago with FX-4350 CPUs that are still going strong. My notebook is a 7th Gen A9 and I even have an Athlon specifically set up for audio file work.
One thing I've done since my earlier post is to change the Global C State setting to off, rather than auto. I was getting occasional recurrences of the problem but since that change it has been absolutely rock solid. The only exception is Firefox which crashes repeatedly after running without problem for hours. Program crashes only, not desktop. Pretty sure this is just Firefox related though - doesn't happen with other browsers but I haven't really investigated it yet.
So far, I've tried:
- New DIMM sticks.
New PSU.
- CPU
Motherboard
Kernel
Last edited by aamwgm on 2024-03-25 07:15, edited 2 times in total.