3

I have a ryzen cpu and my cpu has been freezing/crashing a lot over the years and I couldnt' find a solution until recently and I'm told setting the max_cstate should solve my issue.

But how do I check if I set processor.max_cstate correctly from the terminal/tilix?

Current cpu: AMD Ryzen 3 1200 Quad-Core Processor

OS: Ubuntu Desktop 20.04

exts
  • 131
  • 1
  • 4
  • Another way to fix it that helped me would be to disable "Automatic C-State Management" in the BIOS. – Sebastian May 22 '20 at 13:53
  • I only know how, when intel_idle is the driver, but maybe similar methods, with your driver name or "max_state" keyword would work for you. – Doug Smythies May 22 '20 at 14:12
  • I would wait till you have an answer from someone with the same CPU. Should list the CPU in your question, before mixing an Intel answer with a AMD. Here is a google search that might help. https://www.google.com/search?client=ubuntu&channel=fs&q=ubuntu+ryzen+c-state&ie=utf-8&oe=utf-8 Usually to check you would just need to do the same command that you did to add the the change, or wait to see if problem disappears. – crip659 May 22 '20 at 14:22
  • I added my current cpu to my post, but yeah I just want to know if I correctly set processor.max_cstate correctly by verifying that it's set via terminal (if that's possible) – exts May 22 '20 at 14:42
  • i only referred to my post for the checking part, not to suggest the setting part, which I agree was intel specific. – Doug Smythies May 22 '20 at 14:43
  • If it is done by grub setting/adding to, then should just need to repeat how you did it(without changing) and see if it stays after reboot. Don't know if Linux can check bios settings once loaded/running. – crip659 May 22 '20 at 15:27
  • Which Linux distro have you installed (Ubuntu server, Ubuntu desktop, Kubuntu, Lubuntu, Xubuntu, Ubuntu MATE, Mint, et al.), & which release number? Different releases have different tools for us to recommend. Please click [edit] & add that to your question, so all facts we need are in the question. Please don't use Add Comment, since that's our one-way channel to you. All facts about your PC should go in the Question with [edit] – K7AAY May 22 '20 at 15:44

1 Answers1

3

You can check the number of idle states your system currently supports by examination. Example 1 (limitation in place):

~$ grep . /sys/devices/system/cpu/cpu0/cpuidle/state*/name
/sys/devices/system/cpu/cpu0/cpuidle/state0/name:POLL
/sys/devices/system/cpu/cpu0/cpuidle/state1/name:C1

Example 2 (same computer, no limitation):

$ grep . /sys/devices/system/cpu/cpu0/cpuidle/state*/name
/sys/devices/system/cpu/cpu0/cpuidle/state0/name:POLL
/sys/devices/system/cpu/cpu0/cpuidle/state1/name:C1
/sys/devices/system/cpu/cpu0/cpuidle/state2/name:C1E
/sys/devices/system/cpu/cpu0/cpuidle/state3/name:C3
/sys/devices/system/cpu/cpu0/cpuidle/state4/name:C6
/sys/devices/system/cpu/cpu0/cpuidle/state5/name:C7s
/sys/devices/system/cpu/cpu0/cpuidle/state6/name:C8
/sys/devices/system/cpu/cpu0/cpuidle/state7/name:C9
/sys/devices/system/cpu/cpu0/cpuidle/state8/name:C10

Just make the cpu number a wildcard if you want the list for everything (typically the same for each CPU).

Doug Smythies
  • 15,448
  • 5
  • 44
  • 61
  • so if I ran that command and it says no such file, does that mean max_cstate = 1 is working correctly? – exts May 23 '20 at 23:05