Cut VRAM Use on Windows: HAGS, Page File, Overhead
What actually frees VRAM for AI workloads on Windows — measured settings, documented mechanisms, and community estimates without independent verification.
On this page
- TL;DR
- What VRAM Actually Means on Windows
- Page File Sizing and VRAM: No Documented Link
- Desktop Overhead: What Actually Uses GPU Memory
- Browser Overhead
- Startup Programs and Background Apps
- NVIDIA Driver Installation: NVCleanstall vs. Standard Installer
- Windows Debloated Variants (AtlasOS, ReviOS, X-Lite, winutil)
- Dual-GPU Configuration (iGPU for Display, dGPU for AI)
- Common Errors and Fixes
- FAQ
- Sources
Cutting VRAM Use on Windows: Hardware-Accelerated GPU Scheduling, Page File Sizing, Browser and Desktop Overhead
TL;DR
- Hardware-accelerated GPU scheduling (HAGS) reduces GPU scheduling latency but does not reduce VRAM usage — the Microsoft DirectX team documents it as a scheduling change only.
- The Windows desktop compositor (dwm.exe) and browsers consume shared GPU memory; the source article (Civitai 8085) estimates this may reach up to 2 GB. Disabling transparency, lowering resolution, and turning off browser hardware acceleration can shrink the shared pool but not the AI compute pool.
- No Microsoft or NVIDIA documentation ties page file size to VRAM availability for CUDA workloads — page file affects system RAM swap, not GPU VRAM.
If the real problem is that the card is too small for the model, our VRAM requirements by model covers what fits where.
What VRAM Actually Means on Windows
Windows reports two GPU memory categories in Task Manager: Dedicated GPU memory (the physical VRAM on your discrete GPU) and Shared GPU memory (a portion of system RAM that the OS can map into the GPU address space). AI frameworks (PyTorch, Stable Diffusion WebUI, ComfyUI) allocate from the dedicated pool through CUDA or DirectML. The desktop compositor, browsers, and Windows Terminal draw from the shared pool via DirectX/DirectWrite. The two pools are distinct on discrete GPUs — shrinking the shared pool does not grow the dedicated pool available to CUDA.
To see the split, open Task Manager → Details → right-click column headers → enable Dedicated GPU memory and Shared GPU memory. This shows per-process GPU memory broken down by pool. Microsoft Learn: Autoruns utility description (verifies the tool used to audit startup programs that may launch GPU-using apps).
Introduced with the Windows 10 May 2020 update, HAGS moves the GPU scheduler from a high-priority CPU thread onto a dedicated scheduling processor on the GPU itself. The DirectX Developer Blog states: "Windows can now offload most of GPU scheduling to a dedicated GPU-based scheduling processor" and "The settings page can be reached through Settings → System → Display → Graphics Settings." DirectX Developer Blog: Hardware Accelerated GPU Scheduling
What HAGS changes: frame pacing, multi-application GPU fairness, and submission latency. The old WDDM scheduler ran on the CPU; HAGS runs on a fixed-function block inside the GPU.
What HAGS does not change: VRAM allocation, CUDA context memory, or model weight footprint. The blog explicitly says "most applications have been designed to hide scheduling costs through buffering" and "We do not expect customers to experience performance regressions." It makes no claim about VRAM reduction. Enabling HAGS is recommended for smoother multi-app GPU sharing, not for freeing VRAM.
| Setting | Location | Effect on VRAM | Source |
|---|---|---|---|
| Hardware-accelerated GPU scheduling | Settings → System → Display → Graphics Settings | None — scheduling only | DirectX Dev Blog |
| Opt-in default | Off by default (Windows 10 May 2020+) | N/A | DirectX Dev Blog |
Page File Sizing and VRAM: No Documented Link
The Windows page file (pagefile.sys) backs committed system memory when physical RAM is exhausted. Neither Microsoft documentation nor NVIDIA driver documentation describes a mechanism where page file size influences dedicated GPU VRAM available to CUDA/DirectML workloads. The page file operates at the system RAM layer; VRAM is managed by the WDDM driver and the GPU scheduler independently.
If your system RAM is undersized relative to your workload, enlarging the page file prevents OOM kills but adds swap latency — it does not create additional VRAM. For AI workloads that fit in system RAM but exceed VRAM, the bottleneck is the PCIe transfer and the GPU's own memory controller, not the page file.
| Claim | Verified? | Notes | |
|---|---|---|---|
| Larger page file = more VRAM for AI | No | No primary source supports this | |
| Page file affects shared GPU memory | Indirectly | Shared GPU memory draws from system RAM commit; page file backs system RAM commit | |
| Windows automatically manages shared GPU memory | Yes — WDDM dynamically manages allocation | No primary source quantifies the shared pool cap | DirectX Dev Blog mentions WDDM but not pool caps |
For the allocator side of the same problem, see PyTorch CUDA allocator tuning.
Desktop Overhead: What Actually Uses GPU Memory
Windows Compositor (dwm.exe)
The Desktop Window Manager composites the desktop, windows, and effects using DirectX. It allocates surfaces from the shared GPU memory pool, not the dedicated VRAM pool used by CUDA. The Civitai community article claims "An average windows (wdm.exe), browser and etc. use up to 2GB VRAM in background" — this figure is a community estimate with no measurement methodology published. Civitai article 8085
Visual Effects and Transparency
- Transparency effects (Settings → Personalization → Transparency effects → Off): Forces dwm.exe to use opaque surfaces, reducing shared GPU memory consumption. No public Microsoft benchmark quantifies the savings in MB.
- Visual effects → Adjust for best performance (System Properties → Advanced → Performance): Disables animations, shadows, and glass effects. Reduces compositor surface count.
- Lower display resolution & refresh rate: Fewer pixels per frame reduces compositor surface memory. Direct relationship between pixel count and surface memory; exact VRAM impact is unquantified. Civitai article 8085 lists this as a recommendation without measurement.
Windows Terminal
Windows Terminal uses GPU-accelerated text rendering via DirectWrite/DirectX. The Microsoft Learn overview states: "Windows Terminal uses the GPU to render its text, so it provides better performance than the default Windows command line experience." Microsoft Learn: Windows Terminal overview This rendering uses the graphics/composition VRAM context, not the CUDA compute context. Disabling Terminal GPU acceleration (via Terminal settings → Profile → Appearance → "Use hardware acceleration" = Off) reduces glyph atlas memory in the shared pool, but does not free dedicated VRAM for AI workloads.
| Action | Pool Affected | Estimated Savings | Verification |
|---|---|---|---|
| Disable transparency effects | Shared GPU memory | Unquantified | Community-reported only |
| "Adjust for best performance" | Shared GPU memory | Unquantified | No Microsoft benchmark |
| Lower resolution (4K → 1080p) | Shared GPU memory | Reduces surface memory (exact MB unquantified) | No primary measurement found |
| Disable Terminal hardware acceleration | Shared GPU memory | Glyph atlas memory (unquantified) | Microsoft Terminal docs confirms GPU-accelerated rendering, not the savings from disabling it |
On a 8GB card specifically, the FLUX on 8GB guide shows which quantisation makes the model load at all.
Browser Overhead
Hardware Acceleration
Browsers (Chrome, Edge, Firefox) enable GPU acceleration by default for compositing, video decode, and WebGL/WebGPU. This allocates textures and command buffers in the shared GPU memory pool. Disabling it (Settings → System → "Use graphics acceleration when available" → Off) forces software rendering, moving those allocations to system RAM.
| Browser Setting | Pool Affected | Mechanism | Verified VRAM Impact |
|---|---|---|---|
| Disable hardware acceleration | Shared GPU memory | Software rasterization | Community-reported only |
chrome://gpuclean | Shared GPU memory | Undocumented | No primary source |
| Memory Saver → Maximum | Shared GPU memory | Tab discard | No published measurement |
| Close unused tabs | Shared GPU memory | Process termination | Direct (process dies) |
Startup Programs and Background Apps
Autoruns (Sysinternals) enumerates every auto-start location: Run/RunOnce keys, Explorer add-ons, Browser Helper Objects, AppInit DLLs, Winlogon notifications, services, and scheduled tasks. Microsoft Learn: Autoruns Disabling unnecessary startup entries reduces the number of processes that may initialize GPU contexts (e.g., game launchers, overlay tools, update checkers). The VRAM savings depend entirely on which programs you disable — no generic figure exists.
NVIDIA Driver Installation: NVCleanstall vs. Standard Installer
NVCleanstall strips components from the GeForce driver package: GeForce Experience, telemetry, HD Audio driver, NVENC encoder components, etc. TechPowerUp: NVCleanstall downloads The remaining driver still contains the full CUDA runtime, Vulkan ICD, and OpenGL ICD. Runtime VRAM usage for AI workloads is identical — NVCleanstall affects disk footprint, install time, and background services, not the CUDA memory allocator.
| Installer | Components Removed | Runtime VRAM Difference |
|---|---|---|
| Standard (GeForce Experience) | None | Baseline |
| NVCleanstall | GFE, telemetry, audio, Ansel, etc. | None (same CUDA runtime) |
Windows Debloated Variants (AtlasOS, ReviOS, X-Lite, winutil)
These community projects remove Windows components, services, and scheduled tasks to reduce background resource usage. AtlasOS describes itself as "an optimized version of Windows, designed for enthusiasts and gamers." ReviOS claims to "reclaim the system you deserve — fast, private, stable." winutil is a PowerShell script collection for manual debloating.
VRAM impact: None of these projects publish GPU memory benchmarks. They reduce system RAM usage and CPU interrupts, which may indirectly reduce shared GPU memory pressure, but no dedicated VRAM savings are documented.
Dual-GPU Configuration (iGPU for Display, dGPU for AI)
Routing display output through the integrated GPU while reserving the discrete GPU for compute is a valid architecture. On Windows with WDDM, the compositor runs on the GPU driving the display. If the iGPU drives all monitors, dwm.exe allocates its surfaces from the iGPU's shared memory, leaving the dGPU's dedicated VRAM largely untouched by the desktop.
Caveat: The claim that this yields "0% VRAM usage of RTX 5090" is a community assertion Civitai article 8085. No NVIDIA or Microsoft documentation quantifies the residual dGPU VRAM consumption in this configuration. Some driver versions may still allocate minimal contexts on the dGPU for CUDA initialization or power management.
Common Errors and Fixes
| Symptom | Cause | Fix | Source |
|---|---|---|---|
| HAGS enabled but VRAM unchanged | HAGS optimizes scheduling, not memory | Use HAGS for multi-app fairness; do not expect VRAM reduction | DirectX Dev Blog |
chrome://gpuclean does not free VRAM | URL undocumented; may only reset GPU process | Close tabs instead; disable hardware acceleration if needed | No primary source |
| Page file increased, OOM persists | Page file backs system RAM, not VRAM | Reduce model batch size, enable CPU offload, or add physical RAM | Architecture fact |
| Transparency off but VRAM same | Transparency affects shared pool, not dedicated VRAM | Check Task Manager "Shared GPU memory" column for change | Windows memory architecture |
FAQ
Does disabling Windows Transparency Effects reduce VRAM? It reduces shared GPU memory used by the compositor. Dedicated VRAM available to CUDA/DirectML is unaffected. Check Task Manager → Shared GPU memory column to observe the difference.
How much VRAM does dwm.exe use on Windows with a discrete GPU? No official Microsoft figure exists. Community estimates range from a few hundred MB to ~2 GB in the shared GPU memory pool, depending on resolution, refresh rate, and number of monitors. The dedicated VRAM pool is separate.
Does chrome://gpuclean actually free GPU memory or just reset the context? Unknown — no Chromium documentation describes this endpoint. Community reports suggest it restarts the GPU process, which would release its allocations, but this is unverified.
Why does HAGS not reduce VRAM, and what does it actually optimize? HAGS moves the GPU scheduler from a CPU thread to a dedicated GPU scheduling processor. It improves frame pacing and reduces submission latency between applications sharing the GPU. It does not manage VRAM allocation. DirectX Dev Blog
Does NVCleanstall change VRAM usage at inference time? No. NVCleanstall removes installer components (GeForce Experience, telemetry, audio driver). The installed CUDA runtime and driver memory manager are identical. TechPowerUp NVCleanstall
Does page file size affect VRAM available to Stable Diffusion / ComfyUI? No. The page file backs committed system memory. VRAM is managed by the WDDM driver and the GPU scheduler independently. If system RAM is exhausted, a larger page file prevents process kills but does not increase VRAM.
What is the fastest way to free shared GPU memory before an AI run? Close browser tabs and GPU-accelerated apps (Discord, Steam, game launchers). Disable transparency effects. Restart Windows Terminal if hardware acceleration is enabled. These shrink the shared pool; the dedicated VRAM pool for AI is unchanged.