Confirm U30AllocUnit type, i.e., Card or Device, by issuing the following:
kubectl describe daemonset device-plugin-daemonset -n kube-system
Paste and customize the content below in a pod-description yaml file:
apiVersion: v1 kind: Pod metadata: name: <pod-name> # Choose a unique test pod name spec: containers: - name: <container-name> # Choose a unique container name image: <path-to-docker-image> # Path to the Docker image on ECR resources: limits: amd.com/ama_u30: 1 # Choose resources and numbers in node description command: ["/bin/sh"] args: ["-c", "while true; do echo hello; sleep 10;done"]
In the above example, the pod has a limit of 1 resource of the amd.com/ama_u30 kind. Variables set in the daemonset yaml file determine the effective result of this setting.
- When the U30NameConvention variable is set to CommonName in the daemonset yaml file, the amd.com/ama_u30 string allows setting resource limits without having to specify an exact U30 firmware version number. This provides backward and forward compatibility of pod-description file.
- The effective unit for the limit count is determined by the choice of U30AllocUnit in the daemonset yaml file. The allocation unit can be Card or Device.
- Non-U30 device is not influenced by U30NameConvention/U30AllocUnit setup, device will be registered with exact name and the allocation unit will be the whole card.
Create the pod using the pod-description yaml file:
kubectl create -f <pod-description.yml>
Check the status of the created pod:
kubectl get pod -o wide
You will see a similar report when the pod is successfully deployed on the cluster:
NAME READY STATUS RESTARTS AGE <pod-name> 1/1 Running 0 1m
Note: If the pod gets stuck during the container creation process or is being evicted, use the command below to get detailed status information:
kubectl describe pod <pod-name>
Log into the pod once it is in the running state:
kubectl exec -it <pod-name> -- /bin/bash
Inside the pod, source the environment and verify that the Xilinx devices are correctly mounted and visible:
source /opt/xilinx/xrt/setup.sh xbutil examine