Skip to content

Commit

Permalink
feat: expose gpus automagically (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
justinthelaw authored Oct 8, 2024
1 parent a77b581 commit edaaeac
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/GPU.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ The NVIDIA GPU Operator does not work on WSL2 as of version v24.3.0 (see [issue]
To get around this issue, the recommended course of action is to install UDS K3d without the `cuda` flavor, and then deploy the NVIDIA Device Plugin separately. Below are the steps for doing so:
1. Run `uds run default` or `uds zarf package deploy oci://justinthelaw/uds-k3d:${VERSION} --confirm`
1. Run `uds run default --set K3D_EXTRA_ARGS="--gpus=all"` or `uds zarf package deploy oci://justinthelaw/uds-k3d:${VERSION} --confirm --set K3D_EXTRA_ARGS="--gpus=all"`
2. Create an `nvidia-device-plugin.yaml` manifest like the one below, and a deploy it with `uds zarf tools kubectl apply -f nvidia-device-plugin.yaml`
```yaml
Expand Down
15 changes: 14 additions & 1 deletion zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ components:
setVariables:
- name: K3D_IMAGE
- name: enable-cuda
- name: inject-cuda-image
required: true
only:
flavor: cuda
Expand All @@ -69,6 +69,19 @@ components:
setVariables:
- name: K3D_IMAGE
- name: expose-gpus
required: true
only:
flavor: cuda
description: "Adds the extra K3d argument for exposing host GPUs to the cluster"
actions:
onDeploy:
before:
- cmd: |
echo "${ZARF_VAR_K3D_EXTRA_ARGS} --gpus=all"
setVariables:
- name: K3D_EXTRA_ARGS
- name: create-cluster
required: true
description: "Create the k3d cluster"
Expand Down

0 comments on commit edaaeac

Please sign in to comment.