Contribute
Register

How to build your own iMac Pro [Successful Build/Extended Guide]

Status
Not open for further replies.
You may need to uninstall the Nvidia WebDriver from a CLI because you are only able to SSH back in to your bricked hackintosh following a failed WebDriver install. In such a circumstance it may be useful to know that the uninstaller can be invoked from a terminal.

Recall that the Nvidia PrefPane has an Uninstall option.

<TLDR>
As root, unpack /Library/PreferencePanes/NVIDIA\ Driver\ Manager.prefPane/Contents/MacOS/NVIDIA\ Web\ Driver Uninstaller.app/Contents/Resources/NVUninstall.pkg to a temporary location and run <unpacked>/Scripts/postinstall
</TLDR>

This is what I found poking around my bricked hack over SSH:
Code:
root@x:/Library/PreferencePanes/NVIDIA Driver Manager.prefPane/Contents/MacOS/NVIDIA Web Driver Uninstaller.app/Contents# pkgutil --expand Resources/NVUninstall.pkg /tmp/foo
root@x:/Library/PreferencePanes/NVIDIA Driver Manager.prefPane/Contents/MacOS/NVIDIA Web Driver Uninstaller.app/Contents# ll /tmp/foo/
total 8
-rw-r--r--  1 root     wheel  475  5 Oct 17:10 PackageInfo
drwxr-xr-x  3 dwhitla  admin   96  5 Oct 17:10 Scripts
root@x:/Library/PreferencePanes/NVIDIA Driver Manager.prefPane/Contents/MacOS/NVIDIA Web Driver Uninstaller.app/Contents# pushd /tmp/foo
/tmp/foo /Library/PreferencePanes/NVIDIA Driver Manager.prefPane/Contents/MacOS/NVIDIA Web Driver Uninstaller.app/Contents
root@x:/tmp/foo# ll
total 8
-rw-r--r--  1 root     wheel  475  5 Oct 17:10 PackageInfo
drwxr-xr-x  3 dwhitla  admin   96  5 Oct 17:10 Scripts
root@x:/tmp/foo# cat PackageInfo
<?xml version="1.0" encoding="utf-8"?>
<pkg-info overwrite-permissions="true" relocatable="false" identifier="com.nvidia.combo-uninstall-pkg" postinstall-action="none" version="0" format-version="2" generator-version="InstallCmds-662 (17A347)" auth="root">
    <bundle-version/>
    <upgrade-bundle/>
    <update-bundle/>
    <atomic-update-bundle/>
    <strict-identifier/>
    <relocate/>
    <scripts>
        <postinstall file="./postinstall"/>
    </scripts>
</pkg-info>root@x:/tmp/foo# ll
total 8
-rw-r--r--  1 root     wheel  475  5 Oct 17:10 PackageInfo
drwxr-xr-x  3 dwhitla  admin   96  5 Oct 17:10 Scripts
root@x:/tmp/foo# ll Scripts
total 8
-r-xr-xr-x  1 dwhitla  admin  3932  7 Sep 03:08 postinstall
root@x:/tmp/foo#cat Scripts/postinstall
#!/usr/bin/perl
#
# NVUninstall postinstall script
#

use strict;

print "Starting...\n";

## We only support uninstalling the Web Driver on the boot volume "/"
if ($ARGV[2] ne "/")
{
    print "Error: invalid target \"$ARGV[2]\"\n";

    exit(1);
}

my $appSupportPath = "/Library/Application Support/NVIDIA";
my $osBuild = `defaults read /System/Library/CoreServices/SystemVersion.plist ProductBuildVersion`;
chomp($osBuild);

## Create a directory in /tmp to move items for deletion to
my $uuid = `uuidgen`;
chomp($uuid);
my $ToBeDeleted = "/tmp/$uuid";
mkdir($ToBeDeleted, 0755);

print "Clearing NVRAM settings\n";
removeWebDriverBootArg();

print "Removing pref pane launchd plists\n";
removePrefPaneLaunchdPlists();

print "Removing pref pane bundle\n";
removePrefPaneBundle();

print "Removing var tmp directories\n";
removeVarTmpDirs();

print "Removing driver components\n";
removeWebDriverComponents();    # now /Library/Extensions too

print "Removing legacy web release files\n";
removeLegacyWebReleaseFiles();

print "Removing preference files\n";
removeNVUserPrefs();

print "Done\n";

##################################
## Work routines from here down ##
##################################

sub removeNVUserPrefs()
{
    my @users = `ls /Users 2> /dev/null`;

    foreach my $user (@users)
    {
        chomp($user);

        ##
        ## for some reason, `ls` includes entries that start
        ## with dot. so, explicitly skip it here.
        ##
        next if ($user =~ /^\./);

        my $prefsPath = "/Users/$user/Library/Preferences/ByHost";
        my @prefs = `ls $prefsPath/com.nvidia.nvagent.* $prefsPath/com.nvidia.nvprefpane.* 2> /dev/null`;

        foreach my $pref (@prefs)
        {
            chomp($pref);
            stageToDelete($pref);
        }
    }
}

sub removeLegacyWebReleaseFiles()
{
    stageToDelete("/Library/Application Support/NVIDIA/NVIDIA Driver Restore.mpkg");
    stageToDelete("/usr/bin/NVIDIARecovery");
}

sub removeWebDriverComponents()
{
    # also works with old kext location
    my @les = `/bin/ls -1 /Library/Extensions | egrep '^NVDA.*Web.kext\$|^GeForce.*Web.*\$'`;
    my @sles = `/bin/ls -1 /System/Library/Extensions | egrep '^NVDA.*Web.kext\$|^GeForce.*Web.*\$'`;

    foreach my $le (@les)
    {
        chomp($le);
        stageToDelete("/Library/Extensions/$le");
    }

    foreach my $sle (@sles)
    {
        chomp($sle);
        stageToDelete("/System/Library/Extensions/$sle");
    }
}

sub removePrefPaneLaunchdPlists()
{
    my $agentPlist = "/Library/LaunchAgents/com.nvidia.nvagent.plist";
    my $helperPlist = "/Library/LaunchDaemons/com.nvidia.nvroothelper.plist";

    # Delete agent plist
    stageToDelete($agentPlist);

    ## Delete root helper plist
    stageToDelete($helperPlist);
}

sub removePrefPaneBundle()
{
    stageToDelete("/Library/PreferencePanes/NVIDIA Driver Manager.prefPane");
}

sub removeVarTmpDirs()
{
    my @files = qw(nvmenu nvprefpane nvagent nvroothelper);

    foreach (@files)
    {
        stageToDelete("/var/tmp/com.nvidia/com.nvidia.$_");
    }
}

sub stageToDelete($)
{
    my $path = shift;

    if (-e $path)
    {
        system("/bin/mv -f '$path' $ToBeDeleted/.");
    }
}

sub removeWebDriverBootArg()
{
    ##
    ## $ nvram boot-args
    ## boot-args    debug=0x14e -v nvda_drv=1
    ##

    ## Create array of args from nvram
    my @args = split(/\s/, `nvram boot-args 2> /dev/null`);

    ## remove "boot-args" at the beginning
    shift(@args);

    ## remove "nvda_drv" and "nvda_drv=*"
    my @cleanArgs = grep {!/^nvda_drv$/ && !/^nvda_drv=/} @args;

    ## skip nvram if nothing has changed
    if (@args != @cleanArgs)
    {
        if (@cleanArgs)
        {
            system("/usr/sbin/nvram boot-args=\"@cleanArgs\"");
        }
        else
        {
            ## if the new args is empty, delete the boot-args entry.
            system("/usr/sbin/nvram -d boot-args");
        }
    }
}
 
Already did a clean install again, I will read again the instructions before installing the nv drivers..
I have now a working system without booting from USB
Before you do anything else:
- Enable RemoteManagement if you have ARD installed on another Mac, or ScreenSharing otherwise; and
- Enable Remote Login (the SSH service)
- Make a CCC or TimeMachine backup on a USB stick or external drive (should only need about 20GB)
 
Before you do anything else:
- Enable RemoteManagement if you have ARD installed on another Mac, or ScreenSharing otherwise; and
- Enable Remote Login (the SSH service)
- Make a CCC or TimeMachine backup on a USB stick or external drive (should only need about 20GB)
Will do, thanks,

What should I do next?
I have 1080 ti, need to install web drivers...
 
Last edited:
Maybe take a moment just now to add your system specs to your signature to help people provide the right advice.

Test that you can ssh to your new machine before doing something that may brick it.
Then follow the steps @kgp listed a few posts up.
Rather than edit config.plist, copy it to create a backup called config-<something>.plist. If your changes don't work you can select the alternate config-<something>.plist from the Options menu of the Clover bootloader.
If something goes wrong and WindowServer fails to display your login screen, at least you can ssh in to try again. If the system just kernel panics or spontaneously reboots, at the next clover screen hit SPACE and enable the nv_disable boot arg. It wont get you a login screen but will at least get you to the point you can ssh in.
 
Last edited:
View attachment 283275 Well that was short lived. My rig was working flawlessly for about 24 hours but now I get an error related to OSXaptiofixdrv.efi. Something about requested memory exceeds allocated memory. Not to sure how to fix. I see that this has been reported in the past on other builds but I can’t find any current advice. The strangest part is that I have not modified my EFI folder, this randomly started after no modifications. I verified the EFI folder vs a backup I took and it is exactly the same. Anyone have ideas how to correct this? I’m guessing my memmap got screwed on my motherboard but not sure how to fix it.

Listen, I encountered the same problem with OSXaptiofixdrv.efi today on my rig after adding a third PCie card.

Note the following fact: the i7-7800X and i7-7820X just have 28 PCI express 3.0 lanes! With a 16 lane graphics card most of the 28 lanes are already gone. If you use a PCIe NVMe few other lanes are gone.. If you add 1 or 2 more PCIe cards you exceed the 28 available lanes by far. The mobo in this case tries to disable some SATA-ports to implement the additional PCIe cards. However, apparently the resulting system configuration seems messy and unstable....

I suppose that the OSXaptiofixdrv.efi error at boot you dress above is related with this issue and limitation!

How to fix?

I removed the additional PCIe card.

I replaced OSXaptiofixdrv.efi by OsxAptioFix2Drv-free2000.efi, successfully rebooted the system and replaced again
OsxAptioFix2Drv-free2000.efi by OSXaptiofixdrv.efi... Now everything works again as expected!
 
Last edited:
@RuleBreaker01 , this is by default implemented such in the config.plist of my distributed EFi-Folder. That's why I did not even mention it... In addition to @dwhitla 's advice, let me add the following comment: you can also change the Timeout by editing your config.plist with Clover Configurator. Go to section "Boot" and change "Timeout", which I set to "5" by default.

However, I guess this was not the reason why clover stopped the automatic countdown at boot on your System. The reason might have been, that it came up on the "Boot File Prebooter from Preboot" partition, which is not bootable.. As I implemented in my config.plist by Clover Configurator in Section "Boot" that the "Default Boot Volume" is "LastBootedVolume", you might have erroneously intended to manually boot the "Boot File Prebooter from Preboot" partition before. Thus, clover intended to boot once more the latter partition and failed. As I said, in order to make Clover boot again automatically with a countdown the macOS High Sierra partition on your System disk, just successfully start and reboot your system once, by manually selecting the macOS High Sierra Partition in the Clover Boot Menu...

Cheers,

KGP


Thanks dwhitla for the advice but I checked, the Boot key still the same. As kgp said, somehow my boot drive creates another partition "FileVault Prebooter from Preboot" itself and it even boots into the system as well with that partition. I did manually boot from my original HS partition, restart but still no count down. I guess because I've been switching back and forth from MacOS HS and Windows 10 Pro to try out those OverClocking profiles I set and it might causing that. No biggie, I can always just reformat the Disk drive when I have my OC stable.. :D

dwhitla, do you plan to OC, you have the same chip I have, pls let me know if you success, :)
Thanks again,

 
Last edited by a moderator:
Fantastic news my friends!

Tracking.png


With little delay but now on it's way :lol::clap::headbang:

kgp.png
 
Fantastic news my friends!

View attachment 283413


With little delay but now on it's way :lol::clap::headbang:

View attachment 283416
When you install the I9 can you confirm you’re able to fully load the prime deluxe with pci devices and not hit the memory map issues from OSXAptiofixdrv.efi? I might be looking to send back my I7 and get an I9.
 
dwhitla, do you plan to OC, you have the same chip I have, pls let me know if you success, :)
This CPU/mainboard combination has heat issues already in the VRM. I don't plan to seriously overclock it until EK release a monoblock for it. Be warned - it won't be cheap. I used their configuration wizard to spec up a water cooling solution for just my CPU and 3 x GPUs and the price came to $1500. Water block should add about $300 to that.

For all practical purposes this machine is stupid fast already. Makes my $5000 2015 maxed out MacBook Pro feel quite slow by comparison.
 
  • Like
Reactions: kgp
Status
Not open for further replies.
Back
Top