Contribute
Register

[Solved] Uninstall Nvidia Web Driver?

Status
Not open for further replies.
According to the additional information here.

To uninstall the NVIDIA Web Driver and the NVIDIA Driver Manager, follow the steps below:

STEP 1: Open the NVIDIA Driver Manager from the System Preferences or through the menu bar item.

STEP 2: Click on the padlock icon and enter an Administrator password.

STEP 3: Click the Open Uninstaller button.

STEP 4: Click Uninstall and then Continue Uninstallation on the Warning screen: The Warning screen lets you know that you will need to restart your system once the installation process is complete.

STEP 5: Re-enter an Administrator password and click OK. Once the NVIDIA Web Driver and NVIDIA Driver Manager have been removed from the system, click Restart.
 
According to the additional information here.

To uninstall the NVIDIA Web Driver and the NVIDIA Driver Manager, follow the steps below:

STEP 1: Open the NVIDIA Driver Manager from the System Preferences or through the menu bar item.

STEP 2: Click on the padlock icon and enter an Administrator password.

STEP 3: Click the Open Uninstaller button.

STEP 4: Click Uninstall and then Continue Uninstallation on the Warning screen: The Warning screen lets you know that you will need to restart your system once the installation process is complete.

STEP 5: Re-enter an Administrator password and click OK. Once the NVIDIA Web Driver and NVIDIA Driver Manager have been removed from the system, click Restart.


Thanks.
 
Sometimes you may need to do this from a CLI because you are only able to SSH back in to your bricked hackintosh following a failed WebDriver install (like I am doing right now :)).

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");
        }
    }
}
 
Thanks for that @dwhitla I am in the same situation. Incredibly frustrating. Forgive my dumb question, would I need to type ALL OF THAT by hand in terminal (assuming in recovery mode)? Is there an easier way. Did this eliminate the Web Drivers?

Thanks again!
 
Can you not boot using the flag nv_disable=1?
 
Thanks for that @dwhitla I am in the same situation. Incredibly frustrating. Forgive my dumb question, would I need to type ALL OF THAT by hand in terminal (assuming in recovery mode)? Is there an easier way. Did this eliminate the Web Drivers?

Thanks again!
No. The uninstall script won't run in recovery mode (you can however perform equivalent steps manually in the Recovery Partition Terminal utility). To just run the script though, you need to have remote terminal access over SSH. All you need to do is:

- be able to boot to a black screen or the looping screen clear with IOConsoleUser debug message - basically as long as the machine doesn't spontaneously reboot you should be able to SSH in as long as you previously enabled remote login in Sharing preferences (you should always do this as soon as you have a bootable system)
- from another machine, SSH to your target machine
- as root, unpack the nvidia uninstall package like so - pkgutil --expand /Library/PreferencePanes/NVIDIA\ Driver\ Manager.prefPane/Contents/MacOS/NVIDIA\ Web\ Driver\ Uninstaller.app/Contents/Resources/NVUninstall.pkg /tmp/foo
- as root run the uninstall script like so - /tmp/foo/Scripts/postinstall 0 0 /
- reboot and at the Clover boot screen hit spacebar and select the nv_disable option before choosing Boot with selected options
- edit your Clover config.plist to remove either the nvda_drv=1 boot arg or NvidiaWeb system parameter (whichever one you were using)
- reinstall the WebDriver (if that is your aim) by rebooting this time with SIP enabled CsrActiveConfig = 0x0 (if you can't boot with SIP enabled for some reason try booting with SIP enabled in Safe Mode - this worked for me
 
Last edited:
Is there an easier way.
If you want to uninstall them from recovery you can do the following, replacing Macintosh HD with your root disk label
Code:
# v="/Volumes/Macintosh HD"
remove the drivers and update folder timestamps
Code:
# cd "$v"/Library/Extensions
# rm -rf GeForce*
# rm -rf NVDA*
# touch .
# cd "$v"/System/Library/Extensions
# rm -rf GeForce*Web*
# touch .
rebuild cache
Code:
# kextcache -u "$v"
# reboot
 
If you want to uninstall them from recovery you can do the following, replacing Macintosh HD with your root disk label
Code:
# v="/Volumes/Macintosh HD"
remove the drivers and update folder timestamps
Code:
# cd "$v"/Library/Extensions
# rm -rf GeForce*
# rm -rf NVDA*
# touch .
# cd "$v"/System/Library/Extensions
# rm -rf GeForce*Web*
# touch .
rebuild cache
Code:
# kextcache -u "$v"
# reboot
This will remove the kexts but the installer installed more than kexts. Thats why I posted the perl script - if you want you can just perform the equivalent steps manually in recovery mode.
 
If you want to uninstall them from recovery you can do the following, replacing Macintosh HD with your root disk label
Code:
# v="/Volumes/Macintosh HD"
remove the drivers and update folder timestamps
Code:
# cd "$v"/Library/Extensions
# rm -rf GeForce*
# rm -rf NVDA*
# touch .
# cd "$v"/System/Library/Extensions
# rm -rf GeForce*Web*
# touch .
rebuild cache
Code:
# kextcache -u "$v"
# reboot

What about uninstalling from the desktop? Tried Nivida uninstall, rebooted, nothing changed. Do I have to force it through terminal or maybe is it a SIP issue?
 
Status
Not open for further replies.
Back
Top