ARIA 930e56bd07 Clean up LSP diagnostics across backend and frontend
Backend (nvcurve/):
- hal/fans.py, hal/limits.py, hal/gpu.py: replace conditional pynvml
  imports with the established 'pynvml: Any = _pynvml_import' pattern
  (fixes ~50 'possibly unbound' errors); type the result dicts; guard
  query_interface() results; explicit uuid/pci-bus parsing (int, hex
  convention documented); modernize Optional[T] -> T | None
- cli.py: fix 'curve_state' possibly-unbound and snap_path None handling
  in cmd_setup; wrap unchecked int()/open()/makedirs() calls in
  try/except with clean CLI errors; add module logger for silent
  except-pass blocks; raise ... from exc; fix unused loop vars and
  set-comprehension
- hal/snapshot.py: filepath: str | None; wrap all file ops; sorted
  imports; remove unused CT_POINTS import
- daemon.py: extract 0o666 to _SOCKET_MODE constant (intentional for
  /run sockets) with nosemgrep
- server.py: nosemgrep for Python 3.7-compat false positive (project
  requires >= 3.12); log previously-swallowed exception
- profiles/native.py, profiles/apply.py: wrap file ops and int(k)
  profile-key parsing; sorted imports; modernize typing

Frontend (frontend/src):
- Add .js extensions to all relative imports (standard TS-ESM; Vite
  resolves .js -> .ts)
- React.FormEvent (deprecated in React 19 types) -> React.SubmitEvent
- catch (e: any) -> catch (e: unknown) + instanceof Error narrowing
- React-hooks: move ref writes from render into effects; convert
  viewport reset to render-phase state adjustment; split
  selectPoint(index, multi) into selectPoint + togglePoint (no flag
  argument); remove non-null assertion
- Static inline styles -> Tailwind classes (dynamic positioning/cursor
  styles kept)
- Remove non-standard 'container' option from scrollIntoView (browsers
  ignore unknown options) which had orphaned a @ts-expect-error
- Object.fromEntries for Map -> Record conversion

Tooling:
- .gitignore: ignore .codegraph/ local tool data

Verified: tsc --noEmit, vite production build, python imports, and
full LSP scan (0 errors/warnings in both projects).
2026-09-08 23:57:30 +02:00

NVCurve Logo

NVCurve

Linux NVIDIA GPU V/F Curve Editor & OC Tool


NVCurve brings MSI Afterburner-style per-point voltage-frequency curve control to Linux via undocumented NvAPI functions. A React web UI for interactive editing and monitoring; a Python CLI for scripting and headless use.

Warning

Experimental software. Undocumented NvAPI functions may change between driver releases. Write operations alter GPU operational parameters. Always run nvcurve setup before applying changes.

Important

Blackwell GPU memory — This is a specialized fork with extended memory offset support (up to +3000 MHz) for Blackwell GPUs (RTX 50-series).
Fan Controls — There is an additional "Fans" tab to setup a customized fan curve.
Dashboard — The default tab is an Dashboard with additional information (PCIe link speed, VBIOS information, Max Core Clock, Throttle Reason and much much more.)
Installing the pre-built PyPI package will NOT include these features. You must build from source.

Dashboard Curve Editor
Performance Fans

Prerequisites

  • Linux with NVIDIA proprietary drivers
  • Python 3.12+
  • Node.js 18+ and npm (for building the React frontend)
  • uv — Python package manager
  • Root/sudo access (required for GPU hardware interactions)

Installation from Source

git clone <this-repo-url>.git
cd nvcurve

# Build the React frontend
cd frontend
npm install
npm run build
cd ..

# Install the Python package (includes bundled frontend)
uv tool install .

After installation, verify hardware compatibility:

nvcurve setup

Getting Started

nvcurve          # Launch web UI at http://localhost:8042
nvcurve read     # Quick curve read from CLI

Authentication (Multi-User)

The server runs open by default. On a shared machine (e.g. an AI server), add users to require a login — the web UI then shows a sign-in screen and every API/WebSocket call is protected. Passwords are stored as bcrypt hashes; sessions last 24 hours.

sudo nvcurve user add alice      # add a user (prompts for password)
nvcurve user list                # list users
sudo nvcurve user remove alice   # remove a user

Adding the first user enables authentication immediately; removing the last user disables it. See the Usage Guide for details.

Systemd Service

Install the daemon for automatic profile loading on boot and optional web server auto-start:

Install with web server auto-start

nvcurve service install --auto-serve --host 0.0.0.0 --port 8042

Install daemon only (start web server on demand)

nvcurve service install

Manage

nvcurve service start|stop|restart|status
nvcurve service uninstall

Reconfigure

nvcurve service configure --auto-serve      # Enable web server auto-start
nvcurve service configure --no-auto-serve   # Disable web server auto-start
nvcurve service configure --host 0.0.0.0 --port 8042

Manual systemd Unit

If you prefer managing the unit file directly, here is the template installed by nvcurve service install:

[Unit]
Description=NVCurve NVIDIA GPU V/F Curve Daemon
After=nvidia-persistenced.service
Wants=nvidia-persistenced.service

[Service]
Type=simple
ExecStart=/usr/bin/python3 -m nvcurve daemon
Restart=on-failure
RestartSec=5
Environment=PYTHONDONTWRITEBYTECODE=1

[Install]
WantedBy=multi-user.target

Place at /etc/systemd/system/nvcurve.service, then:

sudo systemctl daemon-reload
sudo systemctl enable --now nvcurve

Persistent Configuration

The daemon reads settings from /etc/nvcurve/config.json:

{
  "host": "127.0.0.1",
  "port": 8042,
  "auto_serve": false,
  "max_delta_khz": 3000000,
  "auto_snapshot": true,
  "max_snapshots": 20,
  "auto_load_profiles": {
    "idx:0": "my_profile"
  }
}
Setting Description
host Web server bind address (0.0.0.0 for network access)
port Web server port (default 8042)
auto_serve Auto-start web server on boot
max_delta_khz Safety cap for frequency offsets (default 3000 MHz)
auto_snapshot Save snapshot before every write
max_snapshots Max snapshots to keep (0 = unlimited)
auto_load_profiles Per-GPU profile to apply on boot ({gpu_key: profile_name})

The GPU key can be a UUID, pci:XXXX, or idx:N fallback. Find your GPU key with nvcurve gpus.

Documentation

Upgrading

cd nvcurve
git pull
cd frontend && npm run build && cd ..
uv tool install .

If running as a systemd service:

nvcurve service restart

Changelog

See CHANGELOG.md.

S
Description
Linux NVIDIA GPU V/F Curve Editor
Readme MIT
1.7 MiB
0 Stars 1 Watchers 0 Forks
Languages
Python 65.9%
TypeScript 33.2%
Shell 0.4%
CSS 0.2%
Makefile 0.1%
Other 0.1%