Guide · Agent skill
How to use the CUDA inside a smolvm machine agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The gpu-cuda skill is a set of instructions and scripts that lets an AI agent run CUDA compute jobs inside a smolvm microVM using a real NVIDIA GPU on the host. Normally a program inside a virtual machine cannot use the host's NVIDIA card for computing. This guide explains what the skill does, how to install it, how to ask for it in plain language, and how to confirm that real GPU work happened.
Quick start
- 1Install the skill. Download the ZIP from this page and unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder, or upload it under Settings → Capabilities → Skills in the Claude apps.
- 2Confirm requirements. Make sure smolvm is installed, your user can access /dev/kvm, and the host has a working NVIDIA driver with a GPU.
- 3Run the preflight. Run scripts/preflight.sh, which is read-only, and confirm gpu_present=yes before going further.
- 4Run the probe. Run scripts/run-cuda-probe.sh, optionally with another glibc image, and wait for the probe to finish.
- 5Check the result. Confirm result=cuda_ok and that the round trip line reads True, not just a zero exit code.
- 6Clean up. Run scripts/cleanup.sh --purge and prune any persistent --cuda machine you kept by name.
What the gpu-cuda skill makes the agent do
The skill teaches the agent to start a smolvm machine with the --cuda option. That option forwards CUDA driver calls from the guest to the host's NVIDIA GPU over vsock. The guest gets no NVIDIA driver and no /dev/nvidia* device; a compatibility libcuda.so.1 is injected at /opt/smolvm-cuda inside the guest.
The skill also checks that real GPU work happened, instead of trusting a zero exit code. Because the API is remoted, a CUDA program can exit zero without ever touching the device. The skill includes a read-only preflight check, a probe script, and a cleanup routine for the large CUDA images and machines it creates.
Install the skill from the ZIP
Download the ZIP for this skill from this page and unzip it into one of two places. For a personal setup, use ~/.claude/skills/. For a single project, use the .claude/skills/ folder inside that project.
In the Claude apps you can instead upload the skill under Settings → Capabilities → Skills.
- Personal: unzip into ~/.claude/skills/
- Project: unzip into .claude/skills/ in your project folder
- Claude apps: Settings → Capabilities → Skills, then upload
Check your requirements before you start
The skill was verified on smolvm v1.14.6 and v1.22.2. For real GPU runs you need an NVIDIA GPU with a working host NVIDIA driver, read/write access to /dev/kvm for your user, and Bash and Python for the scripts. The probe uses the python:3.12-slim image or another glibc image, which must be pulled, so internet access is needed if it is not already cached.
The host needs the NVIDIA driver (libcuda.so.1 and a loaded kernel module). No CUDA toolkit, container toolkit, device plugin or root access is required for the Driver API path.
- smolvm installed
- NVIDIA GPU with a working host driver for real runs
- Read/write access to /dev/kvm
- Bash and Python available
- Internet access to pull images if not cached
Run the preflight check first
Ask the agent whether CUDA can run on this machine, or run the preflight yourself. It is read-only: it starts no VM and touches no NVIDIA state. It reports the GPU and driver version, whether your user can open /dev/kvm, and the host's own libcuda count.
If the preflight reports gpu_present=no, stop there. On a host with no NVIDIA GPU, the probe can start a VM, reach a CPU emulation device and pass, which looks like a yes but is not a GPU.
scripts/preflight.shRun the CUDA probe and read the result
The probe mounts the scripts folder into the guest, runs cuda-probe.py under --cuda, and checks two values. A real GPU run ends with device_named=ok, data_roundtrip=ok, device_kind=gpu and result=cuda_ok. The line that proves bytes reached the device is roundtrip first 16 bytes match: True.
If the device name is the smolvm CPU emulation device, the probe reports device_kind=cpu_emulation and result=cpu_emulation_not_gpu instead of passing.
- Default image: python:3.12-slim
- Other glibc images can be passed as an argument
scripts/run-cuda-probe.shClean up images and machines
CUDA images are large, so the skill ends with a cleanup step. cleanup.sh waits up to 20 seconds for ephemeral machines to retire. Any persistent --cuda machine you kept must be pruned by name. Probe runs are ephemeral and leave nothing to prune.
The --cuda option changes nothing on the host. The shim is injected inside the guest only, and cleanup deletes only names recorded under the smolskill- prefix.
scripts/cleanup.sh --purge
smolvm machine prune --name <NAME> --allWhat people use it for
- Running a CUDA compute job in an isolated smolvm VM on a Linux or Windows machine with an NVIDIA GPU
- Checking whether a given host can support CUDA inside smolvm before spending time on setup
- Debugging a --cuda guest where nvidia-smi is missing or a CUDA program passes without touching the device
Frequently asked questions
How do I install the gpu-cuda agent skill?
Download the ZIP from this page and unzip it into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder. In the Claude apps, you can upload it under Settings → Capabilities → Skills.
What do I need to use CUDA inside smolvm?
You need smolvm installed, an NVIDIA GPU with a working host driver, read/write access to /dev/kvm, and Bash and Python. The probe also needs the python:3.12-slim image or another glibc image, which requires internet access if not cached.
Is the gpu-cuda skill free?
The source lists its licence as Apache-2.0. This page does not state pricing, so check the repository for licence terms.
Why is nvidia-smi missing inside the guest?
The guest gets no NVIDIA driver and no /dev/nvidia* device because CUDA in smolvm is remoted over vsock. That is the documented design, so nvidia-smi is not a useful check inside a --cuda guest; use the driver API instead.
My CUDA program exits zero but does not seem to use the GPU. What now?
A zero exit code proves nothing with a remoted API. Check that the device name is a real GPU, not the smolvm CPU emulation device, and that the round trip line reads True. The probe reports result=cpu_emulation_not_gpu when it reaches the emulation device.
Does this work on a Mac or with Vulkan graphics?
No. Macs have no CUDA driver, so the skill only reports that CUDA is unavailable there. Vulkan graphics use the separate --gpu feature documented in docs/gpu.md, which this skill does not cover.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use this skill if you are a developer who needs CUDA compute in an isolated smolvm VM on a Linux or Windows host with an NVIDIA GPU, or if you need to check whether a host can support it. Pick something else if you need Vulkan graphics, are on a Mac, or do not have smolvm and an NVIDIA GPU set up, since the scripts assume both.
Download the skill