Skip to main content

GPU VRAM Cleaner

Windows Linux macOS demo NVIDIA PyPI Python Downloads CI License Built with Textual

Tired of not being able to kill the processes that eat up your GPU? Now you finally can.

A terminal UI (Textual + colorama) for Windows Terminal / PowerShell that shows every NVIDIA GPU in the system and the processes holding its VRAM, and lets you close them to free memory.

GPU VRAM Cleaner with the Synthwave Neon theme

Features

  • One panel per GPU with model, driver version, temperature (°C), load, VRAM used/total, core and memory clocks (MHz) and power draw against the power limit (W).

  • Three live graphs per GPU, refreshed every second: VRAM %, fan % and load %.

  • Percentages and temperatures change color with their level (green / yellow / red):

    Reading Green Yellow Red
    VRAM, load < 60 % 60–84 % ≥ 85 %
    Fan < 50 % 50–79 % ≥ 80 %
    Temperature < 65 °C 65–79 °C ≥ 80 °C
  • Process list with each process's VRAM and GPU load % (the busiest GPU engine it uses, like Task Manager's GPU column, colored by level). Move with ↑ / ↓, press Del to get a Close process confirmation with Yes (selected by default) and Cancel (use ← / → to switch, Enter to confirm, Esc to cancel).

  • Menu (m) with:

    • Change theme: 7 color themes for borders and backgrounds (NVIDIA Green, Deep Ocean, Dracula Night, Solar Flare, Nord Frost, Paper Light and Synthwave Neon, the default). Themes preview live as you move; the choice is saved.
    • Radical clean: closes every process using VRAM in one go. It is marked Dangerous: two red confirmation popups, the second one asking "Are you sure? This can be potentially unsafe for your system." (Cancel is the default in both).
Close process Radical clean (Dangerous)
Close process dialog Radical clean second confirmation
NVIDIA Green theme Theme menu
NVIDIA Green theme Theme menu

Keeping Windows safe

Both the single close and the radical clean refuse to touch processes that Windows needs, so the desktop, login session and drivers keep working:

  • core system processes (System, csrss.exe, wininit.exe, winlogon.exe, services.exe, lsass.exe, svchost.exe, dwm.exe, explorer.exe, sihost.exe, ctfmon.exe, shell hosts, NVIDIA display container, ...);
  • anything running as SYSTEM, LOCAL SERVICE or NETWORK SERVICE, or that the app cannot inspect;
  • the app itself and its parent processes (the PowerShell and Windows Terminal running it).

Protected rows are marked protected in the list. Everything else that holds VRAM (games, browsers, Python/CUDA jobs, Blender, OBS, Discord, ...) is closed: first politely (terminate), then forcefully (kill) if it does not exit within 3 seconds. The whole app is closed, not just the process holding VRAM: browsers and Electron apps (Chrome, Edge, Discord, Claude, VS Code) keep the GPU in a helper process that the main window would respawn at once. Closing processes owned by other users requires running the terminal as administrator.

Install

gpu-vram-cleaner is on PyPI and works on Windows and Linux with an NVIDIA GPU and its driver installed (NVML ships with the driver). On macOS, or any machine without an NVIDIA card, it runs in --demo mode.

Install gpu-cleaner as a command available from any terminal with uv:

uv tool install gpu-vram-cleaner
uv tool update-shell   # only the first time: adds uv's tool folder to your PATH

If you don't have uv yet, install it first:

# Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
# Linux / macOS
curl -LsSf https://astral.sh/uv/install.sh | sh

pipx works too: pipx install gpu-vram-cleaner.

Open a new terminal and run:

gpu-cleaner

Update to the latest version with uv tool upgrade gpu-vram-cleaner, and remove it with uv tool uninstall gpu-vram-cleaner.

Tip: to close processes owned by other users or by system services, open the terminal as administrator (Windows) or run with sudo (Linux).

From a clone (development)

git clone https://github.com/andriusland/GPU-VRAM-Cleaner
cd GPU-VRAM-Cleaner
uv run gpu-cleaner

Options:

--demo          simulated GPUs and processes (nothing real is closed); handy without an NVIDIA card
--interval S    refresh interval in seconds (default 1)
--autoclean     close every unprotected process using VRAM and exit, without the UI
--dry-run       with --autoclean: only list what would be closed

Keys: ↑/↓ select · Del close process · m menu · t theme · x radical clean · q quit.

Clean VRAM from scripts

--autoclean runs the same protected radical clean as x, with no UI and no confirmation, so you can free the GPU right before a training run:

gpu-cleaner --autoclean --dry-run          # preview what would be closed
gpu-cleaner --autoclean; python train.py   # PowerShell
gpu-cleaner --autoclean && python train.py   # Linux: only train if every process was closed

It exits with 0 when every target is gone (or there was nothing to close) and 1 if any process could not be closed (for example, owned by another user without administrator rights).

On Windows, NVML cannot report per-process VRAM under the WDDM driver model (every GeForce card), so the app reads it from the Windows "GPU Process Memory" performance counters instead, the same source as Task Manager's "Dedicated GPU memory" column. Per-process load comes from the "GPU Engine" counters the same way (it shows N/A for the first second while Windows takes its first sample).

Development

The project was built test first (red → green → refactor).

uv run pytest          # tests (core logic + Textual UI driven with a fake GPU provider)
uv run ruff check .    # lint
uv run ruff format .   # format

Layout (src/gpu_vram_cleaner/):

Module Responsibility
provider.py NvmlGpuProvider (real GPUs via nvidia-ml-py) and DemoGpuProvider
models.py GpuInfo, GpuProcess
levels.py thresholds and colors for percentages and temperatures
history.py rolling sample buffer for the graphs
graph.py pure text rendering of the bar graphs
protection.py which processes must never be closed
wincounters.py per-process VRAM on Windows from the GPU performance counters
killer.py closing processes with psutil, radical clean planning
themes.py the color themes and saving the chosen one
app.py the Textual app, dialogs and menus

License

Licensed under the Apache License 2.0.

Metadata

Release files for gpu-vram-cleaner 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gpu-vram-cleaner 0.2.2
File Size Uploaded
gpu_vram_cleaner-0.2.2.tar.gz 24.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gpu-vram-cleaner 0.2.2
File Interpreter ABI Platform
gpu_vram_cleaner-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 54.3 kB

Release files / gpu_vram_cleaner-0.2.2.tar.gz

Download URL gpu_vram_cleaner-0.2.2.tar.gz
Size 24.7 kB
Tags Source
SHA-256 checksum
How to use checksums
099ddf69a521ac270839655adbaa14f6bbf039c2a0e42d1ba0e1d284eaf8c447
BLAKE2b-256 checksum
How to use checksums
8feb0478cd1a1eb5f20a26ef41221851d737377371d43b3747bcb36ed38d28a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / gpu_vram_cleaner-0.2.2-py3-none-any.whl

Download URL gpu_vram_cleaner-0.2.2-py3-none-any.whl
Size 29.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b9ede70108e04823c2cc7ee6ae8707601871ab41b980d924c5188fa75e5a291c
BLAKE2b-256 checksum
How to use checksums
00d1887db234287e2830cdcf9b0b3a6a28136501beb758808f74f2e608b625e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page