Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions edge/nvidia-gpu-with-device-edge.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,19 @@ The NVIDIA container toolkit supports the distributions listed in the `NVIDIA Co

.. code-block:: console

$ curl -s -L https://nvidia.github.io/libnvidia-container/rhel8.7/libnvidia-container.repo | sudo tee /etc/yum.repos.d/libnvidia-container.repo
$ curl -s -L https://nvidia.github.io/libnvidia-container/stable/rpm/nvidia-container-toolkit.repo | sudo tee /etc/yum.repos.d/libnvidia-container.repo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Does it make sense to link to the official docs instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think is a question for @chenopis


#. Install the NVIDIA Container Toolkit for RHEL:

.. code-block:: console

$ sudo dnf install nvidia-container-toolkit -y

#. Set the NVIDIA Container Toolkit to use the CDI mode:

.. code-block:: console

$ sudo nvidia-ctk config --in-place --set nvidia-container-runtime.mode=cdi

#. The NVIDIA Container Toolkit requires some SELinux permissions to work properly. These permissions are set in three steps.

Expand Down Expand Up @@ -191,7 +196,7 @@ The NVIDIA container toolkit supports the distributions listed in the `NVIDIA Co
$ semodule_package --outfile nvidia-container-microshift.pp --module nvidia-container-microshift.mod


F. Apply the policy:
F. Apply the policy:

.. code-block:: console

Expand All @@ -214,19 +219,19 @@ The deployment consists of adding manifests and a ``kustomize`` configuration to

.. code-block:: console

$ sudo mkdir -p /etc/microshift/manifests
$ sudo mkdir -p /etc/microshift/manifests.d/nvidia-device-plugin

#. The device plugin runs in privileged mode, so you need to isolate it from other workloads by running it in its own namespace, ``nvidia-device-plugin``. To add the plugin to the manifests deployed by MicroShift at start time, download the configuration file and save it at ``/etc/microshift/manifests/nvidia-device-plugin.yml``.
#. The device plugin runs in privileged mode, so you need to isolate it from other workloads by running it in its own namespace, ``nvidia-device-plugin``. To add the plugin to the manifests deployed by MicroShift at start time, download the configuration file and save it at ``/etc/microshift/manifests.d/nvidia-device-plugin``.

.. code-block:: console

$ curl -s -L https://gitlab.com/nvidia/kubernetes/device-plugin/-/raw/main/deployments/static/nvidia-device-plugin-privileged-with-service-account.yml | sudo tee /etc/microshift/manifests/nvidia-device-plugin.yml
$ curl -s -L https://raw.githubusercontent.com/NVIDIA/k8s-device-plugin/refs/heads/main/deployments/static/nvidia-device-plugin-privileged-with-service-account.yml | sudo tee /etc/microshift/manifests.d/nvidia-device-plugin/nvidia-device-plugin.yml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Instead of doing this, does it make sense to generate a YAML file using helm template?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think no.
Why: This documentation page is for Microshift users, and they might not have helm installed on their hosts. I understand Helm is our official deployment method, but this is a corner case we are documenting for a platform (user base) that don't use Helm


#. The resources are not created automatically even though the files exist. You need to add them to the ``kustomize`` configuration. Do this by adding a single ``kustomization.yaml`` file in the ``manifests`` folder that references all the resources you want to create.

.. code-block:: console

$ cat <<EOF | sudo tee /etc/microshift/manifests/kustomization.yaml
$ cat <<EOF | sudo tee /etc/microshift/manifests.d/nvidia-device-plugin/kustomization.yaml
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
Expand Down