Tao Setup Nvidia Gpu Host
NVIDIAOfficialCreated by NVIDIA Corporation
- Skill
- Workflow
- Cloud and DevOps
- Apache-2.0
- Medium risk
- Has scripts
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a robust mechanism to check, install, and verify the essential NVIDIA GPU software stack required for running TAO workflows on Docker or Kubernetes backends. It ensures that the host meets minimum version requirements for the NVIDIA driver, CUDA Toolkit, and NVIDIA Container Toolkit. The tool supports automated installation on major Linux distribution families (Debian, RHEL, and SUSE) and provides clear, actionable guidance for manual setup on unsupported distributions. It is designed to be used as a preflight check before executing GPU-intensive tasks.
What it does
- Probes the host for NVIDIA driver, CUDA, and Container Toolkit versions.
- Automates the installation of required GPU packages on Debian, RHEL, and SUSE-based systems.
- Configures the NVIDIA Docker runtime for seamless GPU container integration.
- Validates host readiness against TAO-wide or model-specific runtime requirements.
- Provides manual installation instructions for unsupported Linux distributions.
- Manages Docker engine installation and user group permissions for non-root access.
When to use it
- Before running TAO workflows on local Docker or Kubernetes backends.
- When troubleshooting GPU runtime issues in a TAO environment.
- To prepare a new GPU worker node for a Kubernetes cluster.
- To verify that a host meets the minimum version requirements for a specific model.
Advantages
- Ensures consistent GPU environments across different Linux distributions.
- Reduces manual configuration errors by automating repository and package setup.
- Provides a safe, read-only check mode to preview system status without modification.
- Supports model-specific runtime overrides for specialized requirements.
- Offers clear, actionable feedback for manual intervention when automation is not possible.
Usage examples
- “Check if my local Docker host is ready for TAO.”
- The agent runs the script in --check-only mode, reporting the status of the NVIDIA driver, CUDA, and Container Toolkit, and confirms if the environment meets TAO minimums.
- “Set up my Ubuntu host for TAO GPU training.”
- The agent executes the installation workflow, adding necessary NVIDIA repositories, installing required packages, and configuring the Docker runtime after user approval.
- “Verify my Kubernetes GPU worker node for TAO.”
- The agent checks the worker node's GPU runtime and reports whether it is correctly configured to support TAO workloads.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/nvidia/tao-setup-nvidia-gpu-host/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip tao-setup-nvidia-gpu-host.zip -d .agents/skills
Documentation by NVIDIA Corporation
NVIDIA GPU Host Setup
Standalone install? If this session was not initialized by the TAO skill bank plugin, run the
tao-setupskill first (host preflight, credentials, cross-skill discovery).
Use this setup skill before TAO workflows run on the docker, local-docker,
or kubernetes backend. The TAO-wide default minimums are:
NVIDIA driver
>=580(open kernel module preferred)CUDA Toolkit
>=13.0NVIDIA Container Toolkit
>=1.19.0Docker engine — only installed for
docker/local-dockerbackends and only when Docker is missing. The package picked depends on the distro family (docker.ioon Debian-family by default,moby-engine/docker-cefromdownload.docker.comon RHEL-family,dockeron SUSE-family). Pass--skip-docker-installto opt out.
The check is safe and read-only by default — it works on any Linux
distribution because it only probes nvidia-smi, the CUDA toolkit path,
the installed container-toolkit package version (via dpkg/rpm/the
nvidia-ctk binary version), and the Docker daemon's NVIDIA runtime.
Installation must be explicitly authorized by the user and rerun with
--install. The install path is automated for these distro families:
| Family | Tested distros | Manager | Notes |
|---|---|---|---|
| debian | Ubuntu 22.04 / 24.04, Debian 12 (and derivatives Pop!_OS, Mint, Zorin, Raspbian, KDE Neon, etc. via UBUNTU_CODENAME / VERSION_CODENAME) | apt-get | Adds NVIDIA cuda-keyring + Container Toolkit .list. Docker via docker.io (override $DOCKER_PACKAGE_DEBIAN). |
| rhel | Fedora 39+, RHEL / Rocky / AlmaLinux 9 and 10 | dnf (or yum) | Adds NVIDIA cuda-<distro>.repo + Container Toolkit .repo. Docker via Fedora moby-engine when available, otherwise docker-ce from download.docker.com. |
| suse | openSUSE Leap 15, SLES 15 | zypper | Adds the same NVIDIA .repo files. Docker via the distribution docker package. |
| other (Arch, Alpine, Gentoo, NixOS, FreeBSD, …) | n/a | n/a | --install exits with a clear error listing the version targets and the NVIDIA install-guide URLs. Install manually, then rerun --check-only. |
Quick Start
From the skill bank root:
# Check the local Docker backend host.
bash skills/platform/tao-setup-nvidia-gpu-host/scripts/setup-nvidia-gpu-host.sh --backend docker --check-only
# Install or repair after user approval.
bash skills/platform/tao-setup-nvidia-gpu-host/scripts/setup-nvidia-gpu-host.sh --backend docker --install
# Check a Kubernetes GPU worker host.
bash skills/platform/tao-setup-nvidia-gpu-host/scripts/setup-nvidia-gpu-host.sh --backend kubernetes --check-only⚠️ Note — running non-interactively (agent/skill runs): a skill run has no terminal, so the installer's
Continue? [y/N]prompt cannot be answered. After running--check-onlyto preview and getting the user's approval, append the assume-yes flag (--yes) to the--installcommand so it proceeds without a prompt — this auto-confirms installation of system packages (NVIDIA driver, CUDA Toolkit, NVIDIA Container Toolkit, and Docker for Docker backends) and modifies the host, so only do this on a host you control. A person running--installdirectly at a terminal gets the prompt instead.
Workflow Contract
Docker and Kubernetes workflows must run the check before submitting GPU work:
SB="${TAO_SKILL_BANK_PATH:-${TAO_SKILL_BANK_ROOT:-$PWD}}"
SETUP_SCRIPT="${SB}/skills/platform/tao-setup-nvidia-gpu-host/scripts/setup-nvidia-gpu-host.sh"
bash "$SETUP_SCRIPT" --backend docker --check-only || {
echo "MISSING: TAO GPU host runtime is not ready."
echo "After user approval, run (append --yes for non-interactive agent runs):"
echo " bash \"$SETUP_SCRIPT\" --backend docker --install"
exit 1
}Never install silently. If the check fails, explain what is missing, ask the user to authorize the fix, then run the install command and rerun the check.
Model Runtime Override Contract
Platform defaults apply when a model has no override. A model that needs a
different validated host stack declares it in
references/skill_info.yaml:
runtime_requirements:
gpu_host:
min_driver_version: '<version>'
min_cuda_version: '<version>'
min_container_toolkit_version: '<version>'Read those values before the final platform preflight and pass them to the
matching --min-*-version flags. Model minimums take precedence for that
workflow only; do not rewrite the platform defaults or requirements for other
models. Version checks use numeric lower bounds, so later compatible releases
pass. Always retain the selected-image GPU smoke test because a version bound
cannot prove support for a particular GPU architecture.
What The Installer Does
The installer dispatches on the detected distribution family. On every
supported family it adds NVIDIA's CUDA and Container Toolkit repositories
(if missing), installs packages that satisfy the active minimums, optionally
installs Docker, wires the NVIDIA Docker runtime, and adds the invoking user to
the docker group.
Common steps (all families):
Adds NVIDIA's CUDA repository if missing (apt
cuda-keyringdeb,cuda-<distro>.repofor dnf/zypper).Adds NVIDIA's Container Toolkit repository if missing (
.listfor apt,.repofor dnf/zypper).Installs the matching kernel header / devel package for the running kernel.
Installs the current open-driver and Container Toolkit packages from the configured repositories plus the CUDA Toolkit package selected by
--min-cuda-version, then verifies all three against the active minimums.For Docker backends and when Docker is missing, installs Docker (override / opt-out flags below), enables/starts the daemon, then runs
nvidia-ctk runtime configure --runtime=dockerand restarts Docker whensystemctlis available.Adds the invoking user (
$SUDO_USERif available, else$USER) to thedockergroup so subsequent shells can rundockerwithoutsudo— opt out with--skip-docker-group. The new group membership does not take effect in the current shell: log out and back in, or runnewgrp dockerin each new shell.Attempts
modprobe nvidiaso verification can pass before reboot.
Family-specific package selections:
| Step | debian-family | rhel-family | suse-family |
|---|---|---|---|
| Kernel headers | linux-headers-$(uname -r) | kernel-devel-$(uname -r), kernel-headers-$(uname -r) | kernel-default-devel |
| Driver | current nvidia-open (override: $NVIDIA_DRIVER_PACKAGE_DEBIAN) | current nvidia-driver-cuda, kmod-nvidia-open-dkms (override: $NVIDIA_DRIVER_PACKAGE_RHEL, $NVIDIA_DRIVER_KMOD_RHEL) | current nvidia-open-driver-G06-signed-kmp-default (override: $NVIDIA_DRIVER_PACKAGE_SUSE) |
| CUDA toolkit | package derived from the active minimum, such as cuda-toolkit-13-0 | same | same |
| Container Toolkit | current nvidia-container-toolkit + base/tools/libs, then minimum-version validation | same | same |
| Docker | docker.io (override: $DOCKER_PACKAGE_DEBIAN) | moby-engine+moby-cli on Fedora when available, else docker-ce docker-ce-cli containerd.io from download.docker.com | docker |
Verification
After installation, verify:
nvidia-smi
nvcc --version
docker info --format '{{json .Runtimes}}' | grep nvidia
sudo docker run --rm --runtime=nvidia --gpus all "$TAO_IMAGE" nvidia-smi -LThe detected driver, CUDA Toolkit, and Container Toolkit versions must meet the active TAO-wide or model-specific minimums. Then run the selected image's GPU smoke test; version comparison alone is not sufficient compatibility proof.
For a Cosmos backend, extend that smoke with the backend contract's Python and
entrypoint checks. Cosmos Framework must execute
/workspace/.venv/bin/python as a non-root UID, import
cosmos_framework.callbacks.tao_status, find native torchrun, and verify the
A100 PatchEmbed compatibility marker when the host reports compute capability
8.0. Cosmos-RL must resolve its requested action executable, import
system PyAV for video workflows, resolve the restricted FFmpeg h264_cuvid
decoder, load libnvcuvid.so.1, verify the backward-safe linear Qwen3-VL
PatchEmbed marker, and verify its checkpoint loader accepts the prepared
qwen3_vl directory. A container that only passes nvidia-smi is not ready
for Cosmos training.
Kubernetes Notes
For self-managed Kubernetes clusters, run the host installer on every GPU worker node or bake the same package set into the node image before installing the NVIDIA GPU Operator or device plugin.
The workflow check also warns if kubectl is available but the cluster reports
no nvidia.com/gpu allocatable capacity. In that case, install/configure the
NVIDIA GPU Operator after the worker host runtime is ready:
helm repo add nvidia https://helm.ngc.nvidia.com/nvidia
helm repo update
helm install --wait gpu-operator -n gpu-operator --create-namespace nvidia/gpu-operatorManaged Kubernetes providers may own driver installation through node images or GPU Operator policy. Do not overwrite a provider-managed GPU node without user approval and a rollback plan.
Failure Modes
Unsupported distribution family: --install automates debian-, rhel-,
and suse-family hosts. On Arch, Alpine, Gentoo, NixOS, FreeBSD, or anything
without /etc/os-release (e.g. macOS), the script exits with a clear error
that lists the four version targets and the upstream NVIDIA install-guide
URLs:
https://docs.nvidia.com/cuda/cuda-installation-guide-linux/https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.htmlhttps://docs.docker.com/engine/install/
Install those four pieces using your distribution's package manager and
rerun the script with --check-only to verify. The check is universally
portable — it only queries the binaries / package databases — so once the
runtime is in place the workflow contract is satisfied regardless of the
underlying distro.
Unsupported Ubuntu/Debian derivative: When ID is e.g. pop, mint,
zorin, raspbian, or another debian-family derivative, the script maps
the host onto the upstream Ubuntu/Debian CUDA repo via UBUNTU_CODENAME /
VERSION_CODENAME (focal/jammy/noble → Ubuntu 20.04/22.04/24.04;
bullseye/bookworm/trixie → Debian 11/12/12). If the host's codename
doesn't match a known upstream release, --install exits with the same
manual-install guidance described above.
Docker not installed: --check-only reports MISSING: Docker is not installed and prints the exact rerun command appropriate to the detected
distro family. The default --install path installs Docker (docker.io /
moby-engine / docker-ce / docker depending on family), enables/starts
the daemon, configures the NVIDIA runtime, and adds the invoking user to
the docker group. If you prefer to manage Docker yourself, install it
before rerunning the script or pass --skip-docker-install.
Docker installed but docker run still needs sudo: The script adds the
invoking user to the docker group, but Linux only refreshes group
membership on a new login session. Log out and back in, or run
newgrp docker in each new shell, until the new membership is active.
Docker runtime still missing: Restart Docker, then rerun
nvidia-ctk runtime configure --runtime=docker.
Detected version is below the active minimum: Rerun the same command with
--install after approval, preserving any model-specific --min-*-version
flags. Package-name environment overrides select distribution-specific driver
packages but do not weaken the minimum-version checks.
Driver installed but nvidia-smi fails: Load the module with
sudo modprobe nvidia or reboot. Secure Boot may require MOK enrollment on
systems where it is enabled.
Kubernetes still has no GPU capacity: Confirm the driver works on each GPU
node with nvidia-smi, then check the GPU Operator/device plugin pods and node
labels.
Files
- ATTRIBUTION.mdAdded by AutoGineer945 B
- BENCHMARK.md6.9 KiB
- LICENSELicence file added by AutoGineer11.2 KiB
- SKILL.md13.2 KiB
- config/skillspector-baseline.yaml1.5 KiB
- evals/evals.json804 B
- references/skill_info.yaml2.6 KiB
- scripts/setup-nvidia-gpu-host.shScript27.4 KiB
- skill-card.md4.3 KiB
- skill.oms.sig5.2 KiB
scripts/setup-nvidia-gpu-host.sh
#!/usr/bin/env bash
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
set -euo pipefail
MIN_DRIVER_VERSION="${TAO_MIN_DRIVER_VERSION:-580}"
MIN_CUDA_VERSION="${TAO_MIN_CUDA_VERSION:-13.0}"
MIN_CONTAINER_TOOLKIT_VERSION="${TAO_MIN_CONTAINER_TOOLKIT_VERSION:-1.19.0}"
DOCKER_PACKAGE_DEBIAN="${DOCKER_PACKAGE_DEBIAN:-${DOCKER_PACKAGE:-docker.io}}"
BACKEND="docker"
INSTALL=0
YES=0
CONFIGURE_DOCKER=1
INSTALL_DOCKER=1
ADD_USER_TO_DOCKER_GROUP=1
PKG_FAMILY="" # debian | rhel | suse | arch | unknown
PKG_MANAGER="" # apt-get | dnf | yum | zypper | pacman
DISTRO_ID="" # ubuntu | debian | fedora | rhel | rocky | almalinux | opensuse-leap | sles | arch | ...
DISTRO_VERSION_ID="" # e.g. "22.04", "9", "41"
DISTRO_PRETTY=""
CUDA_REPO_DISTRO="" # e.g. ubuntu2204, debian12, rhel9, fedora41, sles15
CUDA_REPO_ARCH="" # x86_64 | sbsa
usage() {
cat <<'USAGE'
Usage: setup-nvidia-gpu-host.sh [--backend docker|kubernetes] [--check-only|--install] [--yes]
[--min-driver-version VERSION]
[--min-cuda-version VERSION]
[--min-container-toolkit-version VERSION]
[--skip-docker-install] [--skip-docker-config] [--skip-docker-group]
Checks and (with --install) installs the TAO GPU host runtime:
- NVIDIA driver >= 580 (open kernel module preferred)
- CUDA Toolkit >= 13.0
- NVIDIA Container Toolkit >= 1.19.0
- Docker engine (installed on demand for the docker / local-docker backend)
Those are the TAO-wide defaults. A selected model skill may override any
minimum with the three --min-*-version flags. Newer compatible versions pass;
the flags are minimum bounds, not exact release pins.
By default this script only checks. The --check-only path runs on any Linux
distribution because it only queries `nvidia-smi`, the CUDA toolkit path, the
installed container-toolkit package version, and (for Docker backends) the
Docker daemon's NVIDIA runtime.
The --install path automates installation for the following families:
- debian-family (Ubuntu 22.04/24.04, Debian 12) — apt + docker.io
- rhel-family (Fedora, RHEL/Rocky/AlmaLinux 9 / 10) — dnf + docker-ce
(falls back to
moby-engine on
Fedora)
- suse-family (openSUSE Leap, SLES 15) — zypper + docker
Other distributions (Arch, Alpine, Gentoo, …) fall through to a clear error
that lists the version targets and the NVIDIA documentation URL — install
manually, then rerun with --check-only.
Override the driver package family choices with the env vars
$NVIDIA_DRIVER_PACKAGE_DEBIAN, $NVIDIA_DRIVER_PACKAGE_RHEL,
$NVIDIA_DRIVER_KMOD_RHEL, $NVIDIA_DRIVER_PACKAGE_SUSE if your distro uses
different names. Override the Docker package with $DOCKER_PACKAGE_DEBIAN
(legacy: $DOCKER_PACKAGE) on debian-family hosts.
USAGE
}
while [[ $# -gt 0 ]]; do
case "$1" in
--backend)
BACKEND="${2:-}"
shift 2
;;
--check-only)
INSTALL=0
shift
;;
--install)
INSTALL=1
shift
;;
-y|--yes)
YES=1
shift
;;
--min-driver-version)
MIN_DRIVER_VERSION="${2:-}"
shift 2
;;
--min-cuda-version)
MIN_CUDA_VERSION="${2:-}"
shift 2
;;
--min-container-toolkit-version)
MIN_CONTAINER_TOOLKIT_VERSION="${2:-}"
shift 2
;;
--skip-docker-config)
CONFIGURE_DOCKER=0
shift
;;
--skip-docker-install)
INSTALL_DOCKER=0
shift
;;
--skip-docker-group)
ADD_USER_TO_DOCKER_GROUP=0
shift
;;
-h|--help)
usage
exit 0
;;
*)
echo "Unknown argument: $1" >&2
usage >&2
exit 2
;;
esac
done
for requirement in \
"$MIN_DRIVER_VERSION" \
"$MIN_CUDA_VERSION" \
"$MIN_CONTAINER_TOOLKIT_VERSION"; do
if [[ ! "$requirement" =~ ^[0-9]+([.][0-9]+)*$ ]]; then
echo "Version requirements must contain only numeric dot-separated components: '$requirement'" >&2
exit 2
fi
done
DRIVER_PACKAGE_DEBIAN="${NVIDIA_DRIVER_PACKAGE_DEBIAN:-nvidia-open}"
DRIVER_PACKAGE_RHEL="${NVIDIA_DRIVER_PACKAGE_RHEL:-nvidia-driver-cuda}"
DRIVER_KMOD_RHEL="${NVIDIA_DRIVER_KMOD_RHEL:-kmod-nvidia-open-dkms}"
DRIVER_PACKAGE_SUSE="${NVIDIA_DRIVER_PACKAGE_SUSE:-nvidia-open-driver-G06-signed-kmp-default}"
CUDA_PACKAGE="${NVIDIA_CUDA_PACKAGE:-cuda-toolkit-${MIN_CUDA_VERSION//./-}}"
CUDA_PATH="${NVIDIA_CUDA_PATH:-/usr/local/cuda-${MIN_CUDA_VERSION}}"
case "$BACKEND" in
docker|local-docker|kubernetes|k8s) ;;
*)
echo "Unsupported backend: $BACKEND" >&2
exit 2
;;
esac
SUDO=()
if [[ "${EUID}" -ne 0 ]]; then
SUDO=(sudo)
fi
have() {
command -v "$1" >/dev/null 2>&1
}
sudo_available() {
[[ "${EUID}" -eq 0 ]] || sudo -n true >/dev/null 2>&1
}
detect_distro() {
if [[ ! -r /etc/os-release ]]; then
PKG_FAMILY="unknown"
return 0
fi
# shellcheck disable=SC1091
. /etc/os-release
DISTRO_ID="${ID:-unknown}"
DISTRO_VERSION_ID="${VERSION_ID:-}"
DISTRO_PRETTY="${PRETTY_NAME:-${DISTRO_ID} ${DISTRO_VERSION_ID}}"
local id_like="${ID_LIKE:-}"
case "$DISTRO_ID" in
ubuntu|debian|linuxmint|pop|raspbian)
PKG_FAMILY=debian
PKG_MANAGER=apt-get
;;
fedora)
PKG_FAMILY=rhel
PKG_MANAGER=dnf
;;
rhel|rocky|almalinux|centos|ol|amzn)
PKG_FAMILY=rhel
if have dnf; then PKG_MANAGER=dnf; else PKG_MANAGER=yum; fi
;;
opensuse-leap|opensuse-tumbleweed|sles|sled)
PKG_FAMILY=suse
PKG_MANAGER=zypper
;;
arch|manjaro|endeavouros|cachyos|garuda)
PKG_FAMILY=arch
PKG_MANAGER=pacman
;;
*)
case " $id_like " in
*" debian "*|*" ubuntu "*)
PKG_FAMILY=debian; PKG_MANAGER=apt-get ;;
*" rhel "*|*" fedora "*|*" centos "*)
PKG_FAMILY=rhel
if have dnf; then PKG_MANAGER=dnf; else PKG_MANAGER=yum; fi
;;
*" suse "*|*" opensuse "*)
PKG_FAMILY=suse; PKG_MANAGER=zypper ;;
*" arch "*)
PKG_FAMILY=arch; PKG_MANAGER=pacman ;;
*)
PKG_FAMILY=unknown; PKG_MANAGER="" ;;
esac
;;
esac
case "$DISTRO_ID" in
ubuntu)
# 22.04 -> ubuntu2204, 24.04 -> ubuntu2404
CUDA_REPO_DISTRO="ubuntu${DISTRO_VERSION_ID//./}"
;;
debian)
CUDA_REPO_DISTRO="debian${DISTRO_VERSION_ID%%.*}"
;;
fedora)
CUDA_REPO_DISTRO="fedora${DISTRO_VERSION_ID%%.*}"
;;
rhel|rocky|almalinux|centos|ol)
CUDA_REPO_DISTRO="rhel${DISTRO_VERSION_ID%%.*}"
;;
opensuse-leap)
CUDA_REPO_DISTRO="opensuse${DISTRO_VERSION_ID%%.*}"
;;
sles|sled)
CUDA_REPO_DISTRO="sles${DISTRO_VERSION_ID%%.*}"
;;
*)
CUDA_REPO_DISTRO=""
;;
esac
# Debian-family derivatives (Pop!_OS, Mint, elementary, KDE Neon, Zorin,
# Raspbian, …) do not have their own NVIDIA CUDA repo. Map them onto the
# closest upstream Ubuntu/Debian repo via UBUNTU_CODENAME / VERSION_CODENAME.
if [[ -z "$CUDA_REPO_DISTRO" && "$PKG_FAMILY" == "debian" ]]; then
local codename="${UBUNTU_CODENAME:-${VERSION_CODENAME:-}}"
case "$codename" in
focal) CUDA_REPO_DISTRO="ubuntu2004" ;;
jammy) CUDA_REPO_DISTRO="ubuntu2204" ;;
noble) CUDA_REPO_DISTRO="ubuntu2404" ;;
bullseye) CUDA_REPO_DISTRO="debian11" ;;
bookworm) CUDA_REPO_DISTRO="debian12" ;;
trixie) CUDA_REPO_DISTRO="debian12" ;; # newest Debian, closest upstream repo
esac
fi
case "$(uname -m)" in
x86_64|amd64) CUDA_REPO_ARCH=x86_64 ;;
aarch64|arm64) CUDA_REPO_ARCH=sbsa ;;
*) CUDA_REPO_ARCH="" ;;
esac
}
version_ge() {
local actual="$1" required="$2" index actual_part required_part
local -a actual_parts required_parts
IFS=. read -r -a actual_parts <<< "$actual"
IFS=. read -r -a required_parts <<< "$required"
for ((index = 0; index < ${#actual_parts[@]} || index < ${#required_parts[@]}; index++)); do
actual_part="${actual_parts[index]:-0}"
required_part="${required_parts[index]:-0}"
((10#$actual_part > 10#$required_part)) && return 0
((10#$actual_part < 10#$required_part)) && return 1
done
return 0
}
extract_numeric_version() {
grep -Eo '[0-9]+([.][0-9]+)+' | head -n 1
}
driver_version() {
have nvidia-smi || return 1
nvidia-smi --query-gpu=driver_version --format=csv,noheader 2>/dev/null \
| head -n 1 | tr -d '[:space:]'
}
driver_ok() {
local version
have nvidia-smi || return 1
nvidia-smi -L >/dev/null 2>&1 || return 1
version="$(driver_version)"
[[ -n "$version" ]] && version_ge "$version" "$MIN_DRIVER_VERSION"
}
cuda_version() {
local nvcc=""
if [[ -x "${CUDA_PATH}/bin/nvcc" ]]; then
nvcc="${CUDA_PATH}/bin/nvcc"
elif [[ -x /usr/local/cuda/bin/nvcc ]]; then
nvcc=/usr/local/cuda/bin/nvcc
elif have nvcc; then
nvcc="$(command -v nvcc)"
else
return 1
fi
"$nvcc" --version 2>/dev/null \
| sed -n 's/.*release \([0-9][0-9.]*\).*/\1/p' | head -n 1
}
cuda_ok() {
local version
version="$(cuda_version)"
[[ -n "$version" ]] && version_ge "$version" "$MIN_CUDA_VERSION"
}
container_toolkit_version() {
local installed=""
if have dpkg-query; then
installed="$(dpkg-query -W -f='${Version}' nvidia-container-toolkit 2>/dev/null || true)"
fi
if [[ -z "$installed" ]] && have rpm; then
installed="$(rpm -q --queryformat '%{VERSION}' nvidia-container-toolkit 2>/dev/null \
| grep -v '^package ' || true)"
fi
if [[ -z "$installed" ]] && have nvidia-ctk; then
installed="$(nvidia-ctk --version 2>/dev/null | head -n 1)"
fi
[[ -n "$installed" ]] || return 1
printf '%s\n' "$installed" | extract_numeric_version
}
container_toolkit_ok() {
local version
version="$(container_toolkit_version)"
[[ -n "$version" ]] \
&& version_ge "$version" "$MIN_CONTAINER_TOOLKIT_VERSION"
}
docker_installed_ok() {
have docker
}
docker_runtime_ok() {
docker_installed_ok || return 1
if docker info >/dev/null 2>&1; then
docker info --format '{{json .Runtimes}}' 2>/dev/null | grep -q '"nvidia"'
return $?
fi
if sudo_available; then
sudo docker info >/dev/null 2>&1 || return 1
sudo docker info --format '{{json .Runtimes}}' 2>/dev/null | grep -q '"nvidia"'
return $?
fi
return 1
}
kubernetes_gpu_ok() {
have kubectl || return 2
local gpu
gpu="$(kubectl get nodes -o jsonpath='{range .items[*]}{.status.allocatable.nvidia\.com/gpu}{"\n"}{end}' 2>/dev/null | grep -v '^$' | head -n 1 || true)"
[[ -n "$gpu" && "$gpu" != "0" ]]
}
print_status() {
local detected_driver detected_cuda detected_toolkit
detected_driver="$(driver_version || true)"
detected_cuda="$(cuda_version || true)"
detected_toolkit="$(container_toolkit_version || true)"
if driver_ok; then
echo "OK: NVIDIA driver ${detected_driver} >= ${MIN_DRIVER_VERSION}"
else
echo "MISSING: visible GPU with NVIDIA driver >= ${MIN_DRIVER_VERSION} (detected: ${detected_driver:-none})"
fi
if cuda_ok; then
echo "OK: CUDA Toolkit ${detected_cuda} >= ${MIN_CUDA_VERSION}"
else
echo "MISSING: CUDA Toolkit >= ${MIN_CUDA_VERSION} (detected: ${detected_cuda:-none})"
fi
if container_toolkit_ok; then
echo "OK: NVIDIA Container Toolkit ${detected_toolkit} >= ${MIN_CONTAINER_TOOLKIT_VERSION}"
else
echo "MISSING: NVIDIA Container Toolkit >= ${MIN_CONTAINER_TOOLKIT_VERSION} (detected: ${detected_toolkit:-none})"
fi
if [[ "$BACKEND" == "docker" || "$BACKEND" == "local-docker" ]]; then
if ! docker_installed_ok; then
echo "MISSING: Docker is not installed."
case "$PKG_FAMILY" in
debian)
echo " Rerun with --install (not --skip-docker-install) to install"
echo " '${DOCKER_PACKAGE_DEBIAN}' via apt and finish the NVIDIA runtime wiring."
;;
rhel)
echo " Rerun with --install (not --skip-docker-install) to install"
echo " docker-ce / moby-engine via ${PKG_MANAGER} and finish the NVIDIA runtime wiring."
;;
suse)
echo " Rerun with --install (not --skip-docker-install) to install"
echo " 'docker' via zypper and finish the NVIDIA runtime wiring."
;;
arch)
echo " Install Docker manually for Arch-family hosts:"
echo " sudo pacman -S docker && sudo systemctl enable --now docker"
echo " Then rerun this script to wire the NVIDIA Container Toolkit runtime."
;;
*)
echo " Install Docker for your distribution (see"
echo " https://docs.docker.com/engine/install/), then rerun this script."
;;
esac
elif docker_runtime_ok; then
echo "OK: Docker NVIDIA runtime configured"
else
echo "MISSING: Docker NVIDIA runtime not configured or Docker unreachable"
fi
fi
if [[ "$BACKEND" == "kubernetes" || "$BACKEND" == "k8s" ]]; then
if kubernetes_gpu_ok; then
echo "OK: Kubernetes reports nvidia.com/gpu allocatable"
else
local rc=$?
if [[ "$rc" -eq 2 ]]; then
echo "WARN: kubectl not found; cannot check cluster GPU capacity"
else
echo "WARN: Kubernetes does not report nvidia.com/gpu allocatable"
fi
fi
fi
if [[ -n "$PKG_FAMILY" && "$PKG_FAMILY" != "unknown" ]]; then
echo "INFO: detected ${DISTRO_PRETTY} (family=${PKG_FAMILY}, manager=${PKG_MANAGER:-n/a})"
elif [[ -n "$DISTRO_PRETTY" ]]; then
echo "INFO: detected ${DISTRO_PRETTY} (family=unknown — --install will print manual steps)"
fi
}
runtime_ok() {
driver_ok && cuda_ok && container_toolkit_ok || return 1
if [[ "$BACKEND" == "docker" || "$BACKEND" == "local-docker" ]]; then
docker_runtime_ok
return $?
fi
return 0
}
unsupported_install_family() {
cat >&2 <<EOF
ERROR: --install does not yet automate this distribution.
Detected: ${DISTRO_PRETTY:-unknown} (family=${PKG_FAMILY:-unknown})
Install these manually using your distribution's package manager, then rerun
this script with --check-only to verify:
- NVIDIA driver >= ${MIN_DRIVER_VERSION} (open kernel module preferred)
- CUDA Toolkit >= ${MIN_CUDA_VERSION} (NVIDIA package: ${CUDA_PACKAGE})
- NVIDIA Container Toolkit >= ${MIN_CONTAINER_TOOLKIT_VERSION}
- Docker engine (any flavor)
NVIDIA documentation:
- CUDA install guide (all distros):
https://docs.nvidia.com/cuda/cuda-installation-guide-linux/
- NVIDIA Container Toolkit install guide:
https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html
- Docker engine install guide (per distro):
https://docs.docker.com/engine/install/
The selected model's runtime requirements take precedence over the TAO-wide
defaults. Rerun with the same --min-*-version flags after manual installation.
EOF
exit 1
}
confirm_install() {
if [[ "$YES" -eq 1 ]]; then
return 0
fi
local driver_line cuda_line nct_line docker_line=""
case "$PKG_FAMILY" in
debian)
driver_line="${DRIVER_PACKAGE_DEBIAN} (must provide driver >= ${MIN_DRIVER_VERSION})"
cuda_line="${CUDA_PACKAGE}"
nct_line="current nvidia-container-toolkit packages (must be >= ${MIN_CONTAINER_TOOLKIT_VERSION})"
if [[ ( "$BACKEND" == "docker" || "$BACKEND" == "local-docker" ) \
&& "$INSTALL_DOCKER" -eq 1 ]] && ! have docker; then
docker_line="
- ${DOCKER_PACKAGE_DEBIAN} (Docker engine, distribution apt repo)"
fi
;;
rhel)
driver_line="${DRIVER_PACKAGE_RHEL} + ${DRIVER_KMOD_RHEL} (must provide driver >= ${MIN_DRIVER_VERSION})"
cuda_line="${CUDA_PACKAGE}"
nct_line="current nvidia-container-toolkit packages (must be >= ${MIN_CONTAINER_TOOLKIT_VERSION})"
if [[ ( "$BACKEND" == "docker" || "$BACKEND" == "local-docker" ) \
&& "$INSTALL_DOCKER" -eq 1 ]] && ! have docker; then
case "$DISTRO_ID" in
fedora) docker_line="
- moby-engine + moby-cli (Fedora) — falls back to docker-ce from download.docker.com" ;;
*) docker_line="
- docker-ce docker-ce-cli containerd.io (from download.docker.com)" ;;
esac
fi
;;
suse)
driver_line="${DRIVER_PACKAGE_SUSE} (must provide driver >= ${MIN_DRIVER_VERSION})"
cuda_line="${CUDA_PACKAGE}"
nct_line="current nvidia-container-toolkit packages (must be >= ${MIN_CONTAINER_TOOLKIT_VERSION})"
if [[ ( "$BACKEND" == "docker" || "$BACKEND" == "local-docker" ) \
&& "$INSTALL_DOCKER" -eq 1 ]] && ! have docker; then
docker_line="
- docker (zypper)"
fi
;;
*)
unsupported_install_family
;;
esac
cat <<EOF
Detected: ${DISTRO_PRETTY:-unknown} — family=${PKG_FAMILY}, manager=${PKG_MANAGER}
This will install or repair:
- ${driver_line}
- ${cuda_line}
- ${nct_line}${docker_line}
It will add NVIDIA's CUDA + Container Toolkit repositories if missing, and
may restart Docker. If your invoking user is not already in the 'docker'
group, it will be added (log out / 'newgrp docker' for that to take effect).
EOF
read -r -p "Continue? [y/N] " answer
case "$answer" in
y|Y|yes|YES) ;;
*) echo "Aborted."; exit 1 ;;
esac
}
install_prereqs() {
case "$PKG_FAMILY" in
debian)
export DEBIAN_FRONTEND=noninteractive
"${SUDO[@]}" apt-get update
"${SUDO[@]}" apt-get install -y --no-install-recommends ca-certificates curl gnupg
;;
rhel)
"${SUDO[@]}" "$PKG_MANAGER" -y install ca-certificates curl
# dnf-plugins-core is required for `dnf config-manager --add-repo` on
# RHEL/Rocky/Alma; Fedora ships it by default. Silently best-effort.
"${SUDO[@]}" "$PKG_MANAGER" -y install dnf-plugins-core >/dev/null 2>&1 \
|| "${SUDO[@]}" "$PKG_MANAGER" -y install yum-utils >/dev/null 2>&1 \
|| true
;;
suse)
"${SUDO[@]}" zypper --non-interactive refresh
"${SUDO[@]}" zypper --non-interactive install ca-certificates curl gpg2
;;
*)
unsupported_install_family
;;
esac
}
install_cuda_repo() {
[[ -n "$CUDA_REPO_DISTRO" && -n "$CUDA_REPO_ARCH" ]] || {
echo "ERROR: cannot map ${DISTRO_PRETTY} to an NVIDIA CUDA repo path." >&2
unsupported_install_family
}
case "$PKG_FAMILY" in
debian)
if dpkg-query -W cuda-keyring >/dev/null 2>&1; then
return 0
fi
local deb
deb="$(mktemp)"
curl -fsSL \
"https://developer.download.nvidia.com/compute/cuda/repos/${CUDA_REPO_DISTRO}/${CUDA_REPO_ARCH}/cuda-keyring_1.1-1_all.deb" \
--output "$deb"
"${SUDO[@]}" dpkg -i "$deb"
rm -f "$deb"
;;
rhel)
local repo_file="/etc/yum.repos.d/cuda-${CUDA_REPO_DISTRO}.repo"
if [[ -f "$repo_file" ]]; then
return 0
fi
local repo_url="https://developer.download.nvidia.com/compute/cuda/repos/${CUDA_REPO_DISTRO}/${CUDA_REPO_ARCH}/cuda-${CUDA_REPO_DISTRO}.repo"
if "${SUDO[@]}" "$PKG_MANAGER" config-manager --add-repo "$repo_url" >/dev/null 2>&1; then
:
else
# Fallback: drop the .repo file directly if config-manager is unavailable.
"${SUDO[@]}" curl -fsSL "$repo_url" -o "$repo_file"
fi
"${SUDO[@]}" "$PKG_MANAGER" clean expire-cache >/dev/null 2>&1 || true
;;
suse)
local repo_url="https://developer.download.nvidia.com/compute/cuda/repos/${CUDA_REPO_DISTRO}/${CUDA_REPO_ARCH}/cuda-${CUDA_REPO_DISTRO}.repo"
if zypper lr --uri 2>/dev/null | grep -q "$repo_url"; then
return 0
fi
"${SUDO[@]}" zypper --non-interactive addrepo --gpgcheck-strict "$repo_url"
"${SUDO[@]}" zypper --non-interactive --gpg-auto-import-keys refresh
;;
*)
unsupported_install_family
;;
esac
}
install_container_repo() {
case "$PKG_FAMILY" in
debian)
local key_tmp keyring_tmp list_tmp
key_tmp="$(mktemp)"
keyring_tmp="$(mktemp)"
list_tmp="$(mktemp)"
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey --output "$key_tmp"
gpg --dearmor --yes --output "$keyring_tmp" "$key_tmp"
"${SUDO[@]}" install -m 0644 "$keyring_tmp" /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
curl -fsSL https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list --output "$list_tmp"
sed -i 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' "$list_tmp"
"${SUDO[@]}" install -m 0644 "$list_tmp" /etc/apt/sources.list.d/nvidia-container-toolkit.list
rm -f "$key_tmp" "$keyring_tmp" "$list_tmp"
;;
rhel)
local repo_file="/etc/yum.repos.d/nvidia-container-toolkit.repo"
[[ -f "$repo_file" ]] && return 0
"${SUDO[@]}" curl -fsSL https://nvidia.github.io/libnvidia-container/stable/rpm/nvidia-container-toolkit.repo \
-o "$repo_file"
;;
suse)
local repo_url="https://nvidia.github.io/libnvidia-container/stable/rpm/nvidia-container-toolkit.repo"
if zypper lr --uri 2>/dev/null | grep -q "$repo_url"; then
return 0
fi
"${SUDO[@]}" zypper --non-interactive addrepo --gpgcheck-strict "$repo_url"
"${SUDO[@]}" zypper --non-interactive --gpg-auto-import-keys refresh
;;
*)
unsupported_install_family
;;
esac
}
install_runtime_packages() {
case "$PKG_FAMILY" in
debian)
export DEBIAN_FRONTEND=noninteractive
local kernel_headers
kernel_headers="linux-headers-$(uname -r)"
"${SUDO[@]}" apt-get update
"${SUDO[@]}" apt-get install -y --allow-downgrades \
"$kernel_headers" \
"$DRIVER_PACKAGE_DEBIAN" \
"$CUDA_PACKAGE" \
nvidia-container-toolkit \
nvidia-container-toolkit-base \
libnvidia-container-tools \
libnvidia-container1
;;
rhel)
# Kernel headers/devel package names match the running kernel.
"${SUDO[@]}" "$PKG_MANAGER" -y install \
"kernel-devel-$(uname -r)" \
"kernel-headers-$(uname -r)" || true
"${SUDO[@]}" "$PKG_MANAGER" -y install --allowerasing \
"$DRIVER_PACKAGE_RHEL" \
"$DRIVER_KMOD_RHEL" \
"$CUDA_PACKAGE" \
nvidia-container-toolkit \
nvidia-container-toolkit-base \
libnvidia-container-tools \
libnvidia-container1
;;
suse)
"${SUDO[@]}" zypper --non-interactive install --allow-downgrade \
"kernel-default-devel" \
"$DRIVER_PACKAGE_SUSE" \
"$CUDA_PACKAGE" \
nvidia-container-toolkit \
nvidia-container-toolkit-base \
libnvidia-container-tools \
libnvidia-container1
;;
*)
unsupported_install_family
;;
esac
}
install_docker_package() {
[[ "$INSTALL_DOCKER" -eq 1 ]] || return 0
[[ "$BACKEND" == "docker" || "$BACKEND" == "local-docker" ]] || return 0
have docker && return 0
case "$PKG_FAMILY" in
debian)
echo "Installing Docker package '${DOCKER_PACKAGE_DEBIAN}' (apt)..."
export DEBIAN_FRONTEND=noninteractive
"${SUDO[@]}" apt-get install -y --no-install-recommends "$DOCKER_PACKAGE_DEBIAN"
;;
rhel)
if [[ "$DISTRO_ID" == "fedora" ]] \
&& "${SUDO[@]}" "$PKG_MANAGER" -y install moby-engine moby-cli 2>/dev/null; then
echo "Installed Fedora's moby-engine + moby-cli."
else
echo "Installing docker-ce from download.docker.com ..."
local docker_repo
case "$DISTRO_ID" in
fedora) docker_repo="https://download.docker.com/linux/fedora/docker-ce.repo" ;;
*) docker_repo="https://download.docker.com/linux/centos/docker-ce.repo" ;;
esac
if ! "${SUDO[@]}" "$PKG_MANAGER" config-manager --add-repo "$docker_repo" >/dev/null 2>&1; then
"${SUDO[@]}" curl -fsSL "$docker_repo" -o /etc/yum.repos.d/docker-ce.repo
fi
"${SUDO[@]}" "$PKG_MANAGER" -y install docker-ce docker-ce-cli containerd.io
fi
;;
suse)
echo "Installing Docker via zypper..."
"${SUDO[@]}" zypper --non-interactive install docker
;;
*)
echo "WARN: --install cannot auto-install Docker on family '${PKG_FAMILY}'."
echo " Install Docker manually per https://docs.docker.com/engine/install/ ,"
echo " then rerun this script to finish wiring the NVIDIA runtime."
return 0
;;
esac
if have systemctl; then
"${SUDO[@]}" systemctl enable --now docker || {
echo "WARN: could not enable/start docker via systemctl; start it manually."
}
fi
}
add_invoker_to_docker_group() {
[[ "$ADD_USER_TO_DOCKER_GROUP" -eq 1 ]] || return 0
[[ "$BACKEND" == "docker" || "$BACKEND" == "local-docker" ]] || return 0
have docker || return 0
# Resolve the user that invoked us:
# - via sudo: EUID=0, SUDO_USER=<original> → use SUDO_USER
# - as non-root: EUID!=0, SUDO_USER unset → use $USER
# - as raw root: EUID=0, SUDO_USER unset → $USER=root → skip
local target_user="${SUDO_USER:-$USER}"
[[ -n "$target_user" && "$target_user" != "root" ]] || return 0
if ! getent group docker >/dev/null 2>&1; then
"${SUDO[@]}" groupadd docker || return 0
fi
if id -nG "$target_user" 2>/dev/null | tr ' ' '\n' | grep -qx docker; then
return 0
fi
"${SUDO[@]}" usermod -aG docker "$target_user" || return 0
echo "NOTE: Added '${target_user}' to the 'docker' group. The new membership"
echo " does NOT take effect in this shell. To use docker without sudo,"
echo " log out and back in, or run 'newgrp docker' in each new shell."
}
configure_docker_runtime() {
[[ "$CONFIGURE_DOCKER" -eq 1 ]] || return 0
[[ "$BACKEND" == "docker" || "$BACKEND" == "local-docker" ]] || return 0
if ! have docker; then
if [[ "$INSTALL_DOCKER" -eq 0 ]]; then
echo "WARN: Docker is not installed and --skip-docker-install was passed;"
echo " install Docker manually, then rerun this script to wire the"
echo " NVIDIA Container Toolkit runtime into /etc/docker/daemon.json."
else
echo "WARN: Docker is still not installed; skipping NVIDIA runtime configuration."
fi
return 0
fi
"${SUDO[@]}" nvidia-ctk runtime configure --runtime=docker
if have systemctl; then
"${SUDO[@]}" systemctl restart docker || {
echo "WARN: could not restart Docker; restart it manually before running GPU containers."
}
else
echo "WARN: systemctl not found; restart Docker manually before running GPU containers."
fi
}
detect_distro
if [[ "$INSTALL" -eq 0 ]]; then
print_status
if runtime_ok; then
exit 0
fi
echo
case "$PKG_FAMILY" in
debian|rhel|suse)
echo "Run with --install --yes after user approval to install or update the runtime."
;;
*)
echo "Automatic install is not available for this distribution. See the"
echo "MISSING messages above and the NVIDIA install guides at"
echo " https://docs.nvidia.com/cuda/cuda-installation-guide-linux/"
echo " https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html"
;;
esac
exit 1
fi
if ! sudo_available; then
echo "MISSING: passwordless sudo/root is required for runtime installation." >&2
exit 1
fi
case "$PKG_FAMILY" in
debian|rhel|suse) ;;
*) unsupported_install_family ;;
esac
confirm_install
install_prereqs
install_cuda_repo
install_container_repo
install_runtime_packages
install_docker_package
configure_docker_runtime
add_invoker_to_docker_group
if have modprobe; then
"${SUDO[@]}" modprobe nvidia || true
fi
print_status
runtime_ok
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Declares allowed tools, Needs a command-line tool, Needs Python, Needs Node.js
The author says: Runs `--check-only` on any Linux distribution. `--install` automates Ubuntu 22.04/24.04 + Debian 12 (apt), Fedora + RHEL/Rocky/AlmaLinux 9/10 (dnf), and openSUSE Leap / SLES 15 (zypper). Requires sudo/root, internet access to NVIDIA package repositories (and download.docker.com on rhel-family), and an x86_64 or aarch64 (sbsa) host. Other distributions (Arch, Alpine, Gentoo, NixOS, …) get a clear error that names the version targets and the NVIDIA install-guide URL.
Security
What our scanner noticed· Medium risk
- Large base64-encoded blobs
- Scripts that your agent may run
This skill includes scripts that your agent may run. Read them before you use it.
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- NVIDIA Corporation
- Publisher
- NVIDIA (Official)
- Source
- NVIDIA/skills · skills/tao-setup-nvidia-gpu-host · commit fce3cca
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE-APACHE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by NVIDIA Corporation or NVIDIA.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download tao-setup-nvidia-gpu-host.zip