Skip to content

Commit 4580fb8

Browse files
committed
docs: add initial GPU explanation
1 parent 334dcff commit 4580fb8

File tree

5 files changed

+62
-3
lines changed

5 files changed

+62
-3
lines changed

.custom_wordlist.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@ PyPI
1414
GPUs
1515
integrations
1616
autonomizing
17+
GRES
18+
PCIe
19+
Nvidia
20+
RESource

explanation/gpus/driver.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
(driver)=
2+
# Driver auto-install
3+
4+
Charmed HPC installs GPU drivers when the `slurmd` charm is deployed on a compute node equipped with a supported Nvidia GPU. Driver detection is performed via the API to [`ubuntu-drivers-common`](https://documentation.ubuntu.com/server/how-to/graphics/install-nvidia-drivers/#the-recommended-way-ubuntu-drivers-tool), a package which examines node hardware, determines appropriate third-party drivers and recommends a set of driver packages that are installed from the Ubuntu repositories.
5+
6+
## Libraries used
7+
8+
- [`ubuntu-drivers-common`](https://github.com/canonical/ubuntu-drivers-common), from GitHub.

explanation/gpus/index.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
(gpus)=
2+
# GPUs
3+
4+
A Graphics Processing Unit (GPU) is a specialized hardware resource that was originally designed to accelerate computer graphics calculations but now has expanded use in general purpose computing across a number of fields. GPU-enabled workloads are supported on a Charmed HPC cluster with the necessary driver and workload manager configuration automatically handled by the charms.
5+
6+
- {ref}`driver`
7+
- {ref}`slurmconf`
8+
9+
```{toctree}
10+
:titlesonly:
11+
:maxdepth: 1
12+
:hidden:
13+
14+
Driver auto-install <driver>
15+
Slurm enlistment <slurmconf>
16+
```

explanation/gpus/slurmconf.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
(slurmconf)=
2+
# Slurm enlistment
3+
4+
To allow cluster users to submit jobs requesting GPUs, detected GPUs are automatically added to the [Generic RESource (GRES) Slurm configuration](https://slurm.schedmd.com/gres.html). This is a feature in Slurm which enables scheduling of arbitrary generic resources, including GPUs.
5+
6+
## Device details
7+
8+
GPU details are gathered by [`pynvml`](https://pypi.org/project/nvidia-ml-py/), the official Python bindings for the Nvidia management library, which enables GPU counts, associated device files and model names to be queried from the drivers. For compatibility with Slurm configuration files, retrieved model names are converted to lowercase and white space is replaced with underscores. “Tesla T4” becomes `tesla_t4`, for example.
9+
10+
## Slurm configuration
11+
12+
Each GPU-equipped node is added to the `gres.conf` configuration file as its own `NodeName` entry, following the format defined in the [Slurm `gres.conf` documentation](https://slurm.schedmd.com/gres.conf.html). Individual `NodeName` entries are used over an entry per GRES resource to provide greater support for heterogeneous environments, such as a cluster where the same model of GPU is not consistently the same device file across compute nodes.
13+
14+
In `slurm.conf`, the configuration for GPU-equipped nodes has a comma-separated list in its `Gres=` element, giving the name, type and count for each GPU on the node.
15+
16+
For example, a Microsoft Azure Standard_NC24ads_A100_v4 node, equipped with a NVIDIA A100 PCIe GPU, is given a node configuration in `slurm.conf` of:
17+
18+
```
19+
NodeName=juju-e33208-1 CPUs=24 Boards=1 SocketsPerBoard=1 CoresPerSocket=24 ThreadsPerCore=1 RealMemory=221446 Gres=gpu:nvidia_a100_80gb_pcie:1 MemSpecLimit=1024
20+
```
21+
22+
and corresponding `gres.conf` line:
23+
24+
```
25+
NodeName=juju-e33208-1 Name=gpu Type=nvidia_a100_80gb_pcie File=/dev/nvidia0
26+
```
27+
28+
## Libraries used
29+
30+
- [`pynvml / nvidia-ml-py`](https://pypi.org/project/nvidia-ml-py/), from PyPI.
31+

explanation/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
# Explanation
33

44
- {ref}`cryptography`
5-
6-
🚧 Under construction 🚧
5+
- {ref}`GPUs`
76

87
```{toctree}
98
:titlesonly:
109
:maxdepth: 1
1110
:hidden:
1211
1312
cryptography/index
14-
```
13+
gpus/index
14+
```

0 commit comments

Comments
 (0)