System random freeze

there was a system freeze last month and then the screen went black and I was forced to restart by the power button, what I was able to notice is that it's kind of random, sometimes it hangs during the game or browsing the internet, sometimes with a few hours of use and sometimes with more than consecutive days direct connected happens

inxi --full --verbosity=7 --filter --no-host
System:    Kernel: 5.6.16-1-MANJARO x86_64 bits: 64 compiler: gcc v: 10.1.0 Desktop: KDE Plasma 5.18.5 tk: Qt 5.15.0 
           wm: kwin_x11 dm: SDDM Distro: Manjaro Linux 
Machine:   Type: Desktop Mobo: Gigabyte model: AX370-Gaming 5 serial: <filter> UEFI: American Megatrends v: F50a 
           date: 11/27/2019 
Memory:    RAM: total: 31.37 GiB used: 2.53 GiB (8.1%) 
           RAM Report: permissions: Unable to run dmidecode. Root privileges required. 
CPU:       Topology: 8-Core model: AMD Ryzen 7 1700X bits: 64 type: MT MCP arch: Zen rev: 1 L2 cache: 4096 KiB 
           bogomips: 108624 
           Speed: 3490 MHz min/max: N/A Core speeds (MHz): 1: 3490 2: 3509 3: 3494 4: 3492 5: 3508 6: 3491 7: 3493 8: 3490 
           9: 3493 10: 3467 11: 3478 12: 3489 13: 3457 14: 3493 15: 3478 16: 3489 
           Flags: 3dnowprefetch abm adx aes aperfmperf apic arat avic avx avx2 bmi1 bmi2 bpext clflush clflushopt clzero cmov 
           cmp_legacy constant_tsc cpb cpuid cr8_legacy cx16 cx8 de decodeassists extapic extd_apicid f16c flushbyasid fma fpu 
           fsgsbase fxsr fxsr_opt ht hw_pstate ibpb irperf lahf_lm lbrv lm mca mce misalignsse mmx mmxext monitor movbe msr 
           mtrr mwaitx nonstop_tsc nopl npt nrip_save nx osvw overflow_recov pae pat pausefilter pclmulqdq pdpe1gb 
           perfctr_core perfctr_llc perfctr_nb pfthreshold pge pni popcnt pse pse36 rdrand rdseed rdtscp rep_good sep sev 
           sha_ni skinit smap smca sme smep ssbd sse sse2 sse4_1 sse4_2 sse4a ssse3 succor svm svm_lock syscall tce topoext 
           tsc tsc_scale v_vmsave_vmload vgif vmcb_clean vme vmmcall wdt xgetbv1 xsave xsavec xsaveerptr xsaveopt xsaves 
Graphics:  Device-1: Advanced Micro Devices [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X/590] 
           vendor: Micro-Star MSI driver: amdgpu v: kernel bus ID: 07:00.0 chip ID: 1002:67df 
           Display: x11 server: X.Org 1.20.8 driver: amdgpu FAILED: ati unloaded: modesetting alternate: fbdev,vesa 
           compositor: kwin_x11 tty: N/A 
           OpenGL: renderer: Radeon RX 580 Series (POLARIS10 DRM 3.36.0 5.6.16-1-MANJARO LLVM 10.0.0) v: 4.6 Mesa 20.0.7 
           direct render: Yes 
Audio:     Device-1: AMD Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590] vendor: Micro-Star MSI driver: snd_hda_intel 
           v: kernel bus ID: 07:00.1 chip ID: 1002:aaf0 
           Device-2: Advanced Micro Devices [AMD] Family 17h HD Audio vendor: Gigabyte driver: snd_hda_intel v: kernel 
           bus ID: 09:00.3 chip ID: 1022:1457 
           Sound Server: ALSA v: k5.6.16-1-MANJARO 
Network:   Device-1: Intel I211 Gigabit Network vendor: Gigabyte driver: igb v: 5.6.0-k port: e000 bus ID: 04:00.0 
           chip ID: 8086:1539 
           IF: enp4s0 state: up speed: 1000 Mbps duplex: full mac: <filter> 
           IP v4: <filter> type: dynamic noprefixroute scope: global broadcast: <filter> 
           IP v6: <filter> type: noprefixroute scope: link 
           Device-2: Qualcomm Atheros Killer E2500 Gigabit Ethernet vendor: Gigabyte driver: alx v: kernel port: d000 
           bus ID: 05:00.0 chip ID: 1969:e0b1 
           IF: enp5s0 state: down mac: <filter> 
           WAN IP: <filter> 
Drives:    Local Storage: total: 3.64 TiB used: 2.21 TiB (60.8%) 
           ID-1: /dev/sda vendor: Crucial model: CT1000MX500SSD1 size: 931.51 GiB speed: 6.0 Gb/s serial: <filter> rev: 023 
           scheme: GPT 
           ID-2: /dev/sdb vendor: Western Digital model: WD30EZRX-00DC0B0 size: 2.73 TiB speed: 6.0 Gb/s serial: <filter> 
           rev: 0A80 scheme: GPT 
           Message: No Optical or Floppy data was found. 
RAID:      Message: No RAID data was found. 
Partition: ID-1: / size: 95.62 GiB used: 13.51 GiB (14.1%) fs: ext4 dev: /dev/sda1 label: N/A 
           uuid: 361ac6d3-2d70-4e5e-a96b-bf24a0dbe767 
           ID-2: /DATA size: 2.69 TiB used: 2.00 TiB (74.5%) fs: ext4 dev: /dev/sdb1 label: DATA 
           uuid: 4b079c75-3913-4238-980e-718208d9e972 
           ID-3: /boot/efi size: 500.0 MiB used: 280 KiB (0.1%) fs: vfat dev: /dev/sda3 label: N/A uuid: E450-AA79 
           ID-4: /home size: 819.29 GiB used: 202.80 GiB (24.8%) fs: ext4 dev: /dev/sda2 label: N/A 
           uuid: f0f6afa9-7bde-4122-927a-55558c1a77d8 
Unmounted: Message: No unmounted partitions found. 
USB:       Hub: 1-0:1 info: Full speed (or root) Hub ports: 14 rev: 2.0 speed: 480 Mb/s chip ID: 1d6b:0002 
           Device-1: 1-7:2 info: Corsair Vengeance 2100 Headset Battery Charger type: HID driver: hid-generic,usbhid 
           interfaces: 1 rev: 1.1 speed: 12 Mb/s chip ID: 1b1c:0a0b 
           Hub: 2-0:1 info: Full speed (or root) Hub ports: 8 rev: 3.1 speed: 10 Gb/s chip ID: 1d6b:0003 
           Hub: 3-0:1 info: Full speed (or root) Hub ports: 2 rev: 2.0 speed: 480 Mb/s chip ID: 1d6b:0002 
           Hub: 4-0:1 info: Full speed (or root) Hub ports: 2 rev: 3.1 speed: 10 Gb/s chip ID: 1d6b:0003 
           Hub: 5-0:1 info: Full speed (or root) Hub ports: 4 rev: 2.0 speed: 480 Mb/s chip ID: 1d6b:0002 
           Device-2: 5-1:2 info: Logitech G502 HERO Gaming Mouse type: Mouse,HID driver: hid-generic,usbhid interfaces: 2 
           rev: 2.0 speed: 12 Mb/s chip ID: 046d:c08b serial: <filter> 
           Device-3: 5-2:3 info: Microdia USB DEVICE type: Keyboard,Mouse driver: hid-generic,usbhid interfaces: 2 rev: 2.0 
           speed: 12 Mb/s chip ID: 0c45:8502 
           Hub: 6-0:1 info: Full speed (or root) Hub ports: 4 rev: 3.0 speed: 5 Gb/s chip ID: 1d6b:0003 
Sensors:   System Temperatures: cpu: 41.5 C mobo: N/A gpu: amdgpu temp: 35 C 
           Fan Speeds (RPM): N/A gpu: amdgpu fan: 1106 
Info:      Processes: 327 Uptime: 18h 52m Init: systemd v: 245 Compilers: gcc: 10.1.0 Shell: bash v: 5.0.17 
           running in: konsole inxi: 3.0.37

I have a Ryzen CPU too (Ryzen 5 1600 to be exact) and I've had both Ubuntu and Manjaro freeze on me in the past. But a couple months ago, I basically eliminated them per instructions in the below link, and I haven't gotten freezing since:

It's worth giving them a shot if you haven't tried these yet.

I tested the tip, but the zenstates part I didn't know how to do, but I'll see if with the parameters in the kernel they solve

@Momotaros
I guess I will just format that output for you. Please excuse my reach.
..oh and its a different command than what is asked for. I dont know why you did that, but now you posted a bunch of partition info and UUIDs and such but didnt provide memory information...

I would probably go with these instead:

iommu=pt idle=nomwait

(pt is preferred as it will use HW when possible, and SW when needed)

If freezes persist .. instead of the zenstate I would probably do something like this:

rcu_nocbs=0-7

(assuming it is an 8-thread cpu .. 0-15 is 16 threads, etc)

Of course you probably want to check for updates to your BIOS.
And other kernels is sometimes a good idea.

And then if there is still trouble I would resort to zenstate change (or max cstate).

then it would be better to leave iommu = en? and the part that you quote rcu_nocbs = 0-7 I put next to the command idle = nomwait?
my bios is the last one and everything related to c6 I disabled it, I just didn’t understand the part of doing this for zenstates, if you can explain it to me I appreciate it

The line would look something like this:

GRUB_CMDLINE_LINUX="iommu=pt idle=nomwait rcu_nocbs=0-7 

(again assuming you have 8 threads ... like mine is 4 cores at 2 threads each so 8)

Then you must run

sudo update-grub

As for the zen thing above .. well lets see if you actually need it first.
If you keep getting freezes we will walk through it with you.

1 Like

I will apply the changes here, but as my CPU is a ryzen 7 1700x should I leave the rcu_nocbs = 0-15?

I dont know.. if its 8 cores and 2 threads each then yes.
there are a few ways to check ..
run top then hit 1 ... you should see cpus 0-# .. use that (exit top with q)

Your problem could also be this:

I applied the previous tip and I’ll see if it gives the result, if it doesn’t solve I test your tip, thanks for the help

so far it has not frozen the system but I noticed that the monitor does not turn off even though the pc is idle

1 Like

Interesting.
You can try switching the above (iommu=soft), or you might want to add.
I will show you an example of mine on a ryzen machine.

GRUB_CMDLINE_LINUX="sysrq_always_enable=1 ivrs_ioapic[4]=00:14.0 ivrs_ioapic[5]=00:00.2 iommu=pt idle=nomwait acpi_backlight=vendor acpi_enforce_resources=lax rcu_nocbs=0-15 scsi_mod.use_blk_mq=1 nowatchdog module_blacklist=kvm"

(but note that a number of these dont apply - the ioapic things are very hardware specific and others have to do with personal options)

What might be interesting to you are:

backlight=vendor acpi_enforce_resources=lax

I went to apply your tip and when I turned on the pc the automatic screen shutdown when the pc is idle returned to work, now that the system seems to be perfect I will keep it up for now :+1:

Sorry, I didnt follow - it works without backlight=vendor .. ?
Or it now works because you added it?

I turned on the pc to add and test, but when I saw it was working, if there is no need I will leave it at that. Thank you for your help

just to update, manjaro updated these days and the modifications I made to solve my problem ended up being: GRUB_CMDLINE_LINUX_DEFAULT="quiet apparmor=1 security=apparmor udev.log_priority=3 iommu=pt idle=nomwait rcu_nocbs=0-15"

before it was in:
GRUB_CMDLINE_LINUX="iommu=pt idle=nomwait rcu_nocbs=0-15
is there a problem or can I leave it at that?

It doesnt matter which line it is on really
(though there are a few options that can be picky about order)
I personally prefer to leave the DEFAULT line alone and add all my changes to the second one.
But maybe you want to keep everything 'known good' on the first one.
Its up to you in the end. :slight_smile:

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by