Run a Sample Workload#
After completing the deployment steps, verify your installation by running a basic single-GPU sample workload inside a Confidential Container.
This page intentionally uses the simplest possible manifest so that you can confirm the deployment end-to-end. For the full set of workload configuration options, including runtime class selection, resource type naming, and multi-GPU passthrough, refer to Configuring Confidential Container Workloads.
Create a file named
cuda-vectoradd-kata.yamlwith the following sample manifest:apiVersion: v1 kind: Pod metadata: name: cuda-vectoradd-kata namespace: default spec: runtimeClassName: kata-qemu-nvidia-gpu-snp # or kata-qemu-nvidia-gpu-tdx restartPolicy: Never containers: - name: cuda-vectoradd image: "nvcr.io/nvidia/k8s/cuda-sample:vectoradd-cuda12.5.0-ubuntu22.04" resources: limits: nvidia.com/pgpu: "1" memory: 16Gi
Before applying the manifest, adjust the two highlighted lines for your environment:
Runtime class. Use
kata-qemu-nvidia-gpu-snpon AMD SEV-SNP nodes orkata-qemu-nvidia-gpu-tdxon Intel TDX nodes.GPU resource type. The sample requests
nvidia.com/pgpu, which is the default resource name advertised by the NVIDIA Kata sandbox device plugin. If your cluster was installed with theP_GPU_ALIAS=""setting, replace it with the model-specific name advertised on your node, for examplenvidia.com/GH100_H200_141GB.
Refer to Configuring Confidential Container Workloads for guidance on each option.
Create the pod:
$ kubectl apply -f cuda-vectoradd-kata.yamlExample Output:
pod/cuda-vectoradd-kata createdOptional: Verify the pod is running:
$ kubectl get pod cuda-vectoradd-kataExample Output:
NAME READY STATUS RESTARTS AGE cuda-vectoradd-kata 1/1 Running 0 10s
View the logs from the pod after the container starts:
$ kubectl logs -n default cuda-vectoradd-kataExample Output:
[Vector addition of 50000 elements] Copy input data from the host memory to the CUDA device CUDA kernel launch with 196 blocks of 256 threads Copy output data from the CUDA device to the host memory Test PASSED Done
Delete the pod:
$ kubectl delete -f cuda-vectoradd-kata.yaml
Next Steps#
Configure Confidential Container workloads for runtime class selection, resource type naming, and single- or multi-GPU passthrough patterns.
Configure Attestation with the Trustee framework to enable remote verification of your confidential environment.
Manage the confidential computing mode on your GPUs.