From 85a529b61a8e825810cc39ec1db1e80ca5329759 Mon Sep 17 00:00:00 2001 From: trustno1-coder <361337194+trustno1-coder@users.noreply.github.com> Date: Thu, 26 Nov 2026 09:57:50 -0800 Subject: [PATCH] play-nvidia.ps1: windows BAR cap on by itself under 24 GB of RAM PR #8 made VICTORY_WINDOWS_BAR_MB opt-in (-WindowsBarMB). Without the switch, a 16 GB PC was back to the 0x8007000E crash about a minute into the world that PR #6 fixed: Windows lets the card share at most half the RAM, and the windows fill that. Now, when -WindowsBarMB is not given, PCs with under 24 GB of RAM get 3072 and larger ones keep the runtime default (off). -WindowsBarMB (0 included) and -More still decide when given; if the RAM can't be read, nothing is set. Co-Authored-By: Claude Opus 5.5 --- README.md | 10 ++++++---- scripts/play-nvidia.ps1 | 12 +++++++++++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 42f4787..53a6c1c 100644 --- a/README.md +++ b/README.md @@ -290,14 +290,16 @@ What to expect: memory. Use 720p or lower on Series S. - Series S cannot go above 1080p: its output is 1080p, and the script says so and stops if asked for more. -- **On 16 GB PCs, try `-WindowsBarMB 3072` with resizable BAR enabled.** +- **16 GB PCs: turned on for you, best with resizable BAR enabled.** On the tested 16 GB PC with an RTX 3060, shared GPU memory approached its limit about a minute into the world (`0x8007000E`, then a driver fault). The 3072 MiB cap from [PR #6](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/6) let eligible title memory windows use CPU-mapped VRAM while the card had room. - The launcher leaves this off by default. Pass a cap in MiB to - `play-nvidia.ps1` or any resolution wrapper. `-WindowsBarMB 0` disables it, - and `-More @{VICTORY_WINDOWS_BAR_MB='...'}` takes precedence. + The launcher sets it by itself on PCs with under 24 GB of RAM (Windows lets + the card share half the RAM) and leaves it off on larger ones. Pass a cap in + MiB to `play-nvidia.ps1` or any resolution wrapper to choose for yourself: + `-WindowsBarMB 0` disables it, and `-More @{VICTORY_WINDOWS_BAR_MB='...'}` + takes precedence. ### More than one card, and other cards diff --git a/scripts/play-nvidia.ps1 b/scripts/play-nvidia.ps1 index ba79f40..3918918 100644 --- a/scripts/play-nvidia.ps1 +++ b/scripts/play-nvidia.ps1 @@ -12,7 +12,8 @@ # (-Adapter '#1'). Default: Windows' default card (the one the main display is on). # -Build target\diag (the default, the build all measurements are of) or target\release # (the release build ignores the ray-tracing skip list: VICTORY_SKIP_PIPELINES is a diagnostics switch) -# -WindowsBarMB maximum MiB of title memory windows in CPU-mapped VRAM (0 by default). +# -WindowsBarMB maximum MiB of title memory windows in CPU-mapped VRAM (by default 3072 on PCs with under +# 24 GB of RAM, else 0; -WindowsBarMB 0 turns it off). # -More other settings: -More @{VICTORY_PANEL='1'} # Run it from a normal window, not as administrator: the driver then keeps its shader cache elsewhere. param( @@ -85,6 +86,15 @@ if ($Resolution) { if ($Adapter) { $settings.VICTORY_ADAPTER = $Adapter } if ($PSBoundParameters.ContainsKey('WindowsBarMB')) { $settings.VICTORY_WINDOWS_BAR_MB = $WindowsBarMB.ToString([Globalization.CultureInfo]::InvariantCulture) +} else { + # Without -WindowsBarMB, PCs with under 24 GB of RAM get 3072 (PR #6). Windows lets a card share at most half + # the RAM, and the windows filled that on a 16 GB PC (RTX 3060) about a minute into the world (0x8007000E, then + # a driver fault). 32 GB and more never got there, so they keep the runtime default (0, off). + $ram = try { (Get-CimInstance Win32_ComputerSystem -ErrorAction Stop).TotalPhysicalMemory } catch { 0 } + if ($ram -gt 0 -and $ram -lt 24GB) { + $settings.VICTORY_WINDOWS_BAR_MB = '3072' + Write-Host "$([math]::Round($ram / 1GB)) GB of RAM: title memory windows in the card's memory the CPU maps, up to 3 GB (-WindowsBarMB 0 turns this off)" + } } foreach ($k in $More.Keys) { $settings[$k] = $More[$k] } $scale = [double]::Parse($settings.VICTORY_RENDER_SCALE, [Globalization.CultureInfo]::InvariantCulture)