From d89efe85f88820c4c006020cc7991ae410bad470 Mon Sep 17 00:00:00 2001 From: Jonathon Anderson Date: Fri, 29 Dec 2023 23:27:55 -0700 Subject: [PATCH] Example Rocky Linux container including the Nvidia driver Closes #31 Signed-off-by: Jonathon Anderson --- examples/rockylinux-9-nvidia/Containerfile | 8 ++++++++ examples/rockylinux-9-nvidia/README.md | 13 +++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 examples/rockylinux-9-nvidia/Containerfile create mode 100644 examples/rockylinux-9-nvidia/README.md diff --git a/examples/rockylinux-9-nvidia/Containerfile b/examples/rockylinux-9-nvidia/Containerfile new file mode 100644 index 0000000..dd1919e --- /dev/null +++ b/examples/rockylinux-9-nvidia/Containerfile @@ -0,0 +1,8 @@ +FROM ghcr.io/hpcng/warewulf-rockylinux:9 + +RUN dnf -y install dnf-plugins-core epel-release kernel-headers \ + && dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel9/$(arch)/cuda-rhel9.repo \ + && dnf -y module install nvidia-driver:latest-dkms \ + && dnf clean all \ + && ls /lib/modules | xargs -n1 /usr/lib/dkms/dkms_autoinstaller start \ + && dkms status diff --git a/examples/rockylinux-9-nvidia/README.md b/examples/rockylinux-9-nvidia/README.md new file mode 100644 index 0000000..8dcfc46 --- /dev/null +++ b/examples/rockylinux-9-nvidia/README.md @@ -0,0 +1,13 @@ +# Rocky Linux with the Nvidia driver + +This container definition demonstrates building a Rocky Linux based container +incorporating the Nvidia driver for Nvidia GPU support. + +The container may be built with Podman. + +```shell + +podman build . +``` + +The host that builds the container does _not_ need to have a GPU installed.