Last active
May 15, 2025 16:24
-
-
Save JPersson77/91a5c53af55104a2bfc5c9be32118203 to your computer and use it in GitHub Desktop.
nVAppAppApp - workaround NVIDIA DLSS4 whitelisting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# Workaround for NVIDIA's DLSS4 whitelisting | |
DLSS4 was launched alongside the RTX 5000 series and comprise several new and interesting | |
features, f.e. additional presets for Super Resolution, using a newer Transformer model. | |
Arguably these features increase image quality significantly. To various degrees these | |
features are also available for older RTX cards, and older games using DLSS3/2. | |
Using third party apps like DLSS Swapper etc remains a convenient way to, on a manual basis, | |
swap out DLLs which contain the above mentioned functionality, per game. Downsides to this is | |
primarily that swapping out DLLs for online multi-player games may trigger an Anti-Cheat | |
system, and there is of course also some manual work of updating to newer versions/DLLs. | |
With the launch of DLSS4 nVidia has taken steps to integrate some functionality in their | |
NVIDIA App to also let the user "swap" DLSS versions manually. This is in theory nice as it | |
allows for games to automatically be updated to the latest and greatest by driver updates. | |
Plus, it means that DLLs aren't actually "swapped" since it is done by a dynamic loading | |
mechanism, which shouldmean that DLSS versions CAN be switched for (many) online multi- | |
player games. | |
BUT their implementation is too restrictive. | |
You may have noticed how DLSS4 needs to be enabled on a per game basis in NVIDIA app, and | |
also how the feature can not be enabled for all games using DLSS3/2. This is because | |
nVidia decided to implement the features using a whitelisting mechanism. I.e. the feature | |
can only be enabled on games deemed "supported" by nVidia. There are actually good reasons for | |
nVidia to implement a whitelisting system, for example to ensure that DLSS4 provides a good | |
image quality in "supported" games, and to avoid potentially triggering Anti-Cheat systems | |
for online multi-player games. | |
Using nVidia Profile Inspector, and similar tools, it is nevertheless possible to set the | |
global profile, or per game, to use the updated DLLs and thus force DLSS4 features on all/ | |
select games. However NVIDIA App is actually rather controlling about this and will reverse | |
these changes for "unsupported" games when the app is launched or when an unsupported game | |
is launched. | |
A workaround currently is to not install NVIDIA App, and instead use nVidia Profile Inspector. | |
But I personally find the overlay and RTX HDR worth keeping NVIDIA App installed for. It may | |
eventually also become mandatory to have installed. | |
Going through some hoops it is fortunately possible to override the whitelisting and keep | |
NVIDIA App installed. The script below is a powershell (v5.1+) script which the user should | |
run once, and then potentially before driver (re-)install to allow the driver installer to | |
update a write-protected file (fingerprint.db). | |
So what does the script do: | |
A) Present the user with a menu with three options: | |
1. Driver upgrade - run this before updating nVidia driver and follow instructions | |
2. Run script - same functionality as previously (patch files) | |
3. Quit - Exit the menu and quit the script | |
Both options 1 and 2 will do the following: | |
1) Remove "ReadOnly" property on two files. | |
- ApplicationStorage.json which contains the settings for detected games on the system | |
- fingerprint.db which is the origin file for all override settings | |
2) Modify the files to remove the override restrictions put in place by NVIDIA App. | |
3) Set the origin file (fingerprint.db) to "Read Only" | |
4) Restart two nVidia services <- this require admin rights for the script. Otherwise you | |
need to restart the computer for it to take effect. | |
PLEASE NOTE THE FOLLOWING! | |
1) This script should run as administrator to be able to restart two nVidia services | |
2) This script will/may allow for updating your online multi-player game's DLSS versions | |
which may or may not trigger Anti-Cheat systems. I tried it with Space Marines 2 | |
successfully (totally worth it) but YMMV. | |
3) The screen will blink/black out twice when the services restart | |
USE AT YOUR OWN DISCRETION! Be careful with online multi player games with Anti-Cheat systems! | |
ADDITIONAL NOTE ON HOW TO RUN POWERSHELL SCRIPTS (added 2025-02-25) | |
By default an unsigned script (like nVAppAppApp.ps1) downloaded to your local machine can | |
not be executed - for security reasons. It is possible to workaround by starting powershell | |
with a temporary bypass or by setting a permanent override. To do a temporary workaround | |
you would press WIN+R to get the Run-dialog and execute: | |
`powershell -executionpolicy bypass` | |
To set a permanent override you type "powershell" on the start-menu, right click and select | |
"Run as administrator" and once you are at the PowerShell command prompt execute: | |
`Set-ExecutionPolicy unrestricted` | |
In either case you now have a PowerShell prompt open that can/will run the script. | |
Version 2 | |
- UTF-8 w/o BOM | |
Version 3 | |
- Modify the override origin file (fingerprint.db) | |
- Changed modus operandi - run the script after reinstalling driver | |
Version 4 (2025-02-25) | |
- No change to the actual script. It works good and the effects seem to persist even | |
through driver installs. | |
- Added notes on how to allow PowerShell to run local scripts | |
Version 5 (2025-03-10) | |
- Added a user friendly menu with three options. | |
1. Driver upgrade. Run the script before installing a new driver and follow the isntructions. | |
2. Run the script (same functionality as before) | |
3. Quit | |
#> | |
#Requires -Version 5.1 | |
$AppStorageJsonPath = "$Env:USERPROFILE\AppData\Local\NVIDIA Corporation\NVIDIA app\NvBackend\ApplicationStorage.json" | |
$FingerprintPath = "$Env:USERPROFILE\AppData\Local\NVIDIA Corporation\NVIDIA app\NvBackend\ApplicationOntology\data\fingerprint.db" | |
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False | |
#region Initial Checks | |
function Check-AdminRights { | |
$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent()) | |
return $currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) | |
} | |
$isAdmin = Check-AdminRights | |
if (-not $isAdmin) { | |
Write-Host "`nWARNING: Not running with administrator privileges" -ForegroundColor DarkRed | |
Write-Host "Service restarts will fail. To ensure full functionality:" -ForegroundColor Gray | |
Write-Host "Right-click PowerShell and select 'Run as administrator'`n" -ForegroundColor Gray | |
Start-Sleep -Seconds 5 | |
} | |
#endregion | |
function Show-Header { | |
Clear-Host | |
Write-Host "`n" | |
Write-Host "========================================================" -ForegroundColor Green | |
Write-Host " NVIDIA DLSS4 Whitelist Workaround Script " -ForegroundColor Black -BackgroundColor Green | |
Write-Host "========================================================" -ForegroundColor Green | |
Write-Host "`n" | |
} | |
function Run-Script { | |
# Remove Read-Only from both files | |
Set-ItemProperty -Path $AppStorageJsonPath -Name IsReadOnly -Value $false | |
Set-ItemProperty -Path $FingerprintPath -Name IsReadOnly -Value $false | |
# Modify ApplicationStorage.json | |
Write-Host "`n Modifying ApplicationStorage.json..." -ForegroundColor White | |
$contents = (Get-Content $AppStorageJsonPath ) | |
$contents = $contents.Replace('"Disable_FG_Override":true', '"Disable_FG_Override":false') | |
$contents = $contents.Replace('"Disable_RR_Override":true', '"Disable_RR_Override":false') | |
$contents = $contents.Replace('"Disable_SR_Override":true', '"Disable_SR_Override":false') | |
$contents = $contents.Replace('"Disable_RR_Model_Override":true', '"Disable_RR_Model_Override":false') | |
$contents = $contents.Replace('"Disable_SR_Model_Override":true', '"Disable_SR_Model_Override":false') | |
[System.IO.File]::WriteAllLines($AppStorageJsonPath, $contents, $Utf8NoBomEncoding) | |
# Modify fingerprint.db | |
Write-Host "`n Modifying fingerprint.db..." -ForegroundColor White | |
$contents = (Get-Content $FingerprintPath ) | |
$contents = $contents.Replace('<Disable_FG_Override>1</Disable_FG_Override>', '<Disable_FG_Override>0</Disable_FG_Override>') | |
$contents = $contents.Replace('<Disable_RR_Model_Override>1</Disable_RR_Model_Override>', '<Disable_RR_Model_Override>0</Disable_RR_Model_Override>') | |
$contents = $contents.Replace('<Disable_RR_Override>1</Disable_RR_Override>', '<Disable_RR_Override>0</Disable_RR_Override>') | |
$contents = $contents.Replace('<Disable_SR_Model_Override>1</Disable_SR_Model_Override>', '<Disable_SR_Model_Override>0</Disable_SR_Model_Override>') | |
$contents = $contents.Replace('<Disable_SR_Override>1</Disable_SR_Override>', '<Disable_SR_Override>0</Disable_SR_Override>') | |
[System.IO.File]::WriteAllLines($FingerprintPath, $contents, $Utf8NoBomEncoding) | |
# Set fingerprint.db to Read-Only | |
Set-ItemProperty -Path $FingerprintPath -Name IsReadOnly -Value $true | |
# Restart services (requires admin rights) | |
if ($isAdmin) | |
{ | |
try { | |
Write-Host "`n Restarting NVIDIA services..." -ForegroundColor White | |
Restart-Service -Force -Name "NVDisplay.ContainerLocalSystem" -ErrorAction Stop | |
Restart-Service -Force -Name "NvContainerLocalSystem" -ErrorAction Stop | |
Write-Host "`n Services restarted successfully" -ForegroundColor Green | |
} | |
catch { | |
Write-Host "`n ERROR: Failed to restart services" -ForegroundColor DarkRed | |
Write-Host " Details: $_" -ForegroundColor DarkRed | |
} | |
} | |
else { | |
Write-Host "`n WARNING: Services not restarted" -ForegroundColor DarkRed | |
Write-Host " Run as administrator for complete functionality" -ForegroundColor DarkRed | |
} | |
Write-Host "`n Operation completed!`n" -ForegroundColor Black -BackgroundColor Green | |
} | |
# Display menu | |
do { | |
Show-Header | |
Write-Host " MAIN MENU" -ForegroundColor Green | |
Write-Host "--------------------------------------------------------" -ForegroundColor Green | |
Write-Host " 1. Start driver upgrade mode" -ForegroundColor White | |
Write-Host " - Prepares for driver update" -ForegroundColor DarkGray | |
Write-Host " - Patches files after confirmation" -ForegroundColor DarkGray | |
Write-Host "`n 2. Run script immediately" -ForegroundColor White | |
Write-Host " - Patch files directly" -ForegroundColor DarkGray | |
Write-Host "`n 3. Exit" -ForegroundColor White | |
Write-Host " - Quits the tool" -ForegroundColor DarkGray | |
Write-Host "--------------------------------------------------------" -ForegroundColor Green | |
$choice = Read-Host "`n Please enter your choice (1-3)" | |
switch ($choice) { | |
'1' { | |
Show-Header | |
Write-Host " DRIVER UPGRADE MODE" -ForegroundColor Green | |
Write-Host "--------------------------------------------------------" -ForegroundColor Green | |
Set-ItemProperty -Path $FingerprintPath -Name IsReadOnly -Value $false -ErrorAction SilentlyContinue | |
Write-Host "`n Read-only attribute removed from fingerprint.db" -ForegroundColor White | |
Write-Host "`n Perform your driver upgrade now!" -ForegroundColor White | |
Write-Host "`n Press any key AFTER the driver is installed..." -ForegroundColor White | |
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown') | |
Run-Script | |
pause | |
} | |
'2' { | |
Show-Header | |
Write-Host " PATCHING FILES" -ForegroundColor Green | |
Write-Host "--------------------------------------------------------" -ForegroundColor Green | |
Run-Script | |
pause | |
} | |
'3' { | |
Show-Header | |
Write-Host " Exiting... Thank you for using the tool!" -ForegroundColor Gray | |
Start-Sleep -Seconds 2 | |
exit | |
} | |
default { | |
Write-Host "`n Invalid selection. Please choose 1, 2, or 3." -ForegroundColor DarkRed | |
Start-Sleep -Seconds 2 | |
} | |
} | |
} while ($true) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks you, it's a bit confusing for me I do not know how to do but thanks for taking time to reply ;)
My driver 572.83 is already installed, I have uninstall all other nvidia stuff using BCU, and I will try to :
Seems correct to you ?
EDIT 1 :
So I tried what I wrote above.
I managed to launch NvidiaApp, but in the game I added, I couldn't change the DLSS (everything was blank : This game cannot be optimized... ).
After a while, I got an error message, and now NvidiaApp isn't working at all even if I quit and re-launch it...
So it seems that if we apply a patch after adding a game manually, NvidiaApp is not functionnal anymore... weird...
EDIT 2: Back to NvidiaApp v11.0.2.341 and all is OK now...