Skip to content

Support H200 Protected PCIe in the default guest GPU attestation policy - #1643

Open
Leechael wants to merge 2 commits into
Dstack-TEE:nextfrom
Leechael:fix/h200-ppcie-attestation
Open

Leechael wants to merge 2 commits into
Dstack-TEE:nextfrom
Leechael:fix/h200-ppcie-attestation

Conversation

@Leechael

@Leechael Leechael commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

On HGX H200 with 8 GPUs and 4 NVSwitches in Protected PCIe (PPCIe) mode, NVML reports per-GPU CC off. The existing boot gate rejects that state even after GPU verification succeeds. Setting requirements.gpu_policy.attest_gpu: false is not a fix: it skips GPU appraisal entirely.

Change

Requires the nvattest 2026.11.23 bump from #1646 (merged).

  • Patch nvattest to emit two signed facts it already parses but drops: x-nvidia-gpu-mode (GPU FEATURE_FLAG) and x-dstack-switch-lock-status (NVSwitch SWITCH_LOCK_STATUS).
  • NVML only selects the PPCIe path. dstack then attests the GPUs and NVSwitches with the same fresh nonce and accepts CC off only if every GPU signs mode ppcie, every NVSwitch signs the locked status, and the PDIs describe one full 8-GPU / 4-NVSwitch fabric.
  • On the CC path, a GPU that signs a non-CC mode is rejected.
  • Bind both exact verifier outputs to a PPCIe boot evidence record (event version 4). The ordinary CC event and evidence format are unchanged. App Rego still receives the GPU claims only.

The fabric checks follow the NVIDIA PPCIe verifier. This does not claim hardware binding of the devices to the CPU TEE.

Validation

  • dstack-util and nvattest tests, Clippy and prek pass.
  • Patched nvattest built with the mkosi component script. On the SDK's PPCIe sample evidence (multi_switch_ls10.json), all four NVSwitches report x-dstack-switch-lock-status: 1. The sample GPU evidence signs FEATURE_FLAG = 2 (ppcie); its driver RIM is not published, so the GPU claim was not produced end to end.
  • Validate a real 8-GPU / 4-NVSwitch H200 guest boot.

@Leechael
Leechael force-pushed the fix/h200-ppcie-attestation branch 3 times, most recently from d50b96c to 9f10008 Compare November 24, 2026 17:38
@kvinwang

Copy link
Copy Markdown
Collaborator

Suggested rework, on top of #1646 (nvattest 2026.11.23):

  1. Rebase onto build(os/mkosi): update nvattest to 2026.11.23 #1646.

  2. Drop the NSCQ patch. 0002-expose-nvswitch-lock-state reports unsigned NSCQ state, which the host can forge. Emit signed fields that nvattest already parses instead:

    • GPU: serialize x-nvidia-gpu-mode. LocalGpuVerifier::add_gpu_mode_claim computes m_mode from the signed FEATURE_FLAG, but SerializableGpuClaimsV4::to_json never writes it, even though the CLI reads it (attest.cpp). This one-liner is worth upstreaming.
    • NVSwitch: emit the PROTECTED_PCIE_STATUS (21) and SWITCH_LOCK_STATUS (25) opaque fields as raw hex, e.g. x-dstack-switch-ppcie-status / x-dstack-switch-lock-status.
  3. Gate only on signed claims in Rust.

    • Use NVML only to decide whether to collect NVSwitch evidence, not as a pass condition.
    • Require all GPUs to report the same mode. In PPCIe mode, require every switch to report PPCIe enabled and locked, plus the 8 GPU / 4 switch PDI topology match.
    • Apply the same rule to CC: require signed mode == "cc" instead of trusting NVML is_cc_enabled.
  4. Shrink the diff.

    • One claim struct, with #[serde(alias = ...)] for the switch field names.
    • One parameterized output validator shared by GPU and NVSwitch.
    • Add a device parameter to nvattest::run instead of new run_switch/run_device.
    • Keep the app-Rego raw input GPU-only for compatibility.
    • Keep these checks in Rust, not in a default Rego (a user Rego replaces it).

Open item: the encoding of the two switch opaque bytes is undocumented. Please capture evidence on a real H200 PPCIe host to define the accepted values, and use it as a test fixture.

@Leechael
Leechael force-pushed the fix/h200-ppcie-attestation branch from 9f10008 to 7bcca03 Compare November 26, 2026 00:49
@Leechael
Leechael marked this pull request as ready for review November 26, 2026 03:10
@kvinwang
kvinwang force-pushed the fix/h200-ppcie-attestation branch from 7bcca03 to 6e60fe0 Compare November 26, 2026 03:59
@kvinwang
kvinwang changed the base branch from next to chore/bump-nvattest-2026.11.23 November 26, 2026 05:27
@kvinwang
kvinwang force-pushed the chore/bump-nvattest-2026.11.23 branch from 3903ca8 to b6fa0c4 Compare November 26, 2026 11:53
@kvinwang
kvinwang deleted the branch Dstack-TEE:chore/bump-nvattest-2026.11.23 November 26, 2026 12:40
@kvinwang kvinwang closed this Nov 26, 2026
@kvinwang kvinwang reopened this Nov 26, 2026
@kvinwang
kvinwang changed the base branch from chore/bump-nvattest-2026.11.23 to next November 26, 2026 15:54
kvinwang and others added 2 commits November 26, 2026 07:54
A CC-off Protected PCIe launch must prove from signed evidence that the
GPUs run in PPCIe mode and that every NVSwitch is locked. NVML and NSCQ
report that state through the host-controlled driver.

nvattest already parses both facts from the SPDM opaque data but drops
them: the GPU mode derived from FEATURE_FLAG is never serialized, and
SWITCH_LOCK_STATUS is never read. Patch nvattest to emit them as
x-nvidia-gpu-mode and x-dstack-switch-lock-status.

Signed-off-by: Kevin Wang <wy721@qq.com>
An HGX H200 in Protected PCIe mode runs its 8 GPUs with CC off behind 4
NVSwitches. When NVML reports PPCIe, also attest the NVSwitches with the
same nonce and accept CC off only if the signed claims show:

- every GPU reports mode "ppcie";
- every NVSwitch reports the locked status;
- GPU and NVSwitch PDIs describe one complete fabric.

On the CC path, reject a GPU whose signed mode is not a CC mode. GPU and
NVSwitch claims share one parser and appraisal; application Rego still
receives the GPU claims only.

Signed-off-by: Leechael Yim <yanleech@gmail.com>
Signed-off-by: Kevin Wang <wy721@qq.com>
@kvinwang
kvinwang force-pushed the fix/h200-ppcie-attestation branch from 6e60fe0 to 053022b Compare November 26, 2026 15:55

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants