### Build and run examples with make run-examples Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/sdk-c/development.html Builds and installs the SDK using make, then runs the examples. ```makefile # build and install sdk using make make run-examples ``` -------------------------------- ### Example: help(verify_measurement_signature) Source: https://docs.nvidia.com/attestation/attestation-client-tools-sdk/latest/local-verifier/usage.html Example of using help() to get information about the verify_measurement_signature function. ```python e.g. help(verify_measurement_signature) ``` -------------------------------- ### Install the SDK Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/sdk-c/development.html Install the built SDK. ```bash make install-sdk ``` -------------------------------- ### Install PPCIE Verifier via Installer Script Source: https://docs.nvidia.com/attestation/attestation-client-tools-ppcie-sdk-cpp/latest/ppcie_quickstart_guide.html Installs PPCIE Verifier using the installer script from the nvtrust repository. ```bash 1. git clone https://github.com/NVIDIA/nvtrust 2. cd nvtrust/guest_tools/ppcie-verifier-sdk-cpp/install 3. source ppcie-installer.sh ``` -------------------------------- ### Run examples Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/sdk-rust/development.html Run the remote and local attestation examples using cargo. ```bash # Remote attestation example cargo run -p nv-attestation-sdk --example basic_remote_attestation # Local attestation example cargo run -p nv-attestation-sdk --example basic_local_attestation ``` -------------------------------- ### Install from source and run verifier Source: https://docs.nvidia.com/attestation/attestation-client-tools-sdk/latest/local-verifier/installation.html Installs the local GPU verifier from source by cloning the NVIDIA nvtrust repository, navigating to the local_gpu_verifier directory, installing the package, and running the verifier module. ```bash git clone https://github.com/NVIDIA/nvtrust cd nvtrust/guest_tools/gpu_verifiers/local_gpu_verifier pip3 install . python3 -m verifier.cc_admin ``` -------------------------------- ### Install SDK from Source Source: https://docs.nvidia.com/attestation/quick-start-guide/latest/install.html Clones the nvtrust repository and installs the Attestation SDK from source. Requires nv-local-gpu-verifier as a pre-requisite. ```bash git clone https://github.com/NVIDIA/nvtrust cd nvtrust/guest_tools/attestation_sdk pip3 install . ``` -------------------------------- ### Build and install the nvattest CLI Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/sdk-cli/introduction.html Build the CLI using make and then install it. ```bash make build-cli make install-cli ``` -------------------------------- ### Install SDK from PyPI Source: https://docs.nvidia.com/attestation/quick-start-guide/latest/install.html Installs the Attestation SDK directly from PyPI. Use within the activated virtual environment. ```bash pip3 install nv-attestation-sdk ``` -------------------------------- ### Install from PyPI and run verifier Source: https://docs.nvidia.com/attestation/attestation-client-tools-sdk/latest/local-verifier/installation.html Installs the local GPU verifier from PyPI and runs the verifier module. ```bash pip3 install nv-local-gpu-verifier python3 -m verifier.cc_admin ``` -------------------------------- ### Build and install the CLI from source Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/overview.html Clone the repository and use CMake to build and install the nvattest CLI. ```bash git clone https://github.com/NVIDIA/attestation-sdk.git cd attestation-sdk/nv-attestation-cli cmake -S . -B build -DCMAKE_BUILD_TYPE=Release cmake --build build cmake --install build sudo ldconfig ``` -------------------------------- ### Create virtual environment and install PPCIE Verifier Source: https://docs.nvidia.com/attestation/attestation-client-tools-ppcie/latest/ppcie_quickstart_guide.html Creates a Python virtual environment, activates it, and installs PPCIE Verifier version 1.x from PyPi. ```bash python3 -m venv venv source venv/bin/activate # This installs version 1.x pip3 install "nv-ppcie-verifier>=1.0,<2.0" ``` -------------------------------- ### Install build dependencies Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/sdk-rust/development.html Commands to install required build tools and libraries on Ubuntu. Run with sudo apt-get. ```bash # Update package list sudo apt-get update # Install build tools and dependencies sudo apt-get install -y \ cmake \ git \ pkg-config \ clang \ libclang-dev \ libcurl4-openssl-dev \ libssl-dev \ libxml2-dev \ libxmlsec1-dev \ libxmlsec1-openssl ``` -------------------------------- ### Typical development workflow Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/sdk-c/development.html A standard sequence of commands to set up, start, enter, and stop the development container. ```bash ./dev-env.sh setup ./dev-env.sh start ./dev-env.sh shell # do some work ./dev-env.sh stop # to nuke the container ./dev-env.sh clean # need to run setup again after this ``` -------------------------------- ### Complete configuration example using nv_attestation_sdk Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/sdk-rust/configuration.html Complete Rust example for the NVIDIA Attestation SDK. Initializes logging, configures the SDK with SdkOptions and Logger, sets HTTP options (max retry 5, connection timeout 10s, request timeout 30s), creates a filesystem RimStore and default OcspClient with the NVIDIA OCSP endpoint and an API key, then configures an AttestationContext for GPU device type and local verifier before performing attestation and printing the claims JSON. ```rust use nv_attestation_sdk::{ NvatSdk, SdkOptions, Logger, AttestationContext, HttpOptions, RimStore, OcspClient, DeviceType, VerifierType }; fn main() -> Result<(), Box> { // 1. Initialize logging env_logger::init(); // 2. Configure SDK let mut sdk_opts = SdkOptions::new()?; let logger = Logger::new()?; sdk_opts.set_logger(logger); let _client = NvatSdk::init(sdk_opts)?; // 3. Configure HTTP let mut http_opts = HttpOptions::default_options()?; http_opts.set_max_retry_count(5); http_opts.set_connection_timeout_ms(10000); http_opts.set_request_timeout_ms(30000); // 4. Set up verification components let _rim_store = RimStore::create_filesystem("/var/lib/nvat/rims")?; let _ocsp_client = OcspClient::create_default( Some("https://ocsp.attestation.nvidia.com"), Some("your-api-key"), Some(&http_opts) )?; // 5. Configure attestation context let mut ctx = AttestationContext::new()?; ctx.set_device_type(DeviceType::Gpu)?; ctx.set_verifier_type(VerifierType::Local)?; // 6. Perform attestation let result = ctx.attest_device(None)?; println!("Attestation successful!"); println!("Claims: {}", result.claims_json()?); Ok(()) } ``` -------------------------------- ### Verify nvattest Installation Source: https://docs.nvidia.com/attestation/attestation-client-tools-ppcie-sdk-cpp/latest/ppcie_quickstart_guide.html Verifies that the NVIDIA Attestation CLI (nvattest) is installed and on the PATH before installing PPCIE Verifier. ```bash nvattest version ``` -------------------------------- ### Install PPCIE Verifier via PyPI Source: https://docs.nvidia.com/attestation/attestation-client-tools-ppcie-sdk-cpp/latest/ppcie_quickstart_guide.html Installs PPCIE Verifier from PyPI, requiring a Python virtual environment. ```bash 1. python3 -m venv venv 2. source venv/bin/activate 3. pip3 install nv-ppcie-verifier ``` -------------------------------- ### Install build dependencies for nvattest from source Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/sdk-cli/introduction.html Install required packages for building the CLI from source. Includes Rust installation via rustup. ```bash sudo apt-get update && \ sudo apt-get install -y cmake git pkg-config clang \ libcurl4-openssl-dev libssl-dev libxml2-dev \ libxmlsec1-dev libxmlsec1-openssl # rust is a build dependency # install from here - https://rust-lang.org/tools/install/ # For Linux/Unix or macOS, install Rust with: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` -------------------------------- ### Install build dependencies for CLI Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/overview.html Install the necessary build dependencies on Ubuntu before compiling the CLI from source. ```bash apt update && \ apt install cmake git pkg-config clang \ libcurl4-openssl-dev libssl-dev libxml2-dev \ libxmlsec1-dev libxmlsec1-openssl ``` -------------------------------- ### Install GTest for testing Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/sdk-cli/development.html Clones and installs GoogleTest v1.16.0 from source. Required for building the tests. The command chains git clone, build, and install steps. ```bash git clone --depth 1 https://github.com/google/googletest.git -b v1.16.0 && cd googletest && mkdir build && cd build && cmake .. && cmake --build . --target install && cd / && rm -rf googletest ``` -------------------------------- ### Create and Activate a Virtual Environment Source: https://docs.nvidia.com/attestation/quick-start-guide/latest/install.html Creates and activates a Python virtual environment before installing the SDK. Recommended to avoid permission errors and system-wide installation issues. ```bash python3 -m venv venv source venv/bin/activate ``` -------------------------------- ### Build and install Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/sdk-c/introduction.html CMake build, build, install, and update the linker cache. Note that find_package(nvat) is not supported. ```bash cmake -S . -B build cmake --build build cmake --install build --strip sudo ldconfig ``` -------------------------------- ### Install Clang/LLVM for bindgen Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/sdk-rust/introduction.html Install Clang/LLVM, required by bindgen for generating FFI bindings. ```bash sudo apt-get install clang libclang-dev ``` -------------------------------- ### Get the source Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/sdk-c/introduction.html Clone the attestation-sdk repository and navigate to the C++ SDK directory. ```bash git clone https://github.com/NVIDIA/attestation-sdk.git cd attestation-sdk/nv-attestation-sdk-cpp ``` -------------------------------- ### Example PPCIE verifier output Source: https://docs.nvidia.com/attestation/quick-start-guide/latest/attestation-examples/hopper_ppcie.html Example output from the PPCIE verifier showing successful attestation of 8 GPUs and 4 NVSwitches. Includes nonce generation, evidence fetching, attestation results, and a final status table with all stages marked SUCCESS. ```text ************************************************** * PPCIE: Starting PPCIE Verification Tool * ************************************************** * PPCIE: Number of GPUs are: 8 * ************************************************** * PPCIE: Number of NVSwitches are: 4 * ************************************************** Nonce generated: f8a6160c83ae88af740ad93fd925fbba31309b99334507ad7aca9bdb99c2beeb Number of GPUs available : 8 Fetching GPU 0 information from GPU driver. Fetching GPU 1 information from GPU driver. Fetching GPU 2 information from GPU driver. Fetching GPU 3 information from GPU driver. Fetching GPU 4 information from GPU driver. Fetching GPU 5 information from GPU driver. Fetching GPU 6 information from GPU driver. Fetching GPU 7 information from GPU driver. All GPU Evidences fetched successfully ************************************************** * PPCIE: Attesting the GPUs * ************************************************** **** Attestation Successful **** ************************************************** * PPCIE: GPU Attestation result: True * ************************************************** * PPCIE: GPU Attestation Completed * ************************************************** Nonce generated: 16830ece6c1107731a6ca74790a3d21f836b8fece1bbae948b0aec674fd37726 Getting evidence details for SWX-84D3039F-B50B-F6D6-3AA6-037C1D27220F Getting evidence details for SWX-73FC0A0D-884E-39AC-74D3-AF17D05A5168 Getting evidence details for SWX-3929D2AC-1474-91E6-BECE-B57712CC2511 Getting evidence details for SWX-1DE14271-CBF9-C9DC-0173-E7D79C125A44 All nvSwitch Evidences fetched successfully ************************************************** * PPCIE: Attesting the switches * ************************************************** **** Attestation Successful **** ************************************************** * PPCIE: Switch attestation result is True * ************************************************** * PPCIE: Switch Attestation Completed * ************************************************** *PPCIE: Successfully set gpu state to ready state* ************************************************** +--------------------+---------+ | STAGE | STATUS | +--------------------+---------+ | GPU Pre-checks | SUCCESS | | Switch Pre-checks | SUCCESS | | GPU Attestation | SUCCESS | | Switch Attestation | SUCCESS | | Topology checks | SUCCESS | +--------------------+---------+ ************************************************** * PPCIE: End of PPCIE Verification Tool * ************************************************** ``` -------------------------------- ### Build the C++ SDK Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/sdk-rust/development.html Clone the attestation-sdk repository, build the C++ SDK with CMake, install it system-wide, and update the linker cache. ```bash # Clone the repository git clone https://github.com/NVIDIA/attestation-sdk.git cd attestation-sdk # Build the C++ SDK cd nv-attestation-sdk-cpp cmake -S . -B build -DCMAKE_BUILD_TYPE=Release cmake --build build cmake --install build sudo ldconfig ``` -------------------------------- ### Switch claim JSON example Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/sdk-c/configuration.html Example of a switch claim object with fields like x-nvidia-device-type, secboot, and certificate chain details. ```json { "x-nvidia-device-type": "nvswitch", "x-nvidia-switch-bios-rim-fetched": true, "x-nvidia-switch-bios-rim-signature-verified": true, "x-nvidia-switch-attestation-report-cert-chain-fwid-match": true, "x-nvidia-switch-attestation-report-signature-verified": true, "x-nvidia-switch-bios-rim-version-match": true, "x-nvidia-switch-attestation-report-parsed": true, "x-nvidia-switch-attestation-report-nonce-match": true, "x-nvidia-switch-attestation-report-cert-chain": { "x-nvidia-cert-status": "valid", "x-nvidia-cert-ocsp-status": "good", "x-nvidia-cert-expiration-date": "9999-12-31T23:59:59Z", "x-nvidia-cert-revocation-reason": null }, "x-nvidia-switch-arch-check": true, "secboot": true, "x-nvidia-switch-bios-rim-cert-chain": { "x-nvidia-cert-status": "valid", "x-nvidia-cert-ocsp-status": "good", "x-nvidia-cert-expiration-date": "2026-05-20T17:59:06Z", "x-nvidia-cert-revocation-reason": null }, "x-nvidia-attestation-warning": null, "hwmodel": "LS_10 A01 FSP BROM", "measres": "success", "x-nvidia-switch-bios-version": "96.10.55.00.01" } ``` -------------------------------- ### Example EAT obtained after attesting 8 GPUs Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/sdk-c/claims_schema.html Shows the JSON structure of a detached EAT with a top-level JWT and per-GPU tokens. The example includes a full JWT for GPU-0 and placeholders for other GPUs. ```json [ [ "JWT", "eyJraWQiOiJudi1lYXQta2lkLXN0Zy0yMDI1MTAyMzEwMjczMDEzMC0yZTY1N2ViNi01MjZhLTRiNTktODQyZS05NGEzMTQ4NGRjZjQiLCJhbGciOiJFUzM4NCJ9.eyJzdWIiOiJOVklESUEtUExBVEZPUk0tQVRURVNUQVRJT04iLCJ4LW52aWRpYS12ZXIiOiIzLjAiLCJuYmYiOjE3NjEzNDI0NzksImlzcyI6Imh0dHBzOi8vbnJhcy5hdHRlc3RhdGlvbi1zdGcubnZpZGlhLmNvbSIsIngtbnZpZGlhLW92ZXJhbGwtYXR0LXJlc3VsdCI6dHJ1ZSwic3VibW9kcyI6eyJHUFUtMCI6WyJESUdFU1QiLFsiU0hBLTI1NiIsImNkOTE4MTkxNjBjNDI4OTBjZGU2MzNjM2JjMGJkNDdjOWRkM2RlY2NhMDQ5ZjhkOTYwOTY1YzBlZGE1MDZlMzkiXV0sIkdQVS03IjpbIkRJR0VTVCIsWyJTSEEtMjU2IiwiZTE5NzY3YjA3MGI5ZDBhY2IyNTlkM2VjYWFjYWFkODY5MWQzZTJhNThkNzNkODA0NWEwMzhkMzcxZGExMDU0ZiJdXSwiR1BVLTUiOlsiRElHRVNUIixbIlNIQS0yNTYiLCI2ZTk2NDBiYmRlOTBjMmMzN2IxYmYwNzEwMTY4YTk4YmZkMGJhYjA2ZDcwY2FjMDA5YzJhNjUzMDI5ZDljZGFiIl1dLCJHUFUtNiI6WyJESUdFU1QiLFsiU0hBLTI1NiIsImY3NzI0NzllNzM1MjgyYzA3YTUxNWNiYjRhOTFiYTFmZjllMT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lzYWJsZWQiLCJ4LW52aWRpYS1ncHUtZHJpdmVyLXJpbS1mZXRjaGVkIjp0cnVlLCJ4LW52aWRpYS1ncHUtYXR0ZXN0YXRpb24tcmVwb3J0LWNlcnQtY2hhaW4tZndpZC1tYXRjaCI6dHJ1ZSwib2VtaWQiOiI1NzAzIiwieC1udmlkaWEtZ3B1LXZiaW9zLXJpbS1zY2hlbWEtdmFsaWRhdGVkIjp0cnVlLCJtZWFzcmVzIjoic3VjY2VzcyIsIngtbnZpZGlhLWdwdS12Ymlvcy12ZXJzaW9uIjoiOTYuMDAuQTUuMDAuMDEiLCJ4LW52aWRpYS1ncHUtdmJpb3MtcmltLW1lYXN1cmVtZW50cy1hdmFpbGFibGUiOnRydWV9.nA0YPp7KS7GMZZXFKxBcpMWv6yjFaw7RWy6SmTIwNDspchvE-UYV7RzdQuLlJY2Dqefth9gqEqaw59QVfEuyJ9W1dH5eAlkwLmQJtOeQc2Ur94Y2x8KlJZoFF7jURz98", "GPU-1": "JWT Token....", "GPU-2": "JWT Token....", ... all GPUs JWT tokens... } ] ``` -------------------------------- ### Check library loading for runtime errors Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/sdk-rust/development.html Use for runtime issues to verify that the library is loaded correctly by the example binary. ```bash # Check library loading ldd target/debug/examples/basic_remote_attestation ``` -------------------------------- ### Example claims after attesting 8 GPUs Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/sdk-c/claims_schema.html Example claims array returned after attesting 8 GPUs. The first element shows the full claim structure for GPU 0, including EAT nonce, hardware model, secure boot status, and nested certificate chain objects. Subsequent elements are abbreviated as placeholders for GPU 1, GPU 2, and so on. ```json [ { "dbgstat": "disabled", "eat_nonce": "ae1b408bf2f285aa140713eae81fd1b023bcffbc810759edfc6b385eb0631cdf", "hwmodel": "GH100 A01 GSP BROM", "measres": "success", "oemid": "5703", "secboot": true, "ueid": "655333107904478077882826344426270545524203067314", "x-nvidia-device-type": "gpu", "x-nvidia-gpu-arch-check": true, "x-nvidia-gpu-attestation-report-cert-chain": { "x-nvidia-cert-expiration-date": "9999-12-31T23:59:59Z", "x-nvidia-cert-ocsp-status": "good", "x-nvidia-cert-revocation-reason": null, "x-nvidia-cert-status": "valid" }, "x-nvidia-gpu-attestation-report-cert-chain-fwid-match": true, "x-nvidia-gpu-attestation-report-nonce-match": true, "x-nvidia-gpu-attestation-report-parsed": true, "x-nvidia-gpu-attestation-report-signature-verified": true, "x-nvidia-gpu-claims-version": "3.0", "x-nvidia-gpu-driver-rim-cert-chain": { "x-nvidia-cert-expiration-date": "2027-04-30T23:59:59Z", "x-nvidia-cert-ocsp-status": "good", "x-nvidia-cert-revocation-reason": null, "x-nvidia-cert-status": "valid" }, "x-nvidia-gpu-driver-rim-fetched": true, "x-nvidia-gpu-driver-rim-measurements-available": true, "x-nvidia-gpu-driver-rim-signature-verified": true, "x-nvidia-gpu-driver-rim-version-match": true, "x-nvidia-gpu-driver-version": "590.12", "x-nvidia-gpu-vbios-index-no-conflict": true, "x-nvidia-gpu-vbios-rim-cert-chain": { "x-nvidia-cert-expiration-date": "2026-05-31T20:11:53Z", "x-nvidia-cert-ocsp-status": "good", "x-nvidia-cert-revocation-reason": null, "x-nvidia-cert-status": "valid" }, "x-nvidia-gpu-vbios-rim-fetched": true, "x-nvidia-gpu-vbios-rim-measurements-available": true, "x-nvidia-gpu-vbios-rim-signature-verified": true, "x-nvidia-gpu-vbios-rim-version-match": true, "x-nvidia-gpu-vbios-version": "96.00.A5.00.01", "x-nvidia-gpu-switch-pdis": [ "0000000000000001", "0000000000000002" ], "x-nvidia-mismatch-measurement-records": null }, { GPU 1 claims ... }, { GPU 2 claims ... }, ... etc for all GPUs ] ``` -------------------------------- ### GPU claim JSON example Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/sdk-c/configuration.html Example of a GPU claim object with fields like x-nvidia-device-type, secboot, and certificate chain details. ```json { "x-nvidia-device-type": "gpu", "x-nvidia-gpu-driver-rim-schema-validated": true, "x-nvidia-gpu-vbios-rim-signature-verified": true, "x-nvidia-gpu-vbios-rim-fetched": true, "x-nvidia-gpu-driver-rim-version-match": true, "x-nvidia-gpu-attestation-report-nonce-match": true, "x-nvidia-gpu-vbios-index-no-conflict": true, "secboot": true, "x-nvidia-gpu-driver-rim-cert-chain": { "x-nvidia-cert-status": "valid", "x-nvidia-cert-ocsp-status": "good", "x-nvidia-cert-expiration-date": "2027-02-26T22:03:02Z", "x-nvidia-cert-revocation-reason": null }, "x-nvidia-gpu-vbios-rim-cert-chain": { "x-nvidia-cert-status": "valid", "x-nvidia-cert-ocsp-status": "good", "x-nvidia-cert-expiration-date": "2027-04-23T23:45:54Z", "x-nvidia-cert-revocation-reason": null }, "x-nvidia-gpu-attestation-report-parsed": true, "x-nvidia-gpu-attestation-report-cert-chain": { "x-nvidia-cert-status": "valid", "x-nvidia-cert-ocsp-status": "good", "x-nvidia-cert-expiration-date": "9999-12-31T23:59:59Z", "x-nvidia-cert-revocation-reason": null }, "x-nvidia-gpu-driver-rim-signature-verified": true, "x-nvidia-gpu-arch-check": true, "x-nvidia-gpu-vbios-rim-version-match": true, "x-nvidia-attestation-warning": null, "x-nvidia-gpu-driver-version": "575.32", "x-nvidia-gpu-driver-rim-measurements-available": true, "x-nvidia-gpu-attestation-report-signature-verified": true, "x-nvidia-gpu-driver-rim-fetched": true, "x-nvidia-gpu-attestation-report-cert-chain-fwid-match": true, "measres": "success", "x-nvidia-gpu-vbios-version": "97.00.88.00.0F", "x-nvidia-gpu-vbios-rim-measurements-available": true } ``` -------------------------------- ### Install dev dependencies with make install-dev-deps Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/sdk-c/development.html Installs development dependencies required for building and testing the SDK. Run this before attempting to build or run tests. ```makefile make install-dev-deps ``` -------------------------------- ### Run PPCIE Verifier with local attestation modes Source: https://docs.nvidia.com/attestation/attestation-client-tools-ppcie/latest/ppcie_quickstart_guide.html Executes the PPCIE verifier with local GPU and switch attestation modes. Example arguments provided. ```bash python3 -m ppcie.verifier.verification --gpu-attestation-mode=LOCAL --switch-attestation-mode=LOCAL (Example arguments provided) ``` -------------------------------- ### Create and activate Python virtual environment Source: https://docs.nvidia.com/attestation/attestation-client-tools-sdk/latest/local-verifier/installation.html Creates and activates a new Python virtual environment named 'prodtest' for the verifier installation. ```bash python3 -m venv ./prodtest source ./prodtest/bin/activate ``` -------------------------------- ### Use SDK with env_logger Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/sdk-rust/configuration.html Initializes the SDK with a logger that integrates with env_logger. Requires the logging feature and the env_logger crate. The example sets the log level to Debug and passes the logger to SdkOptions. ```rust use nv_attestation_sdk::{NvatSdk, SdkOptions, Logger}; fn main() -> Result<(), Box> { // Initialize env_logger env_logger::Builder::from_default_env() .filter_level(log::LevelFilter::Debug) .init(); // Create SDK with logger let mut opts = SdkOptions::new()?; let logger = Logger::new()?; opts.set_logger(logger); let _client = NvatSdk::init(opts)?; // SDK operations will log through env_logger Ok(()) } ``` -------------------------------- ### Elevate to Root User Privileges Source: https://docs.nvidia.com/attestation/attestation-client-tools-ppcie-sdk-cpp/latest/ppcie_quickstart_guide.html Elevates to root user privileges, which is necessary to set the GPU ready state during installation. ```bash sudo -i ``` -------------------------------- ### Perform Local GPU Attestation with nv_attestation_sdk Source: https://docs.nvidia.com/attestation/quick-start-guide/latest/attestation-examples/hopper_single_gpu.html Complete example script for performing local GPU attestation using the NVIDIA attestation SDK. It creates an attestation client, sets the service key, adds a local GPU verifier, retrieves evidence, performs attestation, and decodes the resulting token. Referenced as LocalGPUTest.py in the nvtrust repository. ```python from nv_attestation_sdk import attestation # Create attestation client client = attestation.Attestation() # Set API key (if not set via environment variable) client.set_service_key("YOUR_API_KEY") # Add local GPU verifier client.add_verifier(attestation.Devices.GPU, attestation.Environment.LOCAL, "", "") # Get evidence and perform attestation evidence_list = client.get_evidence() result = client.attest(evidence_list) # Get the attestation token token = client.get_token() print ("[LocalGPUTest] token : "+str(token)) # Decode the token client.decode_token(token) ``` -------------------------------- ### Build the CLI with CMake Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/sdk-cli/development.html Builds the CLI using CMake. Requires CMake 3.11+, a C++14 compiler, and the spdlog development package. After building, install and run ldconfig to refresh the linker cache. ```bash cd nv-attestation-cli cmake -S . -B build cmake --build build cmake --install build sudo ldconfig ``` -------------------------------- ### Check and configure libnvat.so for linker errors Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/sdk-rust/development.html Use when the linker cannot find libnvat.so. Check library installation with ldconfig, set LD_LIBRARY_PATH, or update the linker cache with sudo ldconfig. ```bash # Check library installation ldconfig -p | grep nvat # Set LD_LIBRARY_PATH export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH # Or update cache sudo ldconfig ``` -------------------------------- ### Subprocess error output during installation Source: https://docs.nvidia.com/attestation/attestation-client-tools-sdk/latest/local-verifier/installation.html Example error output when subprocess-related issues occur during installation, indicating a problem with updating the timestamp of the egg-info directory. ```text Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [2 lines of output] running egg_info error: Cannot update time stamp of directory 'src/nv_local_gpu_verifier.egg-info' [end of output] note: This error originates from a subprocess and is likely not a problem with pip. error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output. ``` -------------------------------- ### Remote GPU attestation with nv_attestation_sdk Source: https://docs.nvidia.com/attestation/quick-start-guide/latest/attestation-examples/hopper_single_gpu.html Complete remote attestation flow for a single Hopper H100 GPU using the NVIDIA attestation SDK. Sets the API key, adds the remote NRAS verifier, obtains evidence, performs attestation, retrieves the JWT token, and decodes it. Requires completing the Installation Guide first. ```python from nv_attestation_sdk import attestation # Create attestation client client = attestation.Attestation() # Set API key (if not set via environment variable) client.set_service_key("YOUR_API_KEY") # Add remote GPU verifier NRAS_URL = "https://nras.attestation.nvidia.com/v4/attest/gpu" client.add_verifier(attestation.Devices.GPU, attestation.Environment.REMOTE, NRAS_URL, "") # Get evidence and perform attestation evidence_list = client.get_evidence() result = client.attest(evidence_list) # Get the attestation token (JWT Format) token = client.get_token() print("[RemoteGPUTest] token : " + str(token)) # Decode the token client.decode_token(token) ``` -------------------------------- ### Uninstall Improperly Installed Package Source: https://docs.nvidia.com/attestation/quick-start-guide/latest/install.html Removes any improperly installed versions of the package before retrying installation. ```bash pip uninstall nvidia-attestation-sdk ``` -------------------------------- ### Build with system-installed library Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/sdk-rust/introduction.html Use the system-installed NVIDIA Attestation SDK library. The library will be found in standard system paths such as /usr/lib and /usr/local/lib. ```bash export NVAT_USE_SYSTEM_LIB=1 cargo build ``` -------------------------------- ### attest example output Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/sdk-cli/command-reference.html Example JSON output from attest, truncated. ```json { "claims": [ { "x-nvidia-device-type": "gpu", "secboot": true, "x-nvidia-gpu-driver-version": "575.32" // ... } ], "detached_eat": [ [ "JWT", "the-overall-jwt" ], { "GPU-0": "jwt-for-this-submodule", "GPU-1": "jwt-for-this-submodule", // ... } ], "result_code": 0, "result_message": "Ok" } ``` -------------------------------- ### collect-evidence example output Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/sdk-cli/command-reference.html Example JSON output from collect-evidence, truncated. ```json { "evidences": [ { "arch": "HOPPER", "nonce": "123..", "evidence": "EeAB..", "certificate": "LS0t.." }, { "evidence": "RfdT..", // ... } ], "result_code": 0, "result_message": "Ok" } ``` -------------------------------- ### Build the SDK Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/sdk-c/development.html Build the SDK to generate the libnvat.so library. ```bash make build-sdk # see make help for more info ``` -------------------------------- ### Attest using evidence files Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/sdk-cli/development.html Uses pre-existing JSON evidence files instead of live collection. Specify the evidence source as 'file' and provide the path to the evidence file for the GPU or NVSwitch. ```bash nvattest attest --device gpu --gpu-evidence-sourc file --gpu-evidence-file ./path/to/gpu_evidence.json nvattest attest --device nvswitch --nvswitch-evidence-source file --nvswitch-evidence-file ./path/to/switch_evidence.json ``` -------------------------------- ### Build from source: C++ SDK, Rust workspace, and runtime path Source: https://docs.nvidia.com/attestation/nv-attestation-sdk-cpp/latest/sdk-rust/introduction.html Build the C++ SDK, then build the Rust workspace, and set the runtime library path. These steps are part of the same workflow for building from source. ```bash cd nv-attestation-sdk-cpp cmake -S . -B build -DCMAKE_BUILD_TYPE=Release cmake --build build cmake --install build sudo ldconfig ``` ```bash cd ../nv-attestation-sdk-rust cargo build --workspace ``` ```bash export LD_LIBRARY_PATH=$(pwd)/../nv-attestation-sdk-cpp/build:$LD_LIBRARY_PATH ``` -------------------------------- ### Clean egg-info and build directories Source: https://docs.nvidia.com/attestation/attestation-client-tools-sdk/latest/local-verifier/installation.html Cleans the egg-info and build directories to resolve subprocess-related installation issues, then retry installation. ```bash rm -rf src/nv_local_gpu_verifier.egg-info rm -rf /build ```