Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working with WinServer2016 + Nvidia 372.54 #30

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Generic fix to NVIDIA Code 43 on Virtual Machines
### Quick Instructions

1. Start NVIDIA Driver Setup, Exit Before Installing (Unpacks to C:/NVIDIA)
2. Install the appropriate WDK/DDK, See OS Support
2. Install the appropriate WDK/DDK (W10: https://docs.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk) , See OS Support
3. If on Windows 7, See Windows 7 Workaround
4. Enable Test Mode and Reboot
5. Open powershell and run patcher.ps1 C:/NVIDIA/DisplayDriver/Version/Win10_64/International/Display.Driver
4. Enable Test Mode (In admin cmd: bcdedit /set testsigning on) and Reboot
5. Open powershell and run patcher.ps1 C:\NVIDIA\DisplayDriver\372.54\Win10_64\International\Display.Driver
6. Install Driver Through Extracted Installer (In C:/NVIDIA/DisplayDriver/Version)

### Details
Expand Down Expand Up @@ -61,6 +61,9 @@ For some reason, at least on the test system, signtool in the Windows 7 WDK Pre-
Tested with a Asus Z170-WS, i7-6700k, and kernel 4.7
* libvirtd 2.3.0 running qemu 2.6.50 using OVMF UEFI, with PCIe ACS Override patch
* xen 4.7 using bios
* Tested with an ASRock Z170 Extreme7+, i7-6700k, GTX 980 Ti, and Windows Server 2016 Standard (v1607 build 14393.0)
* Stock Hyper-V role (Host) running Windows Server 2016 Standard (Guest, same version), Gen2 VM config v8, using Discrete Device Assignment
* Tested with HP Z400, Nvidia GTX 750 TI, Windows server 2016, kvm + BIOS (not UEFI), dumped ROM as per https://pve.proxmox.com/wiki/Pci_passthrough, proxmox 5.2-7, qemu 5.0-32, Nvidia Drivers 372.54

### Tested Non-Working Host Platforms
* libvirtd 2.3.0 running qemu 2.6.50 using bios
Expand Down
58 changes: 29 additions & 29 deletions gencert.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,35 @@ $adminRole=[System.Security.Principal.WindowsBuiltInRole]::Administrator

# Check to see if we are currently running "as Administrator"
if ($myWindowsPrincipal.IsInRole($adminRole))
{
# We are running "as Administrator" - so change the title and background color to indicate this
$Host.UI.RawUI.WindowTitle = $myInvocation.MyCommand.Definition + "(Elevated)"
$Host.UI.RawUI.BackgroundColor = "DarkBlue"
clear-host
}
{
# We are running "as Administrator" - so change the title and background color to indicate this
$Host.UI.RawUI.WindowTitle = $myInvocation.MyCommand.Definition + "(Elevated)"
$Host.UI.RawUI.BackgroundColor = "DarkBlue"
clear-host
}
else
{
# We are not running "as Administrator" - so relaunch as administrator
{
# We are not running "as Administrator" - so relaunch as administrator

# Create a new process object that starts PowerShell
$newProcess = new-object System.Diagnostics.ProcessStartInfo "PowerShell";
# Create a new process object that starts PowerShell
$newProcess = new-object System.Diagnostics.ProcessStartInfo "PowerShell";

# Specify the current script path and name as a parameter
[string[]]$argList = @('-ExecutionPolicy', 'Unrestricted')
$argList += $myInvocation.MyCommand.Definition
$argList += @('-directory', $pwd)
$newProcess.Arguments = $argList
# Specify the current script path and name as a parameter
[string[]]$argList = @('-ExecutionPolicy', 'Unrestricted')
$argList += $myInvocation.MyCommand.Definition
$argList += @('-directory', $pwd)
$newProcess.Arguments = $argList

# Indicate that the process should be elevated
$newProcess.Verb = "runas";
# Indicate that the process should be elevated
$newProcess.Verb = "runas";

# Start the new process
$process = [System.Diagnostics.Process]::Start($newProcess);
$process.WaitForExit()
# Start the new process
$process = [System.Diagnostics.Process]::Start($newProcess);
$process.WaitForExit()

# Exit from the current, unelevated, process
exit
}
# Exit from the current, unelevated, process
exit
}

$CertFile = Join-Path -Path $pwd -ChildPath "TestSign.cer"
Write-Host "Certificate Path: " $CertFile
Expand Down Expand Up @@ -72,24 +72,24 @@ if ($Certs.length -eq 0) {
else
{
Write-Host "New-SelfSignedCertificate Not Available, Falling Back To Makecert"

$makecert = 'C:/WinDDK/7600.16385.1/bin/amd64/makecert.exe'
if(-Not(Test-Path $makecert))
{
Write-Host "[!] Failure: Unable to find $makecert"
exit
}

& $makecert -r -pe -ss MY -n CN=SKSoftware -eku 1.3.6.1.5.5.7.3.3 $CertFile

}
}
else
{
Write-Host "Certificate Found in User Store"
$Cert = $Certs[0]
}

if (Get-Command Export-Certificate)
{
$output = Export-Certificate -Cert $Cert -FilePath $CertFile -Type CERT
Expand All @@ -99,8 +99,8 @@ if ($Certs.length -eq 0) {
$pfx = new-object System.Security.Cryptography.X509Certificates.X509Certificate2
$pfx.import($CertFile)
$store = new-object System.Security.Cryptography.X509Certificates.X509Store(
[System.Security.Cryptography.X509Certificates.StoreName]::Root,
"localmachine"
[System.Security.Cryptography.X509Certificates.StoreName]::Root,
"localmachine"
)
$store.open("MaxAllowed")
$store.add($pfx)
Expand Down
4 changes: 2 additions & 2 deletions patcher.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Write-Host '[+] Attempting to Test Sign Driver'
$inf2cat = ''
$signtool = ''

$inf2cat_paths = 'C:/Program Files (x86)/Windows Kits/10/bin/x86/Inf2Cat.exe', 'C:/WinDDK/7600.16385.1/bin/selfsign/Inf2Cat.exe'
$inf2cat_paths = 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.17134.0\x86\Inf2Cat.exe', 'C:/WinDDK/7600.16385.1/bin/selfsign/Inf2Cat.exe'
$signtool_paths = 'C:/Program Files (x86)/Windows Kits/10/Tools/bin/i386/signtool.exe', 'C:/WinDDK/7600.16385.1/bin/amd64/signtool.exe'

foreach($path in $inf2cat_paths)
Expand Down Expand Up @@ -138,7 +138,7 @@ if($winver.Major -eq 10)
if($ostype -eq '')
{
Write-Host "[!] Failure: Unable to determine OS type, see script"
exit
exit
}
Write-Host " [+] Detected OS Type: $ostype"

Expand Down