Using microcode

My computer keeps crashing when trying to write a program that uses avx instructions, regardless which OS I am running this on. Its only on this PC and not on other computers.

Doing a bios update is no good as according to the manufacture:

they have made improvements for 5th gen cpu, mine is 4th gen so no good so I think I should try and use new microcode.

During installation of endeavourOS, there is a particular option under packages to check for microcode:

and I did not check this, however I wish to now install the microcode. however after running sudo pacman -S intel-ucode it seems like this is already isntalled.

after inspecting the /efi/loader/entries and one of its config files, it is this:

# Boot Loader Specification type#1 entry
# File created by /etc/kernel/install.d/90-loaderentry.install (systemd 254.1-1-arch)
title      Arch Linux
version    6.8.9-arch1-1
machine-id 84e567c911224a1cb85f57ee817f65ef
sort-key   endeavouros-6.8.9-arch1-1
options    nvme_load=YES nowatchdog rw root=UUID=0625a7eb-3830-4a3c-8bd7-161cec0770c6 systemd.machine_id=84e567c911224a1cb85f57ee817f65ef resume=/dev/sda4 radeon.cik_support=0 amdgpu.cik_support=1
linux      /84e567c911224a1cb85f57ee817f65ef/6.8.9-arch1-1/linux
initrd     /84e567c911224a1cb85f57ee817f65ef/6.8.9-arch1-1/initrd

After running journalctl -k --grep='microcode:' I am getting this output:

May 13 21:44:47 joe-z97xsoc kernel: microcode: Current revision: 0x00000028
May 13 21:44:47 joe-z97xsoc kernel: microcode: Updated early from: 0x00000017

I assume that initrd /84e567c911224a1cb85f57ee817f65ef/6.8.9-arch1-1/initrd is already using latest intel microcode and I don’t need to add this:

initrd /intel-ucode.img inside the file?

I would be surprised if the micro code has something to do with your problem.

And sometimes manufactures don’t always list all fixes in a bios release so discarding them because you have a older cpu is not a good idea. Bios updates are a risk however.

Start by testing your ram memory with memtest and or update your bios first.
Did you overclock cpu and or ram speeds?

To be fair I had this issue for many years even before I came to linux as I noticed something similar with handbrake application.

I guess I will have to find out if it has some updates for improvements on 4th gen cpu or not.

Yes that is why I don’t want to update if there are no fixes for 4th gen cpu.

already done that, passed the test.

Nope its all stock settings other than intel virtualization technology enabled and boot sequence changes.

Do I need to add initrd /intel-ucode.img inside the file?

I really don’t know, never dealt with this before.

maybe you can use mprime to stress test your system? if it crashes there is something wrong with your hardware/cpu. In that case i would risk update the bios as your system is already unstable/unusable?

have done plenty of stress tests, played video games for long time, no issues there, just with handbrake and my program that causes this. the second I run my program it will crash my computer.

can your report

cat /etc/mkinitcpio.conf 

see Mkinitcpio update and changes may need some manual intervention

interesting, are you sure your program is coded right? it seems to me that your program might contain a bug that crashes your cpu with a specific instruction?

cat: /etc/mkinitcpio.conf: No such file or directory

cause i am using systemd boot, not grub so this file won’t exist.

Program is coded right otherwise it should have affected two other computers that I have tested with. Its to do with the library, the library uses avx instructions and according to the maintainer he claims the cpu voltage slightly increases, so some stability issue there, and according to him he claims that if the specific instructions is incompatible, the program should terminate without crashing your entire computer.

well in that case i think this is a bug/flaw in the external library as the maintainer already claims instability?
And how come the cpu voltage increases? I can’t imagine that this library is causing that?

No, you don’t need that. The microcode is loaded into the initramfs, it doesn’t require separate loading.

turns out my motherboard’s current bios version doesn’t even support my cpu, though updated my bios causes my computer to not boot into any OS so I have to downgrade and keep it at this version for now.