Skip to content
Back to skills

Gpu And Resource Operations

ASecurity

Detect and select local NVIDIA GPUs, report their resource status, and explain the explicitly opt-in GPU keep-alive without hiding hardware or CUDA limitations.

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 8, 2026
businesspythonexpress

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill gpu-and-resource-operations --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Gpu And Resource Operations?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Gpu And Resource Operations
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-gpu-and-resource-operations/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-gpu-and-resource-operations)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: gpu-and-resource-operations
description: "Detect and select local NVIDIA GPUs, report their resource status, and explain the explicitly opt-in GPU keep-alive without hiding hardware or CUDA limitations."
disable-model-invocation: true
metadata:
  disco-role: operating
license: Apache 2.0
---

# GPU and resource operations

Use this skill for **local, read-only GPU inspection and selection** before an
experiment. It covers NVIDIA visibility, memory-based availability, the
`reserve_last` policy, and the optional keep-alive's safety contract. It does
not launch training, reserve a device through a scheduler, or start a keeper
implicitly.

## Safety contract

- Begin with the bundled `scripts/gpu_status.py`; it only invokes
  `nvidia-smi` queries and never allocates CUDA memory.
- Treat an absent, timed-out, or failed `nvidia-smi` query as **no usable GPU**.
  Never infer free devices from configuration, PyTorch importability, or a
  missing status result.
- “Free” means reported `memory_used_mb < 1000` by default, not that a device is
  exclusively reserved. Confirm ownership before launching work.
- `reserve_last=true` is a selection policy for a keep-alive slot, not a lock.
  With one detected GPU it remains usable; with two or more, the highest listed
  index is excluded from experiment candidates.
- Do not run the keep-alive during inspection. It allocates a CUDA tensor and
  performs repeated operations, so it is an explicit side effect requiring
  user approval.

## Operating flow

1. Run `python scripts/gpu_status.py --help` if the interface is unfamiliar;
   help must not probe hardware.
2. Run `python scripts/gpu_status.py` (or add `--json` for machine-readable
   output). Record the status reason when no GPU is reported.
3. Select only from `usable_gpus` and then filter to `free_gpus`. Keep the
   reserved device out of training when the default policy excludes it.
4. If the user explicitly chooses a device, report its `gpu_id`, name, memory,
   utilization, and temperature before passing its ID to the experiment
   launcher. Local launchers express this as `CUDA_VISIBLE_DEVICES`.
5. Before CUDA work, verify both a working NVIDIA driver (`nvidia-smi`) and a
   PyTorch build for which `torch.cuda.is_available()` is true. A Python
   package alone is not proof of CUDA support.
6. For SSH/Slurm status, scheduler allocation, or transport details, route to
   `execution-and-monitoring`. For loop launch and experiment lifecycle, route
   to `autonomous-experiments`. For installing external skills, route to
   `skills-and-installation`.

## Bundled references

- [GPU status and selection](references/gpu-status.md) — exact detector
  signatures, output shapes, query fields, thresholds, and edge cases.
- [Keep-alive contract](references/keeper.md) — explicit side effects,
  PyTorch/CUDA prerequisites, interval, signals, cleanup, and invocation
  rules.
- [Troubleshooting](references/troubleshooting.md) — predictable driver,
  CUDA, parsing, selection, and keeper failures.

## Output contract

A normal report should include:

- `detected`: whether a complete local NVIDIA status was obtained;
- one row per GPU with ID, name, used/total memory in MB, utilization percent,
  and temperature in °C;
- `usable_gpus` after `reserve_last` policy;
- `free_gpus` after the strict 1000-MB default threshold (or the stated
  override);
- an explicit `reason` when detection/status is unavailable; and
- whether a last device was excluded, without claiming a reservation lock.

When `detected` is false, both usable and free lists must be empty. Do not
silently substitute Slurm queue occupancy or a remote host's status for local
NVIDIA measurements.

If a report is used to choose a launch mask, preserve the host GPU IDs and the
selection policy in the handoff. Re-run the read-only probe immediately before
a long launch because memory and utilization are live observations, not a
reservation. Never claim that a keeper is active unless its explicit process
and stop/cleanup outcome have been checked.

Files in this skill

  • SKILL.md4 KB
  • references/gpu-status.md4.1 KB
  • references/keeper.md3.8 KB
  • references/troubleshooting.md3.7 KB
  • scripts/gpu_status.py7.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…