Skip to main content

Command: phala gpu-policy

Syntax

Description

Show, set, or reset the GPU policy of a GPU CVM. Requires a GPU instance type, dstack OS 0.6.0 or newer, and Phala Cloud CLI 1.3.0-beta.1 or newer. See GPU Policy for full details on eligibility, compose hashing, and recovery. Changing the policy updates the compose hash. A running CVM restarts (taking a few minutes); a stopped CVM stays stopped and picks up the new policy on its next start.

Subcommands

All subcommands resolve the target CVM from --cvm-id, --interactive, or the CVM ID in phala.toml.

Supported configurations

{"attest_gpu": false} (attestation-off) works on all GPU instance types (including H200). Only DevTools changes the GPU mode, and only on B200 and B300 GPUs. On other GPUs, the DevTools policy keeps the normal confidential mode and works like attestation off. By default, GPUs run with confidential computing enabled (or protected PCIe mode on 8-GPU H200 machines); disabling confidential computing altogether is not supported.

Command: phala gpu-policy show

Syntax

Description

Prints the stored policy (or not set), the configuration it matches, OS support status, and any staged policy change. Also shows the expected and host-observed GPU mode for each GPU.

Options

Examples

  • Show the current policy and GPU mode

Command: phala gpu-policy set

Syntax

Description

Replaces the stored GPU policy as a whole without merging keys from the existing policy. Pass one policy source (omit it when confirming a prepared Onchain KMS update with --compose-hash): Custom JSON input (--file or --stdin) is validated locally before sending. It must be a non-empty JSON object containing only boolean fields (allow_debug, allow_devtools, allow_insecure_boot, attest_gpu) or a non-empty Rego v0 policy string (rego, see the dstack GPU security model), with no null values. {} and null are rejected; use phala gpu-policy reset to return to the default. The CLI compares exact keys and values against the stored policy. If they match, it prints No change made., exits 0, and skips restarting the CVM. Because the comparison is literal, {"attest_gpu": false} and {"attest_gpu": false, "allow_devtools": false} produce different compose hashes and trigger a restart. An explicit default like {"attest_gpu": true} is also sent verbatim and produces a different compose hash than having no policy.

Arguments

Options

Examples

  • Disable GPU attestation
  • Enable DevTools mode on B200/B300 and wait for restart
  • Send a custom JSON policy from a file
  • Read a custom JSON policy from stdin
  • Stage the change and apply with other draft updates
  • Recover a CVM whose GPUs failed to start (run phala cvms stop first if a start is still in progress)

Command: phala gpu-policy reset

Syntax

Description

Removes requirements.gpu_policy, returning the CVM to full GPU attestation. Accepts the same options as set, without a policy source.

Examples

  • Return to the default policy

Setting the policy with phala deploy

You can also pass --gpu-policy or --gpu-policy-file to phala deploy when creating or updating a CVM: