Windows + AMD GPU: GPU stats polling runs amd-smi, which triggers repeated UAC prompts for diskpart.exe

Open Beginner friendly
#12,027 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Root cause is pinned to marimo/_server/api/endpoints/health.py: _is_gpu_available() (~line 471) detects amd-smi.exe on PATH, and the /api/usage handler (~line 614) then shells out to it every poll. Read both spots plus the existing tests around host/GPU stats under tests/_server/api/endpoints/ to see how the platform check and mocking are done. Add a sys.platform != "win32" guard (or equivalent) so the AMD branch is never taken on Windows, then run those tests and confirm CPU/memory stats still return with GPU absent. Done means no amd-smi invocation on Windows and a test covering the skipped path.

Written by the indexing model from the issue text.

Description

bug
Describe the bug

On Windows with an AMD GPU, opening any notebook makes Windows show a UAC prompt ("Do you want to allow this app to make changes to your device?") for diskpart.exe. The prompt comes back again and again while the notebook is open. Closing it does not help.

This only happens on main. The amd-smi code path was added in #11568 (merged 2026-11-02), and the latest release (0.25.2) does not include it yet. So it should start for all Windows + AMD users with the next release.

What I found

  1. The footer polls /api/usage every 10 seconds (machine-stats.tsx#L25).
  2. On this machine, _is_gpu_available() finds amd-smi and returns "amd" (health.py#L471). The AMD Windows driver installs amd-smi.exe in C:\Windows\System32, so it is always on PATH.
  3. Every /api/usage call then runs amd-smi monitor --vram-usage --json and amd-smi static --json (health.py#L614).
  4. The Windows build of amd-smi.exe runs powershell -Command diskpart /? internally. diskpart.exe needs administrator rights, so Windows shows a UAC prompt each time.

I confirmed this by watching new processes while a notebook was open. Each UAC prompt (consent.exe) showed up right after the marimo server process started amd-smi.exe. The string powershell -Command diskpart /? is also in the amd-smi.exe binary.

Workaround

Making _is_gpu_available() return False stops the prompts completely. The rest of the footer stats (CPU, memory) keep working.

Possible fix

One option is to skip amd-smi on Windows (sys.platform == "win32"). The Windows amd-smi does not seem safe to call in the background. Another option is to only collect GPU stats when the user asks for them.

Will you submit a PR?
  • Yes
Environment
{
  "marimo": "0.25.2",
  "editable": true,
  "OS": "Windows",
  "OS Version": "11",
  "Processor": "AMD64 Family 26 Model 36 Stepping 0, AuthenticAMD",
  "Python Version": "3.12.16",
  "Locale": "English_United States",
  "Binaries": {
    "Browser": "158.0.8127.37",
    "Node": "v24.22.3",
    "uv": "0.13.9 (x86_64-pc-windows-msvc)"
  },
  "Dependencies": {
    "click": "8.2.1",
    "docutils": "0.23",
    "itsdangerous": "2.2.0",
    "jedi": "0.20.1",
    "markdown": "3.11.3",
    "narwhals": "2.28.0",
    "packaging": "25.0",
    "psutil": "7.2.2",
    "pygments": "2.19.2",
    "pymdown-extensions": "11.0.2",
    "pyyaml": "6.0.2",
    "starlette": "0.47.2",
    "tomlkit": "0.15.2",
    "typing-extensions": "4.14.1",
    "uvicorn": "0.35.0",
    "websockets": "15.0.1"
  },
  "Optional Dependencies": {
    "duckdb": "2.0.0",
    "openai": "3.51.0",
    "pyarrow": "26.0.1",
    "pytest": "8.4.1",
    "ruff": "0.17.5",
    "sqlglot": "30.31.0"
  },
  "Experimental Flags": {
    "cache_panel": true,
    "multi_column": true,
    "isolate_apps": true,
    "debugger": false,
    "line_timing": false,
    "execution_type": "relaxed"
  }
}
  • marimo installed from source at commit 9d1efaf43 (main, 2026-11-21). The version string still says 0.25.2.
  • OS: Windows 11 Pro, build 26300
  • GPU: AMD Radeon(TM) 890M Graphics, driver 32.0.21025.33002 (2026-07-06)
Code to reproduce

No special code is needed. Any notebook works:

import marimo

app = marimo.App()


@app.cell
def _():
    return


if __name__ == "__main__":
    app.run()
  1. Use a Windows machine with an AMD GPU and the AMD driver installed (so amd-smi.exe is in C:\Windows\System32).
  2. Install marimo from main (any commit after #11568).
  3. Run marimo edit notebook.py and open the notebook in the browser.
  4. Within a few seconds, a UAC prompt for diskpart.exe appears. It keeps coming back while the notebook is open.
Dominant language
Python
Stars
22.9k
Forks
1.3k
Avg merge
1d 10h
Merged PRs (30d)
380

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from marimo-team/marimo

All issues in marimo-team/marimo

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.