Mistakes were made!

mistake

Intel introduced a bug in their 6th and 7th Gen Core CPUs. Frigate NVR uses AVX for object detection calculations. But these CPUs can still be used.

If your bios has a setting to disable Multithreading/Hyperthreading then you can set that to disabled. This will decrease the chances of freezing. In my case my motherboard did not have the option in the bios so i had to resort to Linux to disable it. here’s how…

echo off | sudo tee /sys/devices/system/cpu/smt/control

Run above code in a terminal to turn off Multithreading/Hyperthreading from the OS level.
Alternatively you can disable Multithreading/Hyperthreading from the kernel level

sudo nano /etc/default/grub

find the line...
GRUB_CMDLINE_LINUX_DEFAULT="quiet")
and change it to...
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nosmt"). 

The one disadvantage of this method is that your usage during any operation will double.
If you idled at 20% it will now be 40%. The temperatures will remain in the same region as before. Might even be slightly cooler while running.


Here’s some more info regarding the bug

The Intel Skylake bug (also known as the Skylake “LOCK” prefix bug or Skylake hyper-threading erratum) was a hardware issue affecting certain Intel Skylake-family processors (6th and 7th Gen Core CPUs, including Kaby Lake). This bug could cause the system to freeze or become unresponsive when executing highly complex operations under specific conditions.

Root Cause

The issue was related to how the CPU handled memory accesses with the LOCK prefix (used for atomic operations) in conjunction with complex micro-op sequences (such as those generated by AVX/AVX2 instructions, heavy branch prediction, or deeply pipelined operations).

When the processor encountered a specific sequence of:

  1. LOCK-prefixed instruction (e.g., LOCK CMPXCHG),
  2. Followed by a long stream of complex micro-ops (e.g., from AVX, FMA, or deeply speculative execution),
    the CPU could enter a deadlock or livelock state, causing the system to freeze.

Affected Scenarios

  • Heavy AVX/AVX2 workloads (common in scientific computing, encryption, or rendering).
  • Hyper-Threading (SMT) enabled, as the bug was more likely to trigger when multiple threads competed for execution resources.
  • Certain compiler-generated code that mixed atomic operations with complex instruction sequences.

Symptoms

  • System freezing (requiring a hard reboot).
  • Kernel panics (in Linux/BSD).
  • Application crashes (if the OS detected the hang and killed the process).

I am currently testing a system with this same issue, microcode has been updated to 3.2.
I disabled Multithreading using the above method. The result was with 8 cameras and many people that the CPU usage would go up to 100%, leaving little room for home assistant to execute it’s operations.
My work around for this was to limit Frigate’s docker container to only use 3 CPUs. This resulted in Frigate’s maximum allowed CPU usage to 75% and leaving 25% for the rest of the system.
Basically with my i7-6700 this would be 3 cores for Frigate and 1 core for the rest of the system.
As of now 19:45 29/03/2025 this is being tested if the freezing continues or not.
Update: 21:01 30/03/2025 Freeze again. Time for more optimization.

Similar Posts

Leave a Reply