Skip to content
This repository has been archived by the owner on Aug 25, 2022. It is now read-only.

BIOS mod thread #27

Open
zombillano opened this issue Aug 28, 2020 · 41 comments
Open

BIOS mod thread #27

zombillano opened this issue Aug 28, 2020 · 41 comments
Labels
documentation Improvements or additions to documentation

Comments

@zombillano
Copy link

zombillano commented Aug 28, 2020

Ok, so I've already modded my BIOS. So far I think it is working as intended. Some observations:

  • You can undervolt directly on the BIOS, which indeed seems to work. Does anybody know a way to check undervolt values on any OS using terminal commands? Just to confirm it is being applied. So far temps seems to indicate that it is working.

  • You can unlock TDP limits. I've been testing up to 44W and we can achieve a performance equal to the Ryzen 5 4650U (https://browser.geekbench.com/v5/cpu/3467665). This is under macOS, I believe the best performance can be achieved under linux because it has way less overhead compared with other OSs. NOTE: I have dual heatpipe fan and no dGPU, obviously I also repasted my thinkpad. DON'T TRY THIS WITH SINGLE HEATPIPE FAN, YOUR COMPUTER MAY OVERHEAT.

  • CPU Lock can be disabled, so I disabled the KernelQuirks related to that option. After this I'm unable to boot to Windows 10 through OC. I have to see if it is related to my install or with those options I've disabled. This doesn't seems to have any impact on CPU power consumption.

If you have any question/suggestion/test please let me know.

@EETagent EETagent added the documentation Improvements or additions to documentation label Aug 29, 2020
@swatchie-1
Copy link

@zombillano I've tried:

  1. Undervolt can be checked with voltageshift. It can undervolt the cpu and gpu. But i didn't manage to undervolt the cpucache. I used voltageshift in macos when it boots.
  2. Thanks for the TDP check. I also upgraded to double heat pipe and repasted. However i'm still facing power drain during sleep which is frustrating me. 1% per hour.
  3. Yes if I disable cpulock, i cannot boot to windows too.

@EETagent EETagent pinned this issue Aug 31, 2020
@zombillano
Copy link
Author

1. Undervolt can be checked with voltageshift. It can undervolt the cpu and gpu. But i didn't manage to undervolt the cpucache. I used voltageshift in macos when it boots.

It is possible to undervolt CPU cache too, check your config. I've disabled voltageswift and the undervolting remains through all OSs.

2. Thanks for the TDP check. I also upgraded to double heat pipe and repasted. However i'm still facing power drain during sleep which is frustrating me. 1% per hour.

Might be so many things, hard to track. I remember I was able to drain only 1% every 10-12 hours, will test today at night. Please try with the releases before 4.0, I think when I tested it I was using 3.XX. Then you might be able to track which change to the config started the problem. It shouldn't be related to TDP unlock, 'cause it only affects performance at max CPU usage.

3. Yes if I disable cpulock, i cannot boot to windows too.

To me it was caused by disabling DPTF, disabling CPU Lock doesn't make windows to stop booting.

BTW, Sorry for the late reply

@EETagent
Copy link
Owner

EETagent commented Sep 11, 2020

So my SPI programmer finally arrived. I will flash UEFI within a few days, replace PM 981 NVMe with 970 Evo ( Considerably cheaper than SN750 and little more expensive than A2000, I have good experience with this drive on normal Macs despite what Anti-Hackintosh guide says) and repaste CPU with Thermal Grizzly Kryonaut. Will report my progress in this thread.

@zombillano
Copy link
Author

So my SPI programmer finally arrived. I will flash UEFI within a few days, replace PM 981 NVMe with 970 Evo ( Considerably cheaper than SN750 and little more expensive than A2000, I have good experience with this drive on normal Macs despite what Anti-Hackintosh guide says) and repaste CPU with Thermal Grizzly Kryonaut. Will report my progress in this thread.

SN750 is cheaper at my country, but both should work just fine. I didn't saw a big difference using Grizzly Kryonaut, not even during heavy load. Please post your results. A little warning: just because it works on a regular mac doesn't mean it would work on a Hackintosh. The SM961 SSD that I was using had multiple reports that it worked on different MBPs, but as you know I never managed to make it work.

I recommend you to dump your thunderbolt controller EEPROM, may be useful if your T480 starts to have issues with the USB C ports.

@EETagent
Copy link
Owner

EETagent commented Sep 12, 2020

No need to worry about TB3, I updated to fixed firmware version as soon as it was released

@zombillano
Copy link
Author

No need to worry about TB3, I updated to fixed firmware version as soon as it was released

There have been reports of people having troubles even when they updated to the fixed firmware. Doesn't hurt to have a dump of it, and if anything fails and you are out of warranty you can easily get a replacement Eeprom at aliexpress and replace the faulty one.

@EETagent
Copy link
Owner

@zombillano Also is there some option to overclock RAM controller in Advanced menu? Kabylake-R supports officially only 2400Mhz but there are factory overclocked KBL-R laptops with 2666Mhz RAM support. As I can use two SO-DIMM 4GB DDR4 2666Mhz ( Unknown timing, probably CL19 ) RAM sticks extracted from upgraded Mac Mini. I have currently one free slot, it might be possible to mix one of them with the factory RAM to have 12GB total ( single channel mod ). But because of potential reliability issues with such combination, I will probably replace the included RAM completely to have same capacity albeit in dual channel. So it will be great if there would be some way to run them at their destined clock speed.

@zombillano
Copy link
Author

zombillano commented Sep 13, 2020

There is an option to overclock RAM, but AFAIK it doesn't work. I have 16GB with 2 x 8GB RAM sticks. You won't have problems mixing sticks and dual channel isn't as important as it is when using AMD processors, you won't notice any real life improvement. Also the difference between 2400Mhz and 2666Mhz isn't noticeable.

@EETagent
Copy link
Owner

EETagent commented Sep 17, 2020

Finally joined UEFI modding gang.

What I have done so far:

  • Laptop wide undervolt
  • Repasting CPU with Kryonaut
  • Resizing DVMT and disabling CFG lock
  • Upgrading SSD to 512GB 970 Evo
  • Adding 4GB DDDR4 2666Mhz stick ( 12GB total )
  • Changed Display from 18 bit to 24 bit ( Shouldn’t be 24 bit by default ? )

Ready to install Big Sur and dive in Cocoa

@zombillano
Copy link
Author

zombillano commented Sep 18, 2020

Finally joined UEFI modding gang.

Congrats! 😄

What I have done so far:

* Laptop wide undervolt
* Repasting CPU with Kryonaut

First time I applied Kryonaut I didn't notice any improvement. Then I decided to reapply since I read somewhere around the web that you may apply the thinnest layer that you can in order to achieve the best results. Since then my temps improved a lot, and I mean A LOT. I can stay at ~34ºC while doing some normal stuff (surfing the web, coding, listen to music). The fan is off most of the time.

* Adding 4GB DDDR4 2666Mhz stick ( 12GB total )

Did you overclock the RAM?

* Changed Display from 18 bit to 24 bit ( Shouldn’t be 24 bit by default ? )

I think it depends on your LCD panel. Where did you set it up?

@EETagent
Copy link
Owner

EETagent commented Sep 18, 2020

First time I applied Kryonaut I didn't notice any improvement. Then I decided to reapply since I read somewhere around the web that you may apply the thinnest layer that you can in orden to achieve the best results. Since then my temps improved a lot, and I mean A LOT. I can stay at ~34ºC while doing some normal stuff (surfing the web, coding, listen to music). The fan is off most of the time.

Wow, 34ºC during light load is good, I have about 31ºC during 800 MHz idle ( Still did not downloaded Big Sur, tested on Fedora with s-tui ) with charger disconnected. Low load temperature has yet to be seen.

Did you overclock the RAM?

Nope, 2 different RAM sticks, not a good idea. Will just let UEFI do it's magic stuff.

I think it depends on your LCD panel. Where did you set it up?

In the Advanced Menu, where you undervolt GPU, there should be LCD control too. I will get exact location later.

@swatchie-1
Copy link

Wow, 34 degrees. What's your ambient temperature? I can only get mine to 46. Ambient is 27 degrees celc.

@zombillano
Copy link
Author

Wow, 34ºC during light load is good, I have about 31ºC during 800 MHz idle ( Still did not downloaded Big Sur, tested on Fedora with s-tui ) with charger disconnected. Low load temperature has yet to be seen.

I've got 28ºC on idle:
Screen Shot 2020-09-18 at 10 34 13

BTW it turns out that it is possible to set the lowest frequency to 800Mhz using this fork of CPUFriendFriend: https://github.com/fewtarius/CPUFriendFriend

Wow, 34 degrees. What's your ambient temperature? I can only get mine to 46. Ambient is 27 degrees celc.

24ºC. It is quite interesting since it doesn't even turn the fan on, so I'm getting that temperatures only using passive cooling. Now it is at the level of what I can get using Linux/Windows.

I think it's a sum of all factors: Undervolting (I can do -125mV) + Dual Heatpipe Fan (which improves passive colling) + Kryonaut with a thin layer which in fact seems to be doing its job quite well.

@EETagent
Copy link
Owner

EETagent commented Sep 18, 2020

BTW it turns out that it is possible to set the lowest frequency to 800Mhz using this fork of CPUFriendFriend: https://github.com/fewtarius/CPUFriendFriend

Fewtarius's fork is used since 1af92e1. I've had lowest frequency at 0.9 GHz, but unlike in other operating systems where average frequency is 800 MHz on all cores, it's not possible on macOS yet.

@zombillano
Copy link
Author

I've had lowest frequency at 0.9 GHz, but unlike in other operating systems where average frequency is 800 MHz on all cores, it's not possible on macOS yet.

Yeah, that's right. I don't know what's needed in order to achieve that. Does macbook pro is able to get that low?

@EETagent
Copy link
Owner

EETagent commented Sep 19, 2020

Yeah, that's right. I don't know what's needed in order to achieve that. Does macbook pro is able to get that low?

Don't have one, but will test it on MBA.

Off-topic: Do you know if there is some way to enable deleting files in Finder with Delete key just like In GNOME's Nautilus?

@swatchie-1
Copy link

@zombillano did you undervolt using bios intel advanced menus and if so, what are the parameters you adjusted (processor -125mv, gt -80mv -80mv, uncork -80)? Or did you just use voltageshift?

@zombillano
Copy link
Author

Off-topic: Do you know if there is some way to enable deleting files in Finder with Delete key just like In GNOME's Nautilus?

It should be possible to achieve with karabiner elements. Another way may be using ACPI, though I'm unsure if it's possible to assign two keys to one (command + backspace to delete).

@zombillano did you undervolt using bios intel advanced menus and if so, what are the parameters you adjusted (processor -125mv, gt -80mv -80mv, uncork -80)? Or did you just use voltageshift?

I'm undervolting using the built in menus on the BIOS. Everything is set up to -125mV (CPU, GT, UNCORE). I might be able to set a higher undervolt but not without instabilities.

@EETagent
Copy link
Owner

EETagent commented Sep 22, 2020

@zombillano It's possible that macOS can somehow mess up power management of whole machine? With UEFI reseted to default ( With changes described above ), I get stable CPU IDLE frequency at 800Mhz in Linux ( Booted without OpenCore, Measured using s-tui ). That is fine until I boot macOS, then frequency is at 900Mhz and changes rapidly until I reset UEFI again. With CFG lock disabled, macOS maybe writtes some bad stuff into the MSR 0xE2 register?

Edit: It does not revert back to 800Mhz even after I reset UEFI to defaults.

@EETagent
Copy link
Owner

EETagent commented Sep 22, 2020

@zombillano If you reset UEFI to defaults, does it disable VT-d ( In Advanced menu - System agent ) and Secure Boot for you too? What is your Firmware Configuration in Advanced menu? Test?

Also what is your Geekbench 5 ST score compared to other platforms? I know that Geekbench is shitty way to measure performance but this is problem which I have from the beginning of this EFI. My ST score on Linux/Windows is over 900 yet on macOS it is 745 :( I have CPUFriendDataProvider configured with values for MBP.

@zombillano
Copy link
Author

@zombillano If you reset UEFI to defaults, does it disable VT-d ( In Advanced menu - System agent ) and Secure Boot for you too? What is your Firmware Configuration in Advanced menu? Test?

It won't reset certain settings when using reset to default option, it is a known bug. I don't have Secure Boot set up 'cause I don't really need it right now. Firmware Configuration is set up as test.

Also what is your Geekbench 5 ST score compared to other platforms? I know that Geekbench is shitty way to measure performance but this is problem which I have from the beginning of this EFI. My ST score on Linux/Windows is over 900 yet on macOS it is 745 :( I have CPUFriendDataProvider configured with values for MBP.

This is mine, but take in mind I've unlocked my TDP up to 44W: https://browser.geekbench.com/v5/cpu/3467665
If you want I can reset my TDP settings to default values later today and make the test again.

@zombillano
Copy link
Author

zombillano commented Sep 24, 2020

Ok, so I've got back to default TDP values and made the same test across several OSs:

As you can see, macOS gets the lowest numbers, but I'm still getting higger numbers than you @EETagent . Can you please share your TDP config? Mine got back to 10W/25W/29W, but I'm unsure about TurboBoost timer.

@EETagent
Copy link
Owner

Ok, so I've got back to default TDP values and made the same test across several OSs:

As you can see, macOS gets the lowest numbers, but I'm still getting higger numbers than you @EETagent . Can you please share your TDP config? Mine got back to 10W/25W/29W, but I'm unsure about TurboBoost timer.

Thanks for testing, your results are really amazing. Especially the Linux one.

I’ve got same UEFI configuration, but don’t know how could be macOS score so much lower. Even though that MT score is perfectly fine for i5-8250U ( cca 3240 ). I did even more testing with Blender 2.90 using BMW file and macOS managed to render it at 9 mins, thats not that much difererent than 8:43 that I had on Linux with throttled installeď. On Windows, I once managed to get score over 1700, that’s considerably higher than normal 1500. With 44W TDP configured through Intel XTU.

@zombillano
Copy link
Author

zombillano commented Sep 24, 2020

Thanks for testing, your results are really amazing. Especially the Linux one.

Yeah, they are really good. That's why I doubt about TurboBoost timer value, because I remember I increased the value before and I suspect that it didn't got back to its default value.

I’ve got same UEFI configuration, but don’t know how could be macOS score so much lower.

I don't really think it is a huge deal. I mean, most of the time I don't use all the power of the CPU, unless I'm compiling a project or having 2-3 VMs running, which may happen only twice a day.

Also, there are so many variables involved in how an OS manages the CPU that it might be very difficult to achieve the same performance.

Even though that MT score is perfectly fine for i5-8250U ( cca 3240 ). I did even more testing with Blender 2.90 using BMW file and macOS managed to render it at 9 mins, thats not that much difererent than 8:43 that I had on Linux with throttled installed.

That's what I'm saying, the difference isn't that big in real life scenarios. If you really want to get the most out of your CPU then just get up the TDP values to 44W (or even higher if you want, but I found 44W to be the best in terms of performace/thermals).

I will try to test across OSs with TDP set up to 44W, but I think I won't do it until the weekend.

@EETagent
Copy link
Owner

EETagent commented Sep 29, 2020

@zombillano
Like I wrote above, my machine is still unable to reach 800Mhz on all cores as before. I reseted UEFI multiple times, reseted NVRAM, tested it on multiple Linux distros and macOS versions and there is no difference. Is there some other option then reflashing stock firmware?

Package power is reported same or at least very close to previous values so this is probably more of my fictional problem I think. Still there is something wrong and I wonder if macOS or OpenCore can somewhat corrupt our machines.

@zombillano
Copy link
Author

zombillano commented Sep 29, 2020

@zombillano
Like I wrote above, my machine is still unable to reach 800Mhz on all cores as before. I reseted UEFI multiple times, reseted NVRAM, tested it on multiple Linux distros and macOS versions and there is no difference. Is there some other option then reflashing stock firmware?

I think you might be overreacting about it. I mean, I don't think it modifies anything other than the frequency vectors at OS level, not at UEFI level. It may be something else but nothing to worry about, give a look at my Intel Power Gadget window right now:

imagen

And I haven't change anything since my last report. Also, as you said, macOS never really gets that low, so at least for macOS is more like a fictional number. I haven't checked what's the behaviour on Windows or Linux, I can check later today if you want.

Package power is reported same or at least very close to previous values so this is probably more of my fictional problem I think. Still there is something wrong and I wonder if macOS or OpenCore can somewhat corrupt our machines.

AFAIK macOS and OC only modifies NVRAM. Maybe there is an stuck value on the NVRAM. I've read reports of people having problems when trying to erase NVRAM on thinkpads and they eventually had to reflash their BIOS EEPROM (or send their computer to lenovo service when they didn't have a backup of their BIOS EEPROM), so I think it is better to just reflash your stock BIOS backup.

@EETagent
Copy link
Owner

EETagent commented Sep 30, 2020

@zombillano @swatchie-1
So I disassembled ThinkPad again and now I am trying reflash stock firmware. Like last time, I am getting Programmer inicialization failed error. I managed to get it working before and hope that I will even this time.

I want to ask if one of you encountered this error and if yes what was the best fix. Thanks

@EETagent
Copy link
Owner

EETagent commented Sep 30, 2020

Flash completed, I am just clumsy ...

I also made backup of the TB3 EEPROM for possible future issues.

Edit: Booted Linux and ......... I am back at 800Mhz!

@swatchie-1
Copy link

Nice. Looks like both of us solved our issues by re-flashing to stock. Are you planning to flash another patched UEFI?

@EETagent
Copy link
Owner

EETagent commented Oct 1, 2020

Nice. Looks like both of us solved our issues by re-flashing to stock. Are you planning to flash another patched UEFI?

Probably yes.

@benbender
Copy link

I've experienced similar problems which couldn't be fixed by simply reloading defaults.
Keep in mind that you are digging in developer-options which are not meant to be used for end-users and, in parts, may not even be completely implemented in our T480s (f.e. S0-Sleep). So just reflash your patched rom if you got stuck. But yeah, here be dragons ;)

@benbender
Copy link

Just to add my experience:

I don't do anything else than Unlock "CFG Lock", enable 64mb stolenram and undervolt my cpu a bit. Both on T480 and X1C6. The rest doesn't seem to have much positive impact for me. That's imho a good and reproducible base. The rest must be done in ACPI.

@Charlyo
Copy link

Charlyo commented Nov 2, 2020

Dortaina guide also suggested Enabling Above 4G decoding. Not sure how that would affect.

@benbender
Copy link

@Charlyo good point. on the x1c6 its enabled by default. on the t480 it isnt.

@Charlyo
Copy link

Charlyo commented Nov 2, 2020

I'm not 100% sure which (undervolted bios or voltageshift) voltages are actually 100% correct. There's a 2-3 mV difference between them. E.g: BIOS set to -80 mV / voltageshift showing -83mV.

For me this pattern is not consistent between voltage settings (CPU / $ / GPU / SA).

@benbender
Copy link

@Charlyo To be honest: who cares? ;)

@Charlyo
Copy link

Charlyo commented Nov 3, 2020

My system stability 🤣

Usually in order to check for an ok undervolt via voltageshit. I keep increasing it till the system fails. Then I lower it till i get a stable voltage. Later on I introduce that voltage in bios.

If I undervolt changes from bios to voltageshift I might have applied an unstable undervolt without noticing.

TL;DR. Me complaining about system stability when undervolted.

@benbender
Copy link

I don't bother with the last mV as it doesn't seem to be worth the effort to me so I settled on -90mV for everything and be happy ;)

@kekkokk
Copy link

kekkokk commented Dec 22, 2020

Hi guys!
Just ordered my ch341a.
I saw ton of posts talking about this skyra1n patch but couldn't find it.
Can you please share with me your sources on where to find it or the documentation for "Resizing DVMT and disabling CFG lock"?
I only found This guy's site name is awesome these patches. Are you using these?

Really noob in bios mod and really want to know where to start.
Thanks!!

@EETagent
Copy link
Owner

Yes, use these
http://paranoid.anal-slavery.com/files/backup_thinkpads/xx80_patches_v6.txt

Do not forget to take multiple backups of original UEFI and when you are at it Thunderbolt EEPROM too

Flashrom may fail, if that happens try to reattach your ch341 clip

@kekkokk
Copy link

kekkokk commented Jan 29, 2021

sorry did not reply, but everything went butter smooth.
thanks guys!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

6 participants