Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add doc page on enabling Intel GPUs for dss #160

Merged
merged 32 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c06e1ae
Add doc page on enabling Intel GPUs for dss
mvlassis Aug 9, 2024
d05eb33
Update .customwordlist.txt
mvlassis Aug 9, 2024
ccc1f71
Update custom wordlist
mvlassis Aug 9, 2024
98d54b6
Update custom wordlist
mvlassis Aug 9, 2024
26f5127
Update custom wordlist
mvlassis Aug 9, 2024
8b78f75
Update docs/how-to/index.rst
mvlassis Aug 13, 2024
e1fa8dc
Update docs/how-to/index.rst
mvlassis Aug 13, 2024
e61f9d7
Update docs/how-to/enable-intel-gpu.rst
mvlassis Aug 13, 2024
632917d
Update docs/how-to/enable-intel-gpu.rst
mvlassis Aug 13, 2024
f6e03d5
Update docs/how-to/enable-intel-gpu.rst
mvlassis Aug 13, 2024
09473f3
Update docs/how-to/enable-intel-gpu.rst
mvlassis Aug 13, 2024
1324d62
Update docs/how-to/enable-intel-gpu.rst
mvlassis Aug 13, 2024
3faa623
Address comments from reviewers
mvlassis Aug 13, 2024
03bfcd6
Merge branch 'kf-6037-intel-gpu-doc' of https://github.com/canonical/…
mvlassis Aug 13, 2024
51c65a6
Add part about verifying the plugin for the cluster on the Intel GPU …
mvlassis Aug 13, 2024
47ebc9e
Update docs/how-to/enable-intel-gpu.rst
mvlassis Aug 13, 2024
1b67416
Update docs/how-to/enable-intel-gpu.rst
mvlassis Aug 13, 2024
b4d1ff5
Update docs/how-to/enable-intel-gpu.rst
mvlassis Aug 13, 2024
ccbaeb1
Update docs/how-to/enable-intel-gpu.rst
mvlassis Aug 13, 2024
c34d0fd
Update docs/how-to/enable-intel-gpu.rst
mvlassis Aug 13, 2024
0a51146
Address more comments
mvlassis Aug 13, 2024
617c293
Update Intel GPU plugin guide
mvlassis Aug 13, 2024
9788276
Use direct links instead of adding them in the reuse folder
mvlassis Aug 13, 2024
3379fe6
Use direct links instead of adding them in the reuse folder
mvlassis Aug 13, 2024
141426f
Update documentation on the guide
mvlassis Aug 13, 2024
cfb2e36
Add sample output for intel_gpu_top
mvlassis Aug 13, 2024
6749aa2
skip: updates based on feedback
DnPlas Aug 16, 2024
9a17598
skip: add output of kubectl
DnPlas Aug 16, 2024
1cbaef9
skip: fix typo
DnPlas Aug 16, 2024
5b1d267
skip: fix link
DnPlas Aug 16, 2024
4d8f804
Merge remote-tracking branch 'origin/main' into kf-6037-intel-gpu-doc
afgambin Aug 16, 2024
2f99892
final rev, subfolders
afgambin Aug 16, 2024
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
7 changes: 7 additions & 0 deletions docs/.custom_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,25 @@ DaemonSet
DS
DSS
GeForce
gpu
GPUs
hostpath
Hostpath
HWE
Initialize
initialize
initialized
initializing
intel
io
ipynb
Jupyter
jupyter
JupyterLab
kubeconfig
kubectl
kubeflownotebookswg
kustomization
afgambin marked this conversation as resolved.
Show resolved Hide resolved
runtime
runtimes
MacOS
Expand All @@ -28,6 +33,7 @@ microk8s.io
MLflow
mlruns
Multipass
NFD
Nvidia
OCI
ons
Expand All @@ -45,3 +51,4 @@ Tensorflow
toolkits
Validator
WSL
yaml
124 changes: 124 additions & 0 deletions docs/how-to/enable-intel-gpu.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
.. _enable_intel_gpu:

Enable Intel GPUs
=============================

This guide describes how to configure DSS to utilise the Intel GPUs on your machine. This can be done by enabling the Intel device plugin on your MicroK8s cluster.

Prerequisites
-------------

* :ref:`DSS is installed <install_DSS_CLI>` and :ref:`initialised <initialise_DSS>`.
* Your machine has an Intel GPU.
afgambin marked this conversation as resolved.
Show resolved Hide resolved

Install the Intel GPU plugin
----------------------------

To ensure DSS can utilise Intel GPUs:
1. The Intel GPU drivers must be installed.
2. MicroK8s must be set up to utilise the Intel GPU drivers.
afgambin marked this conversation as resolved.
Show resolved Hide resolved

Verify the Intel GPU drivers are installed in your machine
afgambin marked this conversation as resolved.
Show resolved Hide resolved
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

To confirm that your machine has the Intel GPU drivers set up, install the `intel-gpu-tools` package:

.. code-block:: bash

sudo apt install intel-gpu-tools

And list the Intel GPU devices on your machine as follows:

.. code-block:: bash

intel_gpu_top -L

If the drivers are correctly installed, you should receive information about your GPU device from the command's output.
afgambin marked this conversation as resolved.
Show resolved Hide resolved

.. note::
For Intel discrete GPUs on older versions of Ubuntu like 22.04, you may need to perform additional steps like install a `HWE kernel <https://ubuntu.com/kernel/lifecycle>`_.
afgambin marked this conversation as resolved.
Show resolved Hide resolved

Install the kubectl snap
afgambin marked this conversation as resolved.
Show resolved Hide resolved
~~~~~~~~~~~~~~~~~~~~~~~~~~~

First, install the `kubectl` snap package:
afgambin marked this conversation as resolved.
Show resolved Hide resolved

.. code-block:: bash

sudo snap install kubectl --classic

Create a configuration file so that `kubectl` can communicate with MicroK8s by running:

.. code-block:: bash

mkdir -p ~/.kube
microk8s config > ~/.kube/config

Enable the Intel GPU plugin in your Kubernetes cluster
afgambin marked this conversation as resolved.
Show resolved Hide resolved
------------------------------------------------------

To ensure DSS can utilise Intel GPUs, you have to enable the Intel GPU plugin in your Kubernetes cluster. To enable the plugin, you must download the appropriate `kustomization.yaml` files from `Intel device plugins for Kubernetes`_ repository, run `kubectl kustomize` to build YAML configuration files, and then apply them on your MicroK8s cluster.
afgambin marked this conversation as resolved.
Show resolved Hide resolved

Now, build the YAML files for Node Feature Discovery, Node Feature Rules, and the GPU plugin by running the following:

.. code-block:: bash

VERSION=v0.30.0
kubectl kustomize https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd?ref=${VERSION} > node_feature_discovery.yaml
kubectl kustomize https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd/overlays/node-feature-rules?ref=${VERSION} > node_feature_rules.yaml
kubectl kustomize https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/gpu_plugin/overlays/nfd_labeled_nodes?ref=${VERSION} > gpu_plugin.yaml

To allow multiple containers to utilise the same GPU, run:
afgambin marked this conversation as resolved.
Show resolved Hide resolved

.. code-block:: bash

sed -i 's/enable-monitoring/enable-monitoring\n - -shared-dev-num=10/' gpu_plugin.yaml

Finally, apply the built YAML files to your MicroK8s cluster as follows:

.. code-block:: bash

kubectl apply -f node_feature_discovery.yaml
kubectl apply -f node_feature_rules.yaml
kubectl apply -f gpu_plugin.yaml

The MicroK8s cluster is now configured to recognise and utilise your Intel GPU.

.. note::
After the YAML configuration files have been applied, they can be safely deleted.

Verify the Intel GPU plugin is installed
afgambin marked this conversation as resolved.
Show resolved Hide resolved
-------------------------------------------------
To verify the Intel GPU plugin is installed and the MicroK8s cluster recognises your GPU, run:

.. code-block:: bash

kubectl get nodes --show-labels | grep intel

You should receive non-empty output with the name of your cluster.
afgambin marked this conversation as resolved.
Show resolved Hide resolved

Verify DSS detects the GPU
----------------------------------

Verify DSS has detected the GPU by checking the DSS status. To do so, run the following command using the DSS CLI:

.. code-block:: bash

dss status

You should expect an output like this:

.. code-block:: bash

Output:
[INFO] MLflow deployment: Ready
[INFO] MLflow URL: http://10.152.183.68:5000
[INFO] NVIDIA GPU acceleration: Disabled
[INFO] Intel GPU acceleration: Enabled

See also
--------

* To enable the NVIDIA GPUs on your machine, see :ref:`nvidia_gpu`.
* To learn how to manage your DSS environment, check :ref:`manage_DSS`.
* If you are interested in managing Jupyter Notebooks within your DSS environment, see :ref:`manage_notebooks`.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ You can do so by configuring the underlying MicroK8s, on which DSS relies on for
Prerequisites
-------------

* :ref:`MicroK8s is installed <set_microk8s>`.
* :ref:`DSS CLI is installed <install_DSS_CLI>` and :ref:`initialised <initialise_DSS>`.
* Your machine has an NVIDIA GPU.

.. _install_nvidia_operator:

Expand Down
9 changes: 5 additions & 4 deletions docs/how-to/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@ Learn how to manage `MLflow <Charmed MLflow_>`_ within your DSS environment.
:maxdepth: 1

mlflow

Leverage NVIDIA GPUs
Leverage GPUs
afgambin marked this conversation as resolved.
Show resolved Hide resolved
--------------------

Learn how to configure DSS to utilise your NVIDIA GPUs.
Learn how to configure DSS to utilise your GPUs.

.. toctree::
:maxdepth: 1

enable-gpu
enable-intel-gpu
enable-nvidia-gpu

4 changes: 2 additions & 2 deletions docs/how-to/jupyter-notebook.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ You should expect an output like this:
[INFO] Success: Notebook test-notebook created successfully.
[INFO] Access the notebook at http://10.152.183.42:80.

Create a GPU-enabled notebook
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Create an NVIDIA GPU-enabled notebook
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can create a Jupyter Notebook containing CUDA runtimes and ML frameworks, and access its JupyterLab server.

Expand Down
1 change: 1 addition & 0 deletions docs/reuse/links.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.. _reStructuredText style guide: https://canonical-documentation-with-sphinx-and-readthedocscom.readthedocs-hosted.com/style-guide/
.. _Read the Docs at Canonical: https://library.canonical.com/documentation/read-the-docs
.. _How to publish documentation on Read the Docs: https://library.canonical.com/documentation/publish-on-read-the-docs
.. _Intel device plugins for Kubernetes: https://github.com/intel/intel-device-plugins-for-kubernetes
afgambin marked this conversation as resolved.
Show resolved Hide resolved
.. _Example product documentation: https://canonical-example-product-documentation.readthedocs-hosted.com/

.. _Charmed MLflow: https://documentation.ubuntu.com/charmed-mlflow/en/latest/
Expand Down
1 change: 1 addition & 0 deletions docs/tutorial/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,5 @@ Next Steps
* To learn more about how to interact with DSS, see :ref:`manage_DSS`.
* To learn about handling data, check out :ref:`access-data`.
* To connect to MLflow, see :ref:`manage_MLflow`.
* To enable your Intel GPUs, check out :ref:`enable_intel_gpu`.
* To enable your NVIDIA GPUs, check out :ref:`nvidia_gpu`.
Loading