Disable AVX for Kernel
rooots
Status: Interested
Joined: 17 May 2020
Posts: 43
Reply Quote
Hi all,

I'm running 5.6.0-13.1-liquorix-amd64 on a Core i7 8086k and would like to disable AVX alltogether for overclocking reasons.

There appear to be no specific command line parameters for the kernel to do that, so I tried building the kernel with AVX disabled, using

:: Code ::
make "KCFLAGS=-mno-avx -mno-avx2 -mno-avx512f -mno-avx512pf -mno-avx512er -mno-avx512cd" "KCPPFLAGS=-mno-avx -mno-avx2 -mno-avx512f -mno-avx512pf -mno-avx512er -mno-avx512cd" -j12 bindeb-pkg
.

However, this did not work as expected. Any suggestions how to solve this issue?


Cheers,
r.
Back to top
damentz
Status: Assistant
Joined: 09 Sep 2008
Posts: 1122
Reply Quote
Have you tried booting with noxsave? It looks like it clears some other CPU features so software that needs the other features may not work.

But as a side note, I don't think you need to worry about AVX. It's commonly used in stress testing and software that benefits hugely from it, which is already incredibly specific.

Also, having an AVX offset doesn't mean the entire CPU is always affected by it - you need to be under a load using AVX for the offset to affect you. You can always go into your bios and change the AVX offset if you're worried that there's some piece of software running on your system that's activating the offset and reducing your clock speeds, but that's unlikely.
Back to top
rooots
Status: Interested
Joined: 17 May 2020
Posts: 43
Reply Quote
Hi,

I had already tried noxsave but it broke some software. However, frequency-wise it did as expected: The CPU was running at the maximum non-AVX speed set in BIOS (that is, 5.1GHz) even with software that usually uses AVX (e.g. 7z with encryption). This means the AVX offset (which is 0,4GHz) did not kick in. But when booting without noxsave, I see the CPU at 4.7GHz even with normal, non-AVX loads.
I really don't know and understand why that is, I have cpufreq performance governor enabled and the CPU is effectively running at 4.7 instead of 5.1GHz even when idle. This also happens with the pstate driver.

Any idea why that is?


Thanks.
r.
Back to top
rooots
Status: Interested
Joined: 17 May 2020
Posts: 43
Reply Quote
Could this be the reason (my posting is last)? bugs.launchpad.net/linux/+bug/1727136

r.
Back to top
damentz
Status: Assistant
Joined: 09 Sep 2008
Posts: 1122
Reply Quote
Wow! That's a good find.

What motherboard are you running? You may be able to disable the AVX offset.

You can get your motherboard/system data with:
:: Code ::
inxi -M

Back to top
rooots
Status: Interested
Joined: 17 May 2020
Posts: 43
Reply Quote
It's a ASUS ROG STRIX Z370-F GAMING and there is a BIOS option to disable the offset (that is, set it to 0). However, if I do so, I'll run into stability issues when actually executing AVX code, like compression or encryption stuff. Therefore my intention was to prevent linux from executing AVX code alltogether. Especially with the aforementioned encrypted compression, I have found only small performance gains compared to when I boot with noxsave. So yes, I could do without AVX, but did not find a suitable way to do so ;-)

If the bug I've linked to applies, does that mean that even if I manage to build the kernel with AVX disabled, it won't help because glibc ruins it all?


Cheers,
r.
Back to top
damentz
Status: Assistant
Joined: 09 Sep 2008
Posts: 1122
Reply Quote
:: Quote ::
If the bug I've linked to applies, does that mean that even if I manage to build the kernel with AVX disabled, it won't help because glibc ruins it all?


Yup that's true. Why don't you configure the CPU temperature limit in your BIOS instead? I have an Asus board and there's a customizable temperature limit before throttling begins. If you're worried AVX will cause problems, I'd reduce it to a safe number like 80*C so you can observe what happens when you hit the defined threshold.

And in my opinion, a global temperature limit makes more sense to me than a simple AVX offset. The way things are going in the industry, the system should be able to adjust itself depending on stress on temperature and power delivery automatically without any static offsets defined.
Back to top
rooots
Status: Interested
Joined: 17 May 2020
Posts: 43
Reply Quote
Thanks - that's a good point. My mobo does not allow setting a temperature limit, but a wattage limit. I've done that and set the AVX offset to 0, which currently works fine (8086k @ 52/52/52/51/51/51). Even when compressing 12GB mixed data to an encrypted 7z with max compression, which takes approx. 8min, I dont see any throttles as per /sys/devices/system/cpu/cpu*/thermal_throttle/core_throttle_count.


Cheers,
r.
Back to top
Display posts from previous:   

All times are GMT - 8 Hours