AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Ubuntu Lxd Gpu Server

skill-soulmachine-skills-ubuntu-lxd-gpu-server · by soulmachine

Install LXD on an Ubuntu server and pass all NVIDIA GPUs into LXD system containers via CDI — install snapd+LXD (snap), run `lxd init` with a ZFS or dir storage pool, set up a host CDI spec at /etc/cdi and wire the nvidia-container-toolkit auto-refresh units so it stays fresh across driver upgrades, and grant every GPU to every instance through the default profile, then verify nvidia-smi inside a…

No reviews yet
0 installs
27 views
0.0% view→install

Install

$ agentstack add skill-soulmachine-skills-ubuntu-lxd-gpu-server

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-soulmachine-skills-ubuntu-lxd-gpu-server)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
1mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Ubuntu Lxd Gpu Server? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Ubuntu LXD GPU Server

Install LXD on an Ubuntu host and expose all NVIDIA GPUs to LXD system containers via CDI, granted through the default profile so every instance inherits them. Assumes the host driver + nvidia-container-toolkit (nvidia-ctk) are already in place — if not, run the ubuntu-nvidia-gpu-enablement skill first.

⚠️ Use CDI, not nvidia.runtime=true. LXD's legacy libnvidia-container hook hangs at container start with nvidia-container-cli: initialization error: driver rpc error: timed out on recent kernels / Blackwell GPUs. CDI uses the host's nvidia-ctk and a static spec — no driver RPC, no timeout. (Why: [REFERENCE.md](REFERENCE.md) §4.)

Quick start

# 1. install LXD + wire all GPUs into the default profile. Storage: zfs:/lxd | dir | zfs-loop:50GiB
sudo LXD_STORAGE=zfs:rpool/lxd bash scripts/install-lxd.sh
# 2. verify a fresh container sees every GPU (launches a throwaway container, asserts the count, cleans up)
bash scripts/verify-gpu.sh

Pre-flight

  • Sudo user (SSH fine). nvidia-smi -L lists the GPUs on the host.
  • nvidia-ctk --version works (host CDI toolkit). Missing → ubuntu-nvidia-gpu-enablement Step 5.
  • Egress to snap + the image server (images.lxd.canonical.com).
  • Storage decision: a ZFS pool (redundant root mirror, or a data pool) is ideal; otherwise dir works anywhere.

Redundant pool → containers survive a disk loss; big stripe → more space. See REFERENCE §2.

Steps (what install-lxd.sh does)

  1. snapd + LXD. Minimal/debootstrap bases ship no snapd: apt-get install -y snapd && snap wait system seed.loaded,

then snap install lxd. ⚠️ sudo's secure_path lacks /snap/bin and the lxd group needs a re-login — so this session, call lxc/lxd by absolute path (sudo /snap/bin/lxc …).

  1. lxd init (preseed): one storage pool + lxdbr0 NAT bridge. ZFS source /lxd puts rootfs on your

chosen pool; dir is filesystem-agnostic. Full preseed + backends in REFERENCE §2.

  1. CDI spec at /etc/cdi/nvidia.yaml (declares each GPU + an all device). If the host toolkit ships

nvidia-cdi-refresh.{path,service} (≥1.17), the script pins them to /etc/cdi — they default to the tmpfs /var/run/cdi — so they auto-refresh the spec on every driver/toolkit upgrade and at boot; an older toolkit instead gets a one-off spec + a lxd-nvidia-cdi-refresh.service boot unit. Either way LXD reads one persistent spec and there's nothing to do on driver upgrades. (Why, and the don't-keep-two-copies gotcha: REFERENCE §5.)

  1. Grant all GPUs to all instances via the default profile:

``bash sudo /snap/bin/lxc profile device add default gpu0 gpu gputype=physical id=nvidia.com/gpu=all ` Per-instance instead: lxc config device add gpu0 gpu gputype=physical id=nvidia.com/gpu=all. A single GPU: id=nvidia.com/gpu=0 or id=nvidia.com/gpu=` (REFERENCE §3).

Verify

sudo /snap/bin/lxc launch ubuntu:24.04 g1
sudo /snap/bin/lxc exec g1 -- nvidia-smi -L      # must list every host GPU
sudo /snap/bin/lxc exec g1 -- nvidia-smi         # full table; libcuda is injected too (CUDA works)
sudo /snap/bin/lxc delete -f g1

scripts/verify-gpu.sh automates this and fails loudly if the container's GPU count ≠ the host's.

Maintenance

The CDI spec hardcodes the running driver's library paths, so it must be regenerated after every host driver upgrade or GPU containers break with a missing-library / NVML version-mismatch error. The install script makes this automatic: on a modern toolkit it pins the packaged nvidia-cdi-refresh.{path,service} to /etc/cdi (they fire on any driver/toolkit change and at boot); on an older toolkit it installs a lxd-nvidia-cdi-refresh.service boot unit. So normally there's no manual step on a driver upgrade. Force a refresh by hand with sudo systemctl start nvidia-cdi-refresh.service (or sudo nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml). ⚠️ Don't also leave a spec in /var/run/cdi — LXD scans both dirs, and two specs collide as duplicate devices (REFERENCE §5).

Deep dives — storage backends & preseed, GPU selection, CDI-vs-runtime diagnosis, moving the pool between ZFS pools, troubleshooting, uninstall — in [REFERENCE.md](REFERENCE.md).

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.