Intel AlderLake/Rocketlake AVX-512 Enable/Disable

Hello. Some motherboards for AlderLake 12th Gen CPUs dont have option to enable AVX-512 when all E-Cores are disabled (currently, only ASUS and ASRock BIOS allow this). If you are eager enough to mess with it, you’ll need to find UEFI module which modifies 0x000000AF MSR contents (yes, its undocumented MSR for disabling various AVX features). In case of Gigabyte, modules you need to patch is GenericComponentPeiEntry and SiInitFsp. Bit0 for disabling both AVX2 and AVX-512 features, Bit1 is for AVX-512 disabling. So, if you have 0xAF=0x2, then only AVX-512 is disabled. Here is example of patching needed for both modules for Z690 based Gigabyte motherboard (beware, you need to disable E-Cores before flashing modified BIOS):
1) GenericComponentPeiEntry changes:
LAB_0000d738 XREF[1]: 0000d72a (j)
0000d738 0f b7 c6 MOVZX EAX ,SI
0000d73b 83 e2 fc AND EDX ,0xfffffffc
0000d73e 03 c0 ADD EAX ,EAX
0000d740 0b c2 OR EAX ,EDX
0000d742 0b c7 OR EAX ,EDI
0000d744 83 e0 03 AND EAX ,0x3
0000d747 83 65 f4 AND dword ptr [EBP + local_10 ],0x0
00
0000d74b 89 45 f0 MOV dword ptr [EBP + local_14 ],EAX
0000d74e b9 af 00 MOV ECX ,0xaf
00 00
0000d753 8b 55 f4 MOV EDX ,dword ptr [EBP + local_10 ]
0000d756 8b 45 f0 MOV EAX ,dword ptr [EBP + local_14 ]
0000d759 0f 30 WRMSR

Change 83 e0 03 AND EAX ,0x3 to 83 e0 00 AND EAX ,0x3

2) SiInitFsp
00003be9 55 PUSH EBP
00003bea 8b ec MOV EBP ,ESP
00003bec 51 PUSH ECX
00003bed 6a 00 PUSH 0x0
00003bef 8d 45 fc LEA EAX => local_8 ,[EBP + -0x4 ]
00003bf2 33 c9 XOR ECX ,ECX
00003bf4 50 PUSH EAX
00003bf5 6a 00 PUSH 0x0
00003bf7 33 d2 XOR EDX ,EDX
00003bf9 41 INC ECX
00003bfa e8 23 3c CALL
00003bff 8b 45 fc MOV EAX ,dword ptr [EBP + local_8 ]
00003c02 83 c4 0c ADD ESP ,0xc
00003c05 c1 e8 1a SHR EAX ,0x1a
00003c08 24 01 AND AL ,0x1
00003c0a 8b e5 MOV ESP ,EBP
00003c0c 5d POP EBP
00003c0d c3 RET

Change 24 01 AND AL ,0x1 to B0 00 MOV AL ,0x0

Few more hints:
1) Gigabyte Q-Flash+ on Z690 boards could flash your modified BIOS
2) I had success with GenericComponentPeiEntry module replacement only with MMTools, all the images made by UEFITool made system non-bootable
3) I would recommend setting up all the bios settings, then use Q-Flash BIOS tool to backup your current bios, then modify it with those patches. Backup made with Q-Flash has your actual bios settings inside.


WBR, Mike

2 Likes

What happens if you don’t?
Is it just that an AVX512 enabled application would crash if it gets scheduled on an E-Core (that could be solved by cpuset / sched_setaffinity or even the Kernel itself as it already keeps track of AVX using processes) or is there something else that requires E-Cores to be disabled?

If you wont disable E-cores - there would be no POST. Thats why I modded backup made by Qflash from bios, so my nvram settings were intact.

What version of mmtool are you using?
Q-Flash refuses to flash, says "Invalid ROM Image"…

Thanks!

  1. You need that "emergency" q-flash button flasher via USB stick
    2) I used MMTool_v5.02.0025.exe

Is it possible to also set the ecores to disable while enabling avx512, so that it becomes default and there is no risk i ncase of bios reset? Will this work with CPUs like i5 12500 even though they are coming out later?
Thanks!

This could be very actual topic alter last bios updates.

Do you think it can be possible to enable it for gigabyte b660m?

I did dumps with on and off avx option, made a binary comparison and, found that 7076 total bytes are not the same. I thought that it should be just one or few bytes :slight_smile:


forgot to mention that I have 12600 non-K

Hi. Anyone knows if microcode 15 covers all alder lake cpu?

Thanks

Edit. yes, it does.

1 Like

Hey!
I did these manipulations with Bios, but avx512 did not appear. Bigabyte B660M DS3H DDR4, Bios F4, 12400F.
Can anyone help me?
Thanks!

@Andy33 Can’t seem to find that bios on gigabyte website.

Have you tried cpuz to see if it shows avx512f?

@bugmenot1 Hey!
bios can be downloaded manually by editing the link a little;
at the end of the link, for example, replace …f5.zip with …f4.zip
Cpuz doesn’t show avx512.
Thanks

Hi. Check if cpu using microcode 15. You can check that on bios cpu info. Or with windows tools like Intel processor identification utility.

If you are running microcode 15, something in the bios mod must be wrong.

@bugmenot1
MMTool shows microcode 15

I have the Gigabyte Z690i AORUS ULTRA DDR4 motherboard and I just tried the BIOS mod you listed above. I patched both the F3 and F6 BIOS from the Gigabyte website and unfortunately both attempts were unsuccessful (no AVX-512 option in BIOS). I checked very carefully that I was patching the specified modules in the right place. And I used MMTool_v5.02.0025 for both extraction and replace/insertion. I used UltraEdit in HEX mode to overwrite the module. Also used the Q-Flash button and the dedicated BIOS USB port on the back panel.

The CPU I have is the i3 12100f which has a CPU revision of 13. The only variable I don’t know is the manufacture date of the CPU. And I don’t want to take the fan/heatsink to off to check as it’s in a very cramped ITX case. There’s a slight chance that it was manufactured very recently and the AVX-512 section has been fused off. I’ll call the place of purchase tomorrow and ask one of the salesman to read some details from the same CPU in a box with the same batch number. I’m confident it hasn’t been fused off personally.

Has anyone out there successfully patched this particular board?

It’s very interesting how it ends. I have a similar issue with Gigabyte B660M and 12400F. After a failed attempt with this patch, I began to dig deeper. I found and fixed all other modules where there is an entry in MSR 0xAF. Also I wrote my code snippet in BIOS. To a free space. My code shows that MSR 0xAF = 0. CPUID (EAX=0xD) returns 0x0207, i.e. bits 5,6,7 = 0, i.e. AVX512 is not supported. However, CPUID (EAX=0x7) returns EBX(bit 16) = 1, i.e. AVX512 is supported. This is a contradiction. Trying to set XCR0 (bits 5,6,7) causes the BIOS to hang.


I forgot to say. I tried microcodes for CPU 09672: 9, D, 12, 13, 15. All without a positive result.

Thanks!

Okay, well I took a punt on purchasing another i3 12100f CPU and it payed off! I now have AVX512 working with the patched F3 BIOS for my Gigabyte Z690i Aorus Ultra board. I just put the new chip in, loaded up Windows and checked in CPU-Z, and sure enough, AVX512F was present. I tested with some various AVX512 code I have written in VS2019 and can confirm 100% working!

As an added bonus, AVX512 runs noticeably cooler on Alder Lake than previous generation CPUs. Other CPUs I have that support AVX512 are, i7-9800x, i9-9940x, i5-1035G4 (mobile), i5-11400H (mobile) and i5-11400 (desktop). These previous gen CPUs are on par with AVX512 when tested at the same clock speeds. However Alder Lake is about a 2% to 3% improvement only.

Some might be confused as to why I put a budget chip in a higher end board! I actually ordered the Gigabyte Z590i Aorus Ultra online (which was on special for $199 down from $399) but received the Z690i of the same model instead by mistake. The Z690i was priced at $469 at its cheapest price down here in Oz at the time. So while I was trying to sell off the Z690i board and make a profit (as I read on reviews Alder Lake doesn’t support AVX512), I purchased another Z590i board because I wanted AVX512 support. Unfortunately, I had no interested buyers in the Z690i even for $300! But then I came across a reddit post that said AVX512 was available on certain Z690 boards (some needing modded BIOSs to work) so I decided to keep it. I saw great reviews on the i3 12100f CPU so I bought one to test for AVX512 functionality. Anyway, when you put the Gigabyte Z590i & Z690i boxes side by side, they’re identical except for the 5 & 6 in the model title! So it was a very easy mistake to make.

Excuse my digression…
As far as I can tell, it’s all about the batch numbers. The batch number is printed on the box and on the CPU itself. So if you lose your box, you can get the number printed on the heat spreader of the CPU.

The first i3 12100f I purchased had a batch number of X205K955 (X=Vietnam, 2=2022 and 05=05th week).
The AVX512 functionality has definitely been fused off from this CPU.

The second i3 12100f I purchased had a batch number of X137K562 (X=Vietnam, 1=2021 and 37=37th week).
According to a google search for images, week 36 of 2021 appears to be the first week of the i3 Alder lake batches. Another post I read somewhere (can’t recall the forum), said week 49 of 2021 was the cut-off week to have the highest chance of obtaining an Alder Lake CPU with working AVX512. There have been reports as late as week 51 of 2021 for an i7 Alder Lake and functioning AVX512. I would say the cut-off dates for Alder Lake i3, i5, i7 and i9 CPUs with AVX512 still intact is probably within a few weeks of each other. Perhaps someone could start a list!

On a final note, I am very impressed with how cool Alder Lake runs (i3 at least anyway). Intel has made some significant improvements finally going to the 10 nano fab for the desktop. I used to be an over-clocker on both CPUs and GPUs, but now (for the last 4 or 5 years or so) I’m an under-volter and prefer a cooler running efficient PC. I don’t see the logic in exponential power increase just to get an extra 10% to 20% performance from the system. Not to mention the increase in temperature. Although benchmarking for high score is okay!

Both i3 CPUs I have under-volt really well. On both CPUs I use a stable -0.120 volt dynamic offset. Running Prime95 with an all core turbo of 4.1GHz, peak wattage was measured at 54 watts using CoreTemp! Intel rates the 12th gen i3 TDP at 58 watts at its base speed of 3.3GHz and 89 watts at full turbo. On a final note, 12th Gen Alder Lake requires less voltage to hit the 4.0GHz clock speed than previous generations. On both the i3 12th Gen CPUs I have, only 0.9 vCore is required to be stable at 4.0GHz. With all previous 6th to 11th gen intel CPUs I’ve owned or have, 1.0 vCore was the minimum voltage I was able to use (on some CPUs) to hit a stable 4GHz clock speed.

Best of luck to anyone looking for working AVX512 on Alder Lake.
The proof is out there! :slight_smile:

In the end, I also had to replace my 12400F with a 12700 and, lo and behold, the AVX512 came out of a magician’s sleeve. An end, I hope, to all torment.
12700 on which the AVX512 runs was made in the first week of 2022.
12400F on which AVX512 does not work was made in the last week of 2021.
Thanks to iDontByte for the kick in the right direction.

1 Like

You need to check cpuz for avx 512, not bios.

hi, never modded a bios before. im stuck on patching the modules, i can only see hex and not like in the first post the line: 83 e0 03 AND EAX ,0x3

1 Like