gpu-optimizer

gpu-optimizer is a skill for Claude Code from Mathews-Tom/armory. It costs 80 tokens per session (3,674 once invoked), scanned B, original, MIT.

A guide for improving machine-learning workloads on consumer NVIDIA graphics cards with 8–24 GB of video memory. It covers training speed, memory use, and GPU-based data tools.

In plain words
What is it for?
Use it to optimize PyTorch training, XGBoost, CuPy or cuDF migrations, mixed precision, gradient checkpointing, torch.compile, and GPU-memory management.
Why use it?
It helps address slow GPU training, CUDA speed issues, out-of-memory errors, and inefficient data processing.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the armory plugin — 96 skills shipped together

Good fit Use it to optimize PyTorch training, XGBoost, CuPy or cuDF migrations, mixed precision, gradient checkpointing, torch.compile, and GPU-memory management.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mathews-tom/armory/gpu-optimizer
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Mathews-Tom/armory --skill gpu-optimizer
Clone the repo
git clone --depth 1 https://github.com/Mathews-Tom/armory

Made for: Claude Code.

Or install armory, the plugin that ships this one along with the rest of its 96 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gpu-optimizer

README.md
[![agentmods](https://agentmods.dev/badge/skills/mathews-tom/armory/gpu-optimizer/github.svg)](https://agentmods.dev/skills/mathews-tom/armory/gpu-optimizer)
Your own site
<a href="https://agentmods.dev/skills/mathews-tom/armory/gpu-optimizer"><img src="https://agentmods.dev/badge/skills/mathews-tom/armory/gpu-optimizer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for gpu-optimizer

Your own site · 80×15
<a href="https://agentmods.dev/skills/mathews-tom/armory/gpu-optimizer"><img src="https://agentmods.dev/badge/skills/mathews-tom/armory/gpu-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 80 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,674 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Privilege Escalation · line 466
    Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
    Fix: Avoid sudo/root unless strictly required. Prefer least-privilege patterns. If elevation is needed, document the justification and scope.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00080 $0.03674
Opus 5.5 $0.00032 $0.01470
Sonnet 5.5 $0.00016 $0.00735
Haiku 4.5 $0.00008 $0.00367

Measured 1mo ago against content hash 8ddd111b6b0b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

gpu-optimizer scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

- CUDA not available at runtime: run `nvidia-smi` first to confirm the GPU is visible; if the command fails, verify driver installation with `sudo nvidia-smi` or reinstall drivers before proceeding.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

result = subprocess.run(["nvidia-smi"], capture_output=True, text=True)
skills/gpu-optimizer/SKILL.md · 486 lines

How it starts

The opening of the file, as written. The whole thing — 486 lines — stays where its author put it; the contents beside it link to each section on GitHub.

GPU Optimizer

Expert GPU optimization for consumer GPUs with 8–24GB VRAM. Evidence-based patterns only.

Hardware Profile

Fill in your hardware before applying optimizations:

Property Your Value
GPU model (e.g., RTX 4080 Mobile, RTX 3090, RTX 4090)
VRAM (e.g., 12GB, 16GB, 24GB)
CUDA version (nvidia-smi → top-right)
TDP / power limit (laptop vs desktop affects sustained throughput)
Driver version (nvidia-smi → top-left)

Key constraint: VRAM capacity determines which strategies apply. Patterns below are annotated with minimum VRAM requirements where relevant.

Optimization Categories

1. XGBoost GPU Acceleration

DMatrix vs QuantileDMatrix:

# GPU-optimized: QuantileDMatrix is 1.8x faster
dtrain = xgb.QuantileDMatrix(X_train.astype(np.float32))
dval = xgb.QuantileDMatrix(X_val.astype(np.float32))

# Standard: DMatrix (use for inference only)
dtest = xgb.DMatrix(X_test.astype(np.float32))

Critical Parameters:

params = {
    'tree_method': 'hist',        # GPU-accelerated histogram
    'device': 'cuda:0',           # Explicit GPU device
    'max_bin': 256,               # Higher bins = better splits (VRAM permitting)
    'grow_policy': 'depthwise',   # vs 'lossguide' for imbalanced data
    'predictor': 'gpu_predictor', # GPU inference
}

# Training with explicit device
model = xgb.train(params, dtrain, num_boost_round=100)

GPU Verification (fail-fast):

def verify_gpu():
    """Verify XGBoost GPU availability. Raises if unavailable."""
    import subprocess
    try:
        result = subprocess.run(["nvidia-smi"], capture_output=True, text=True)
        if result.returncode != 0:
            raise RuntimeError("nvidia-smi failed - no GPU available")
    except FileNotFoundError:
        raise RuntimeError("nvidia-smi not found - no GPU available")

    build_info = xgb.build_info()
    if not build_info.get("USE_CUDA"):
        raise RuntimeError("XGBoost not compiled with CUDA support")

Read the full file on GitHub · 486 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 486 lines · 80 tokens per session scan B 8ddd111b6b0b

Subscribe to this mod's changes

gpu-optimizer is a skill published in the GitHub repository Mathews-Tom/armory (337 stars, last pushed today), licensed MIT. It adds 80 tokens to every session and 3,674 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it B with 2 findings (asks for root, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

amc-run-video-calibration

Calibrates pre-recorded cam.mp4 datasets through the AutoMagicCalib REST API. Use for user-supplied local MP4s; route live RTSP streams to amc-run-rtsp-calibration.

NVIDIA/skills · 57 tokens

amc-run-rtsp-calibration

Calibrate a new dataset from live RTSP camera streams via the AutoMagicCalib REST API. Use when the user provides RTSP URLs or asks to calibrate live cameras; VIOS records clips, AMC ingests them, then runs calibration.

NVIDIA/skills · 59 tokens

deepstream-generate-pipeline

Build DeepStream GStreamer pipelines interactively. Use when the user asks about pipelines for video/image inference, detection, tracking, or streaming — including natural phrases like 'pipeline to infer on image', 'run inference on video', 'detect objects in stream', 'save inference output', 'deepstream pipeline'…

NVIDIA/skills · 108 tokens

deepstream-import-vision-model

Use this skill to bring a supported object-detection vision model from HuggingFace or NVIDIA NGC into an NVIDIA DeepStream pipeline with end-to-end automation: ONNX download, SafeTensors export, TRT engine build, custom nvinfer bbox parser, multi-stream benchmark, and PDF report. Object detection models only.

NVIDIA/skills · 72 tokens

cdf-defect-image-generation

Generate synthetic PCB inspection images on Kubernetes with the SMT Defect Image Generation (DIG) DAG in CDF Orchestration. The DAG renders components in simulation, turns the renders into realistic golden images (sim2real), and uses AnomalyGen to add texture defects such as solder bridges, excess solder or missing…

NVIDIA/skills · 143 tokens

jetson-inference-mem-tune

Pick the serving stack and per-runtime memory flags (vLLM, SGLang, llama.cpp, TensorRT Edge-LLM) for an LLM/VLM workload on any NVIDIA Jetson.

NVIDIA/skills · 50 tokens