meta-nvidia: gate GPU ready state on local TEE attestation (nvattest)#83
meta-nvidia: gate GPU ready state on local TEE attestation (nvattest)#83kvinwang wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR changes the NVIDIA-enabled image boot flow so the confidential-compute GPU “ready” state is only set after local GPU TEE attestation succeeds, preventing the GPU from accepting work before verification.
Changes:
- Remove unconditional
nvidia-smi conf-compute -srs 1fromnvidia-persistenced.service; make attestation the sole place that sets the ready state. - Add a new
nvattestBitBake recipe that builds NVIDIA’s attestation CLI and installs a oneshotnvidia-gpu-attestation.serviceplus gating drop-ins for dependent services. - Add a boot-time attestation runner (
nvidia-gpu-attest) and include thenvattestpackage in the NVIDIA rootfs image group.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| meta-nvidia/recipes-graphics/nvidia/files/nvidia-persistenced.service | Removes ready-state post hook and documents attestation-owned readiness. |
| meta-nvidia/recipes-graphics/nvattest/nvattest_2026.06.09.bb | New recipe building nvattest/libnvat and installing systemd units + gating drop-ins. |
| meta-nvidia/recipes-graphics/nvattest/files/nvidia-gpu-attestation.service | New oneshot service that runs the attestation gate (and currently reboots on failure). |
| meta-nvidia/recipes-graphics/nvattest/files/nvidia-gpu-attestation.default | Default configuration for attestation args/output and chrony behavior. |
| meta-nvidia/recipes-graphics/nvattest/files/nvidia-gpu-attestation-gate.conf | Drop-in to gate key services on successful attestation. |
| meta-nvidia/recipes-graphics/nvattest/files/nvidia-gpu-attest | Boot-time script that runs nvattest, stores results in /run, then sets CC ready state. |
| meta-dstack/recipes-core/images/dstack-rootfs-nvidia.inc | Adds nvattest to the NVIDIA image package group. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Update: offline RIM verification (commit 4de6c33)RIM reference measurements are now pre-provisioned in the measured rootfs instead of being fetched from the NVIDIA RIM service at boot:
TestedFresh GCP Workload container: |
Add an nvattest recipe building NVIDIA's attestation-sdk CLI (pinned SRCREV, Apache-2.0). GPU TEE attestation runs inside `dstack-util setup` (dstack-prepare.service), driven by the app-compose requirement `requirements.verify_gpu` (default true): the conf-compute ready state is set only after nvattest succeeds (previously nvidia-persistenced set it unconditionally), and attestation failure -- including a non-CC GPU or CC mode left off by the host -- aborts boot before key provisioning. Deployments can opt out with `requirements.verify_gpu: false`, which sets the ready state without verification. The recipe ships only the CLI plus a dstack-prepare.service ordering drop-in (After=nvidia-persistenced/nvidia-fabricmanager); there is no dedicated attestation service or unit gating. GPU-less instances are unaffected (dstack-util skips when no NVIDIA GPU is on the PCI bus). Build notes: - regorus (Rego engine, Rust) is embedded via Corrosion; use the prebuilt meta-rust-bin toolchain (cargo-bin-native), with host/target linker split for cargo build scripts (host triple == target triple) - USE_SYSTEM_DEPS=ON: link sysroot openssl/curl/libxml2/xmlsec1 instead of ExternalProject-downloaded copies - RUSTFLAGS remap-path-prefix keeps build paths out of libnvat ([buildpaths] QA / reproducible builds) - only nvattest + libnvat are shipped; cargo proc-macro dylibs are excluded from the image
4de6c33 to
8ef9a55
Compare
|
Re-verified end-to-end with the dstack-util-based gate (image built from this branch + Dstack-TEE/dstack#765 via |
Summary
Previously,
nvidia-persistenced.serviceset the confidential-compute GPU ready state (nvidia-smi conf-compute -srs 1) unconditionally at boot — the GPU accepted work whether or not its TEE state had been verified.This PR gates the ready state on local GPU TEE attestation, with the gate implemented in
dstack-util setupand driven by an app-compose requirement (Dstack-TEE/dstack#765):nvattestrecipe building NVIDIA's attestation-sdk CLI (the official successor to the Pythonlocal_gpu_verifier), pinned to a fixed SRCREV, Apache-2.0. The recipe ships only the CLI — no attestation service, wrapper script, or unit-gating drop-ins.dstack-util setup(dstack-prepare.service) enforces the newrequirements.verify_gpufield (default true): when an NVIDIA GPU is on the PCI bus it runsnvattest attest --device gpu --verifier local --nonce <32 random bytes>before key provisioning, and only sets the ready state after attestation succeeds. Any failure — non-CC GPU, CC mode left off by the host, missing nvattest — aborts boot fail-closed (boot.errorto the VMM, dstack-prepare reboots).verify_gpu: falseopts out and sets the ready state without verification.dstack-prepare.serviceruns afternvidia-persistenced/nvidia-fabricmanager(driver loaded, fabric up). GPU-less instances skip everything (PCI detection in dstack-util; nvidia units skip vianvidia-gpu-detect)./run/nvidia-gpu-attestation/attestation.out(0600) for later exposure via the guest agent.Depends on Dstack-TEE/dstack#765; the dstack submodule will be bumped once that merges.
Build / reproducibility notes
cargo-bin-native), not oe-core's source-bootstrappedrust-native; host/target linker split handled likecargo_bin.bbclass(host triple == target triple).USE_SYSTEM_DEPS=ON: links sysroot openssl/curl/libxml2/xmlsec1 instead of ExternalProject-downloaded static copies.RUSTFLAGS --remap-path-prefixkeeps build paths out oflibnvat(passes[buildpaths]QA).nvattest+libnvatare shipped; cargo proc-macro host dylibs are excluded.Tested
The same nvattest invocation (local verifier + random nonce) was verified end-to-end on GCP
a3-highgpu-1g(TDX + 1×H100 80GB, SPOT) in a dstack CVM built from the earlier systemd-service iteration of this branch:Workload container (after the gate released app-compose):
Boot-time overhead of the attestation step (evidence + RIM fetch + OCSP): ~2s. An end-to-end run of the dstack-util-based gate will follow once the submodule is bumped and the image rebuilt.
Follow-ups (not in this PR)
verify_gpu: falseopt-out path).