Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Status
Not open for further replies.

tsialex

Contributor
Jun 13, 2016
13,455
13,601
To me, the first statement suggests a higher value will have a higher chance of success. But that doesn't rhyme with the second statement. Why would you start with 250?
Read post 42.

 

joevt

macrumors 604
Jun 21, 2012
6,968
4,262
you can do the log show in apple script with the line

note the \

Code:
display dialog (do shell script "log show --predicate  'sender == \"latebloom\"' --start $(date \"+%Y-%m-%d\") --debug")
Instead of --start $(date \"+%Y-%m-%d\") which prints everything from the same day, wouldn't --last boot constrain the output to only messages since last startup?

This kext hooks the IOPCIFamily PCI Bus Probe routine. As far as I can tell, that's only ever called during boot, so latebloom is effectively only active during boot. If there are other instances where the PCI bus gets probed, the delays would still take place; however, I haven't found any cases where the PCI bus gets probed more than once (I would be extremely interested in hearing about any that exist). After the system is booted, latebloom just sits there quietly, taking up a little memory and humming Édith Piaf tunes to itself.
PCI probing can happen for hot plug (Thunderbolt or ExpressCard or similar)?

If the purpose of the hook is to delay PCI Bus Probe so it doesn't do stuff while something else is happening, then maybe this could be improved by making the delay last until whatever that something else is has completed. But you would have to find what that something else is. Is it a probe of some other device? I understand that you did try disabling all but one CPU but even a single CPU can do multiple threads - there's a scheduler that preempts one thread to continue work on another.

@Syncretic Have a small suggestion for latebloom, specifically the idea of defining arguments as stand alone variables in NVRAM instead of just boot-args. Idea is that the user won't clutter their boot-args as much, similar to how RtcMemoryFixup allows you to set the RTC Blacklist either with the boot-arg rtcfx_exclude=xxx or with the stand alone variable rtc-blacklist

For reference, the Lilu/OpenCore GUID is 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102 however we use it for OCLP to set the patcher version and could be used by latebloom as well. Would recommend not using 7C436110-AB2A-4BBB-A880-FE41995C9F82 as that's Apple's Boot Variable GUID which Apple may be used to store undocumented variables potentially matching yours.
This might be a good idea. Some boot loaders have a max boot-args length that is too short (256 bytes?) for some situations. Hackintoshes and now unsupported Macs are getting increasingly lengthy boot-args. Probably those boot loaders should be fixed to increase the max length of boot-args to the max length allowed by NVRAM or the OS (up to 4K?).
 

KvR

macrumors member
Jan 11, 2017
58
48
Amsterdam
Read post 42.

Sorry, I'm still not getting it.
found that it's efficacy is directly dependent with the Mac Pro hardware configuration
This part I get. Every Mac has it's own optimal value.
Then you have the results of your systems, 80, 175, 200 and 250 and the statement:
If you have slower Xeons, you'll probably have to increase the value.
The X5680 is one of the fastest CPUs compatible with the Mac Pro 4,1/5,1. Do you land at 250 because you have values around 200 and expect most people will have slower CPUs?
 
Last edited:

tsialex

Contributor
Jun 13, 2016
13,455
13,601
Sorry, I'm still not getting it.

This part I get. Every Mac has it's own optimal value.
Then you have the results of your systems, 80, 175, 200 and 250 and the statement:

The X5680 is one of the fastest CPUs compatible with the Mac Pro 4,1/5,1. Do you land a 250 because you have values around 200 and expect most people will have slower CPUs?
More PCIe devices installed / dual processor / slower processor, more delay needed.

From my tests, @h9826790 idea of using just 100 would not work for three of my four Mac Pros - if you are developing a solution for other people to use safely, you have to start with a very high/safe delay that would be right for most people and then let the user fine tune to his own hardware config.
 

PeterHolbrook

macrumors 68000
Sep 23, 2009
1,625
441
Sorry not have positive things to report after six attempts to boot Big Sur 11.4 through latebloom. Verbose mode tells me latebloom seems to do what it's supposed to do (using delays of 100 and 270 ms, and a random additive delay of +/- 20 ms, but the boot process has ended up crashing several MINUTES later every time.
Failed boot.jpg

Perhaps my Mac Pro 5,1 is not the best testing ground for latebloom. Before latebloom, I only got my Mac to boot one time out of roughly 30! It doesn't have any NVMe blades or SSD disks, just four regular hard disk drives (one of them moderately fast, at 7200 rpm). It also has a Titan-Ridge Thunderbolt 3 PCI card and an updated Wi-Fi/Bluetooth module. It has a 6-core X5765 processor running at 3.07 GHz.

Any suggestions?
 
Last edited:

eVasilis

macrumors 6502
Jan 13, 2010
425
182
Here we go: fresh (clean) 11.2.3 installation, OC from scratch. kextstat | grep latebloom returns:


Executing: /usr/bin/kmutil showloaded

No variant specified, falling back to release


Any comments?

Thanks!
 

paalb

macrumors 6502
Dec 17, 2019
257
180
Sorry not have positive things to report after six attempts to boot Big Sur 11.4 through latebloom. Verbose mode tells me latebloom seems to do what it's supposed to do (using delays of 100 and 270 ms, and a random additive delay of +/- 20 ms, but the boot process has ended up crashing several MINUTES later every time.
View attachment 1805572
Perhaps my Mac Pro 5,1 is not the best testing ground for latebloom. Before latebloom, I only got my Mac to boot one time out of roughly 30! It doesn't have any NVMe blades or SSD disks, just four regular hard disk drives (one of them moderately fast, at 7200 rpm). It also has a Titan-Ridge Thunderbolt 3 PCI card and an updated Wi-Fi/Bluetooth module.

Any suggestions?
Only based on reading @tsialex practical suggestions I have concluded this: Go higher to solve crash problem. Go lower to get less boot time.
 

KvR

macrumors member
Jan 11, 2017
58
48
Amsterdam
Here we go: fresh (clean) 11.2.3 installation, OC from scratch. kextstat | grep latebloom returns:


Executing: /usr/bin/kmutil showloaded

No variant specified, falling back to release
From the starting post:

I have set MinKernel to 20.4.0 to ensure that it only gets loaded on 11.3+
So, latebloom will only load if you run 11.3 or higher. Hence you won't see latebloom on 11.2.3.
 
Last edited:
  • Like
Reactions: startergo

Syncretic

macrumors 6502
Original poster
Apr 22, 2019
311
1,533
Sorry not have positive things to report after six attempts to boot Big Sur 11.4 through latebloom. Verbose mode tells me latebloom seems to do what it's supposed to do (using delays of 100 and 270 ms, and a random additive delay of +/- 20 ms, but the boot process has ended up crashing several MINUTES later every time.
View attachment 1805572
Perhaps my Mac Pro 5,1 is not the best testing ground for latebloom. Before latebloom, I only got my Mac to boot one time out of roughly 30! It doesn't have any NVMe blades or SSD disks, just four regular hard disk drives (one of them moderately fast, at 7200 rpm). It also has a Titan-Ridge Thunderbolt 3 PCI card and an updated Wi-Fi/Bluetooth module. It has a 6-core X5765 processor running at 3.07 GHz.

Any suggestions?

More challenging systems are an important part of these tests; they'll help establish the limitations of this method, and possibly provide clues to a better solution.

Your picture appears to show a common hang point, but that photo doesn't show any signs of latebloom. Did you definitely see the words _____[ !!! *** latebloom *** !!! ]: Hook placed successfully. Count = 0 prior to this? Latebloom doesn't actually prevent hangs, but because the delays typically have at least some effect, it's unusual to see a hang exactly where it would have hung without latebloom. I suggest verifying that latebloom is definitely loaded and the hook is successfully set, because it looks like perhaps it's not. (As I noted in an earlier post, my own method involves recording the boot screen in slow motion on my iPhone, then scrolling through it slowly. Crude, but effective.)

PCI probing can happen for hot plug (Thunderbolt or ExpressCard or similar)?
I think that's a separate mechanism, but we should definitely test it. I'm away from my computer for most of today, so maybe someone else could try it? Set a fairly high latebloom value, one that would produce an unmistakable delay, then try generating a hot plug event and see if it's far slower than usual. (Now that I think about it, I don't really have the hardware to test this myself...)

If the purpose of the hook is to delay PCI Bus Probe so it doesn't do stuff while something else is happening, then maybe this could be improved by making the delay last until whatever that something else is has completed. But you would have to find what that something else is. Is it a probe of some other device? I understand that you did try disabling all but one CPU but even a single CPU can do multiple threads - there's a scheduler that preempts one thread to continue work on another.

The hook is "dumb," in the sense that it knows nothing about what's going on in the PCI bus probe module. That's by design, because the MacOS register allocation and data structures change from dot-rev to dot-rev, and maintaining visibility into the module being hooked becomes extremely messy when supporting more than one very specific OS release. (I learned this the hard way when implementing my AVX emulator, which has related issues that I'm still ironing out.) When monkeying around with the internals like this, I like to stick with the KISS model unless absolutely necessary.

To me, the first statement suggests a higher value will have a higher chance of success. But that doesn't rhyme with the second statement. Why would you start with 250?

My "best results seem to be in the 50-150ms range" statement was based on results from a small group of alpha testers; the whole point of this public beta is to figure out what (if anything) works on more than that handful of systems. The basic idea presented by @tsialex is: the slower your CPU is, and/or the more PCI devices you have, the larger the latebloom=N value probably needs to be. There isn't going to be a "one size fits all" value, every system will have its own optimal value based on the hardware/software configuration. Starting from a more conservative (higher) value should prevent some unnecessary pain when trying this on slow or heavily-PCI-populated systems.

I reserved two posts at the top of this thread for things like a FAQ and a results table - once folks have had a chance to tweak this, I want to create a table with system configurations and optimal/acceptable delay values, and we can see if there's any consistency. If we're lucky, we'll end up with a fairly clear-cut formula for calculating a starting latebloom=N value given the CPU, memory, and PCI setup. If we're exceptionally lucky, I might be able to incorporate some of that logic into the kext itself so that it can calculate a reasonable default on the fly if no latebloom=N value is present. (It never hurts to dream...)
 

cdf

macrumors 68020
Jul 27, 2012
2,256
2,583
Perhaps my Mac Pro 5,1 is not the best testing ground for latebloom. Before latebloom, I only got my Mac to boot one time out of roughly 30! It doesn't have any NVMe blades or SSD disks, just four regular hard disk drives (one of them moderately fast, at 7200 rpm). It also has a Titan-Ridge Thunderbolt 3 PCI card and an updated Wi-Fi/Bluetooth module. It has a 6-core X5765 processor running at 3.07 GHz.

Any suggestions?
It's possible to confuse a sequence of delays with a hang. Use lb_debug=1 to see where the delays are being inserted.
 

PeterHolbrook

macrumors 68000
Sep 23, 2009
1,625
441
Your picture appears to show a common hang point, but that photo doesn't show any signs of latebloom. Did you definitely see the words _____[ !!! *** latebloom *** !!! ]: Hook placed successfully. Count = 0 prior to this?
Yes, I definitely saw several loops (over 30, if I remember correctly) of latebloom adding hundreds of milliseconds. I've repeated the process with a delay of 1000+/-20 ms. Same result, and the hang occurred at exactly the same point. Perhaps if I were to set the delay to something like 10000 ms it would eventually boot, but the process doesn't look promising on my hardware. After all, not using latebloom got me to the 11.4 desktop once after 30 tries! If you have any suggestions as to values I might attempt next, I'll try to comply, but it seems I'm running out of options.
 
  • Like
Reactions: Syncretic

PeterHolbrook

macrumors 68000
Sep 23, 2009
1,625
441
It's possible to confuse a sequence of delays with a hang. Use lb_debug=1 to see where the delays are being inserted.
Yes, I had already set that. I interpreted the boot process had hung after 5 minutes of inactivity in verbose mode.
 

cdf

macrumors 68020
Jul 27, 2012
2,256
2,583
Yes, I had already set that. I interpreted the boot process had hung after 5 minutes of inactivity in verbose mode.
Perhaps you could test a bootable installer of 11.4. Booting into the installer is also affected by the race condition, although to a lesser degree it seems.
 

Syncretic

macrumors 6502
Original poster
Apr 22, 2019
311
1,533
Yes, I definitely saw several loops (over 30, if I remember correctly) of latebloom adding hundreds of milliseconds. I've repeated the process with a delay of 1000+/-20 ms. Same result, and the hang occurred at exactly the same point. Perhaps if I were to set the delay to something like 10000 ms it would eventually boot, but the process doesn't look promising on my hardware. After all, not using latebloom got me to the 11.4 desktop once after 30 tries! If you have any suggestions as to values I might attempt next, I'll try to comply, but it seems I'm running out of options.

Thanks for trying! I'm headed out the door right now, but I'm intrigued with your problem. It sounds like you aren't ever getting any benefit from latebloom, regardless of the delay value; this is highly unusual, and I'd call it a result. I'd like to get the exact details of your setup, since it's an outlier and could provide valuable clues (either toward improvement of latebloom or insight into the real problem). I'll come back to this later today. (I wouldn't recommend trying 9999ms; if your system takes 30 minutes to boot, is it still really usable? ;-)
 

PeterHolbrook

macrumors 68000
Sep 23, 2009
1,625
441
Perhaps you could test a bootable installer of 11.4. Booting into the installer is also affected by the race condition, although to a lesser degree it seems.
I'm not sure I understand. One of my internal hard drives already has 11.4 and I managed to boot it once. Before that, there were lots of incomplete install iterations, until it was finally installed. And, after that, more than two dozen unsuccessful boot processes (before latebloom).
 

Macschrauber

macrumors 68030
Dec 27, 2015
2,981
1,487
Germany
Instead of --start $(date \"+%Y-%m-%d\") which prints everything from the same day, wouldn't --last boot constrain the output to only messages since last startup?

yes, thats better,

made a script to 1st check if latebloom is loaded, and 2nd tell if the hook was placed.
 

Attachments

  • latebloom check v2.app.zip
    58.1 KB · Views: 160

aaronlroberts

macrumors member
Apr 19, 2017
43
21
Cluj-Napoca, Romania
For the life of me, I cannot get this to work. I don't understand what I'm doing wrong, but I must be missing something, despite reading this thread over and over again.

Here's what I've done.

  1. Added the kext file to the EFI > OC > Kexts folder
    Screenshot 2021-07-13 at 15.22.39.png
  2. Added the following line to the OC config.plist
    Code:
    latebloom=100 lb_range=20 lb_debug=1 -v

    The line was added into the section which now reads:
    Code:
        <key>NVRAM</key>    <dict>
            <key>Add</key>
            <dict>
                <key>4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14</key>
                <dict>
                    <key>UIScale</key>
                    <data>AQ==</data>
                    <key>DefaultBackgroundColor</key>
                    <data>AAAAAA==</data>
                </dict>
                <key>7C436110-AB2A-4BBB-A880-FE41995C9F82</key>
                <dict>
                    <key>boot-args</key>
                    <string>-lilubetaall -wegbeta agdpmod=pikera shikigva=80 unfairgva=1 mbasd=1 -wegtree -no_compat_check no32exec=0 latebloom=100 lb_range=20 lb_debug=1 -v</string>
                    <key>csr-active-config</key>
                    <data>fwgAAA==</data>
                    <key>run-efi-updater</key>
                    <string>No</string>
                    <key>ForceDisplayRotationInEFI</key>
                    <integer>00</integer>
                </dict>
            </dict>
  3. I added the "-v" flag just to ensure that indeed, changes were effective as verbose was initially turned off.
  4. Mac booted in Verbose mode as expected... text flew by and booted into Big Sur 11.4 (had previously updated to 11.4 before adding the kext etc)
  5. I used the previously mentioned script to check if the kext was loaded, but it says it isn't.
    Screenshot 2021-07-13 at 15.26.35.png

What am I doing wrong here?

I've attached my config.plist (changed extension to txt for upload) which has the -v and debug flag removed.

The line now reads:
Code:
<string>-lilubetaall -wegbeta agdpmod=pikera shikigva=80 unfairgva=1 mbasd=1 -wegtree -no_compat_check no32exec=0 latebloom=100 lb_range=20 lb_debug</string>

EDIT:​

I totally forgot to add the kext entry into the plist file when I started over.

I added the entry by using the script created by @startergo on post: https://forums.macrumors.com/thread...on.2303986/page-2?post=30090448#post-30090448

This solved it for me.
 

Attachments

  • config.plist.txt
    21.5 KB · Views: 127
Last edited:

startergo

macrumors 603
Sep 20, 2018
5,022
2,283
For the life of me, I cannot get this to work. I don't understand what I'm doing wrong, but I must be missing something, despite reading this thread over and over again.

Here's what I've done.

  1. Added the kext file to the EFI > OC > Kexts folder View attachment 1805642
  2. Added the following line to the OC config.plist
    Code:
    latebloom=100 lb_range=20 lb_debug=1 -v

    The line was added into the section which now reads:
    Code:
        <key>NVRAM</key>    <dict>
            <key>Add</key>
            <dict>
                <key>4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14</key>
                <dict>
                    <key>UIScale</key>
                    <data>AQ==</data>
                    <key>DefaultBackgroundColor</key>
                    <data>AAAAAA==</data>
                </dict>
                <key>7C436110-AB2A-4BBB-A880-FE41995C9F82</key>
                <dict>
                    <key>boot-args</key>
                    <string>-lilubetaall -wegbeta agdpmod=pikera shikigva=80 unfairgva=1 mbasd=1 -wegtree -no_compat_check no32exec=0 latebloom=100 lb_range=20 lb_debug=1 -v</string>
                    <key>csr-active-config</key>
                    <data>fwgAAA==</data>
                    <key>run-efi-updater</key>
                    <string>No</string>
                    <key>ForceDisplayRotationInEFI</key>
                    <integer>00</integer>
                </dict>
            </dict>
  3. I added the "-v" flag just to ensure that indeed, changes were effective as verbose was initially turned off.
  4. Mac booted in Verbose mode as expected... text flew by and booted into Big Sur 11.4 (had previously updated to 11.4 before adding the kext etc)
  5. I used the previously mentioned script to check if the kext was loaded, but it says it isn't.
    View attachment 1805643

What am I doing wrong here?

I've attached my config.plist (changed extension to txt for upload) which has the -v and debug flag removed.

The line now reads:
Code:
<string>-lilubetaall -wegbeta agdpmod=pikera shikigva=80 unfairgva=1 mbasd=1 -wegtree -no_compat_check no32exec=0 latebloom=100 lb_range=20 lb_debug</string>
Use this:
 
  • Like
Reactions: aaronlroberts

macnrolla

macrumors member
Jul 6, 2021
34
13
Here we go: fresh (clean) 11.2.3 installation, OC from scratch. kextstat | grep latebloom returns:


Executing: /usr/bin/kmutil showloaded

No variant specified, falling back to release


Any comments?

Thanks!
Check your kernel version with `sysctl kern.version`. macOS 11.2.3 has `20.3.0` but the kext is only loaded at higher versions (> `20.4.0` via `MinKernel`).
 

cdf

macrumors 68020
Jul 27, 2012
2,256
2,583
I'm not sure I understand. One of my internal hard drives already has 11.4 and I managed to boot it once. Before that, there were lots of incomplete install iterations, until it was finally installed. And, after that, more than two dozen unsuccessful boot processes (before latebloom).
What I'm suggesting is to test if you can get a bootable installer of 11.4 to boot. You don't actually have to go through the installation process. The reason for this test is that the installer is also affected by the race condition but to a lesser degree.

If you can get the installer to boot, then that would suggest that latebloom can in fact have a positive effect on your system, and you may consider reinstalling 11.4. Perhaps your past installation attempts have introduced other issues.

On the other hand, if you cannot get the installer to boot, then that further supports the idea that your system is special.
 

eVasilis

macrumors 6502
Jan 13, 2010
425
182
Check your kernel version with `sysctl kern.version`. macOS 11.2.3 has `20.3.0` but the kext is only loaded at higher versions (> `20.4.0` via `MinKernel`).
Thanks! I figured that out and changed MinKernel to 20.3.0.
 
Status
Not open for further replies.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.