From 25e8852a455a930849d8e4394e6b74efbd64f7fb Mon Sep 17 00:00:00 2001 From: liyuan Date: Tue, 27 Oct 2026 14:33:44 +0800 Subject: [PATCH 1/7] [spark-rapids] Fix MIG driver install on Debian 12 Signed-off-by: liyuan --- spark-rapids/mig.sh | 70 +++++++++++++++++++++++++++++++++------------ 1 file changed, 51 insertions(+), 19 deletions(-) diff --git a/spark-rapids/mig.sh b/spark-rapids/mig.sh index 6d0874ff3..850376397 100644 --- a/spark-rapids/mig.sh +++ b/spark-rapids/mig.sh @@ -217,6 +217,17 @@ NVIDIA_DRIVER_VERSION=$(get_metadata_attribute 'driver-version' '550.54.15') #53 CUDA_VERSION_MAJOR="${CUDA_VERSION%.*}" #12.2 # EXCEPTIONS +# Debian 12 security kernels use the four-argument pci_resize_resource API, +# which is incompatible with NVIDIA 550 open modules. +if is_debian12 ; then + NVIDIA_DRIVER_VERSION=$(get_metadata_attribute 'driver-version' '580.95.05') + if [[ "${NVIDIA_DRIVER_VERSION%%.*}" == "550" ]]; then + echo "WARNING: Driver version 550 is incompatible with Debian 12 kernel. Overriding to 580.95.05" >&2 + NVIDIA_DRIVER_VERSION='580.95.05' + fi + USE_REPO_INSTALL="true" +fi + # Change CUDA version for Ubuntu 18 (Cuda 12.1.1 - Driver v530.30.02 is the latest version supported by Ubuntu 18) if [[ "${OS_NAME}" == "ubuntu" ]]; then if is_ubuntu18 ; then @@ -296,30 +307,51 @@ function install_nvidia_gpu_driver() { execute_with_retries "apt-get install -y -q 'linux-headers-$(uname -r)'" - curl -fsSL --retry-connrefused --retry 3 --retry-max-time 5 \ - "${LOCAL_DEB_URL}" -o /tmp/local-installer.deb + if [[ "${USE_REPO_INSTALL:-false}" == "true" ]]; then + execute_with_retries \ + "curl -fsSL --retry-connrefused --retry 3 --retry-max-time 5 https://developer.download.nvidia.com/compute/cuda/repos/${shortname}/x86_64/cuda-keyring_1.1-1_all.deb -o /tmp/cuda-keyring_1.1-1_all.deb" + execute_with_retries "dpkg -i /tmp/cuda-keyring_1.1-1_all.deb" + rm -f /tmp/cuda-keyring_1.1-1_all.deb + execute_with_retries "apt-get update" - dpkg -i /tmp/local-installer.deb - rm /tmp/local-installer.deb - cp ${DIST_KEYRING_DIR}/cuda-*-keyring.gpg /usr/share/keyrings/ + execute_with_retries "apt-get install -y -q --no-install-recommends dkms" + execute_with_retries \ + "apt-get install -y -q --no-install-recommends nvidia-driver-pinning-${NVIDIA_DRIVER_VERSION_PREFIX}" + execute_with_retries "apt-get update" - add_contrib_components + configure_dkms_certs + execute_with_retries \ + "apt-get install -y -q --no-install-recommends nvidia-kernel-open-dkms nvidia-driver-cuda" + clear_dkms_key - execute_with_retries "apt-get update" + execute_with_retries \ + "apt-get install -y -q --no-install-recommends cuda-toolkit-${CUDA_VERSION_MAJOR//./-}" + else + curl -fsSL --retry-connrefused --retry 3 --retry-max-time 5 \ + "${LOCAL_DEB_URL}" -o /tmp/local-installer.deb - ## EXCEPTION - if is_debian10 ; then - apt-get remove -y libglvnd0 - apt-get install -y ca-certificates-java - fi + dpkg -i /tmp/local-installer.deb + rm /tmp/local-installer.deb + cp ${DIST_KEYRING_DIR}/cuda-*-keyring.gpg /usr/share/keyrings/ - configure_dkms_certs - execute_with_retries "apt-get install -y -q nvidia-kernel-open-dkms" - clear_dkms_key - execute_with_retries \ - "apt-get install -y -q --no-install-recommends cuda-drivers-${NVIDIA_DRIVER_VERSION_PREFIX}" - execute_with_retries \ - "apt-get install -y -q --no-install-recommends cuda-toolkit-${CUDA_VERSION_MAJOR//./-}" + add_contrib_components + + execute_with_retries "apt-get update" + + ## EXCEPTION + if is_debian10 ; then + apt-get remove -y libglvnd0 + apt-get install -y ca-certificates-java + fi + + configure_dkms_certs + execute_with_retries "apt-get install -y -q nvidia-kernel-open-dkms" + clear_dkms_key + execute_with_retries \ + "apt-get install -y -q --no-install-recommends cuda-drivers-${NVIDIA_DRIVER_VERSION_PREFIX}" + execute_with_retries \ + "apt-get install -y -q --no-install-recommends cuda-toolkit-${CUDA_VERSION_MAJOR//./-}" + fi modprobe nvidia From bad1ca8da0fd2c8a4a267d4fdb6ec62381f67135 Mon Sep 17 00:00:00 2001 From: liyuan <84758614+nvliyuan@users.noreply.github.com> Date: Tue, 27 Oct 2026 15:27:02 +0800 Subject: [PATCH 2/7] Update spark-rapids/mig.sh Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- spark-rapids/mig.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/spark-rapids/mig.sh b/spark-rapids/mig.sh index 850376397..4c5976d99 100644 --- a/spark-rapids/mig.sh +++ b/spark-rapids/mig.sh @@ -312,6 +312,7 @@ function install_nvidia_gpu_driver() { "curl -fsSL --retry-connrefused --retry 3 --retry-max-time 5 https://developer.download.nvidia.com/compute/cuda/repos/${shortname}/x86_64/cuda-keyring_1.1-1_all.deb -o /tmp/cuda-keyring_1.1-1_all.deb" execute_with_retries "dpkg -i /tmp/cuda-keyring_1.1-1_all.deb" rm -f /tmp/cuda-keyring_1.1-1_all.deb + add_contrib_components execute_with_retries "apt-get update" execute_with_retries "apt-get install -y -q --no-install-recommends dkms" From bf02dd571052ca6aa0242e6dff2067cc3ddfd010 Mon Sep 17 00:00:00 2001 From: liyuan Date: Tue, 27 Oct 2026 15:28:09 +0800 Subject: [PATCH 3/7] fix: address MIG install review comments Signed-off-by: liyuan --- spark-rapids/mig.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/spark-rapids/mig.sh b/spark-rapids/mig.sh index 4c5976d99..36aa5cafc 100644 --- a/spark-rapids/mig.sh +++ b/spark-rapids/mig.sh @@ -172,11 +172,11 @@ function configure_dkms_certs() { function clear_dkms_key { if [[ -z "${PSN}" ]]; then - echo "No signing secret provided. skipping" >2 + echo "No signing secret provided. skipping" >&2 return 0 fi - echo "WARN -- PURGING SIGNING MATERIAL -- WARN" >2 - echo "future dkms runs will not use correct signing key" >2 + echo "WARN -- PURGING SIGNING MATERIAL -- WARN" >&2 + echo "future dkms runs will not use correct signing key" >&2 rm -rf "${CA_TMPDIR}" /var/lib/dkms/mok.key /var/lib/shim-signed/mok/MOK.priv } @@ -318,7 +318,6 @@ function install_nvidia_gpu_driver() { execute_with_retries "apt-get install -y -q --no-install-recommends dkms" execute_with_retries \ "apt-get install -y -q --no-install-recommends nvidia-driver-pinning-${NVIDIA_DRIVER_VERSION_PREFIX}" - execute_with_retries "apt-get update" configure_dkms_certs execute_with_retries \ From fb8902506aa65290c70cb280673ff26f8dc39dc9 Mon Sep 17 00:00:00 2001 From: liyuan Date: Mon, 2 Nov 2026 16:20:00 +0800 Subject: [PATCH 4/7] spark-rapids: run MIG setup only on workers Signed-off-by: liyuan --- spark-rapids/README.md | 4 ++++ spark-rapids/mig.sh | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/spark-rapids/README.md b/spark-rapids/README.md index 92f55fea3..c55dc59ed 100644 --- a/spark-rapids/README.md +++ b/spark-rapids/README.md @@ -106,6 +106,10 @@ profile id or the name (ie 3g.20gb) can be specified. For example: --metadata=^:^MIG_CGI='3g.20gb,9' ``` Create cluster with MIG enabled: + + The MIG startup script runs only on worker nodes. It skips the master node + so that the required MIG reboot does not interrupt Dataproc master service + initialization. ```bash REGION= diff --git a/spark-rapids/mig.sh b/spark-rapids/mig.sh index 36aa5cafc..1aa490e9a 100644 --- a/spark-rapids/mig.sh +++ b/spark-rapids/mig.sh @@ -26,6 +26,8 @@ set -euxo pipefail +readonly ROLE="$(/usr/share/google/get_metadata_value attributes/dataproc-role)" + function os_id() { grep '^ID=' /etc/os-release | cut -d= -f2 | xargs } @@ -535,6 +537,13 @@ function remove_old_backports { } function main() { + # Rebooting a master before Dataproc initialization completes causes its + # master-only services to be initialized twice. MIG is only needed on workers. + if [[ "${ROLE}" == "Master" ]]; then + echo "Skipping MIG setup and reboot on Dataproc master" + return + fi + if [[ ${OS_NAME} == debian ]] && [[ $(echo "${DATAPROC_IMAGE_VERSION} <= 2.1" | bc -l) == 1 ]]; then remove_old_backports fi From 8c5c5c3cd914369bc6220ebf13740efaef25f3b4 Mon Sep 17 00:00:00 2001 From: liyuan Date: Tue, 10 Nov 2026 14:08:45 +0800 Subject: [PATCH 5/7] spark-rapids: update fallback version to 26.10.0 Signed-off-by: liyuan --- spark-rapids/spark-rapids.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spark-rapids/spark-rapids.sh b/spark-rapids/spark-rapids.sh index 760f8259e..9df7bb8b2 100644 --- a/spark-rapids/spark-rapids.sh +++ b/spark-rapids/spark-rapids.sh @@ -367,7 +367,7 @@ else fi # Update SPARK RAPIDS config -readonly HARDCODED_RAPIDS_VERSION="26.08.1" +readonly HARDCODED_RAPIDS_VERSION="26.10.0" # 1. Try to get explicit version from GCE Metadata SPARK_RAPIDS_VERSION=$(get_metadata_attribute 'spark-rapids-version' '') From c2d164f8be49677e8f97c80fe4d96f19fd4b96b4 Mon Sep 17 00:00:00 2001 From: "C.J. Collier" Date: Wed, 18 Nov 2026 02:48:25 +0000 Subject: [PATCH 6/7] spark-rapids: add Debian 13 and Ubuntu 24 support to mig.sh Add Debian 13 (Trixie) and Ubuntu 24.04 support to `spark-rapids/mig.sh` to prepare for Dataproc 3.0 image certification and maintain feature parity with `spark-rapids.sh`: - Define `is_debian13()` and `is_ubuntu24()` helper functions. - Extend `add_contrib_components()` to configure deb822 sources (`/etc/apt/sources.list.d/debian.sources`) for Debian 13 as well as Debian 12 so `nvidia-kernel-open-dkms` dependencies resolve properly. - Include Debian 13 in the repository installation and driver pinning exception block to avoid kernel/module API incompatibilities. - Update `check_os_and_secure_boot()` to accept Debian 13 and Ubuntu 24. - Document in `main()` that single-node clusters (`ROLE=Master` with zero workers) bypass MIG configuration and reboot by design. Signed-off-by: C.J. Collier --- spark-rapids/mig.sh | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/spark-rapids/mig.sh b/spark-rapids/mig.sh index 1aa490e9a..abaa415f3 100644 --- a/spark-rapids/mig.sh +++ b/spark-rapids/mig.sh @@ -52,6 +52,10 @@ function is_debian12() { is_debian && [[ "$(os_version)" == '12'* ]] } +function is_debian13() { + is_debian && [[ "$(os_version)" == '13'* ]] +} + function is_ubuntu() { [[ "$(os_id)" == 'ubuntu' ]] } @@ -68,6 +72,10 @@ function is_ubuntu22() { is_ubuntu && [[ "$(os_version)" == '22.04'* ]] } +function is_ubuntu24() { + is_ubuntu && [[ "$(os_version)" == '24.04'* ]] +} + function is_rocky() { [[ "$(os_id)" == 'rocky' ]] } @@ -186,7 +194,7 @@ function add_contrib_components() { if ! is_debian ; then return fi - if is_debian12 ; then + if is_debian12 || is_debian13 ; then # Include in sources file components on which nvidia-open-kernel-dkms depends local -r debian_sources="/etc/apt/sources.list.d/debian.sources" local components="main contrib" @@ -219,12 +227,12 @@ NVIDIA_DRIVER_VERSION=$(get_metadata_attribute 'driver-version' '550.54.15') #53 CUDA_VERSION_MAJOR="${CUDA_VERSION%.*}" #12.2 # EXCEPTIONS -# Debian 12 security kernels use the four-argument pci_resize_resource API, +# Debian 12 security kernels and Debian 13 kernels use the four-argument pci_resize_resource API, # which is incompatible with NVIDIA 550 open modules. -if is_debian12 ; then +if is_debian12 || is_debian13 ; then NVIDIA_DRIVER_VERSION=$(get_metadata_attribute 'driver-version' '580.95.05') if [[ "${NVIDIA_DRIVER_VERSION%%.*}" == "550" ]]; then - echo "WARNING: Driver version 550 is incompatible with Debian 12 kernel. Overriding to 580.95.05" >&2 + echo "WARNING: Driver version 550 is incompatible with Debian 12/13 kernel. Overriding to 580.95.05" >&2 NVIDIA_DRIVER_VERSION='580.95.05' fi USE_REPO_INSTALL="true" @@ -488,12 +496,12 @@ function configure_mig_cgi() { # Verify if compatible linux distros and secure boot options are used function check_os_and_secure_boot() { if is_debian ; then - if ! is_debian10 && ! is_debian11 && ! is_debian12 ; then + if ! is_debian10 && ! is_debian11 && ! is_debian12 && ! is_debian13 ; then echo "Error: The Debian version ($(os_version)) is not supported. Please use a compatible Debian version." exit 1 fi elif is_ubuntu ; then - if ! is_ubuntu18 && ! is_ubuntu20 && ! is_ubuntu22 ; then + if ! is_ubuntu18 && ! is_ubuntu20 && ! is_ubuntu22 && ! is_ubuntu24 ; then echo "Error: The Ubuntu version ($(os_version)) is not supported. Please use a compatible Ubuntu version." exit 1 fi @@ -539,6 +547,8 @@ function remove_old_backports { function main() { # Rebooting a master before Dataproc initialization completes causes its # master-only services to be initialized twice. MIG is only needed on workers. + # Note: Single-node clusters (where ROLE=Master and primary workers=0) will + # skip MIG configuration by design. if [[ "${ROLE}" == "Master" ]]; then echo "Skipping MIG setup and reboot on Dataproc master" return From 16ba6ff7cd045464621e0d62561fea1b3133a107 Mon Sep 17 00:00:00 2001 From: liyuan Date: Wed, 18 Nov 2026 13:56:08 +0800 Subject: [PATCH 7/7] spark-rapids: fix Debian 13 MIG setup Signed-off-by: liyuan --- spark-rapids/mig.sh | 72 ++++++++++++++++++++++++++++++++++-- spark-rapids/spark-rapids.sh | 43 ++++++++++++++++++--- 2 files changed, 105 insertions(+), 10 deletions(-) diff --git a/spark-rapids/mig.sh b/spark-rapids/mig.sh index abaa415f3..8d9ec4ca9 100644 --- a/spark-rapids/mig.sh +++ b/spark-rapids/mig.sh @@ -104,6 +104,26 @@ function get_metadata_attribute() { /usr/share/google/get_metadata_value "attributes/${attribute_name}" || echo -n "${default_value}" } +REBOOT_FOR_CGROUP_V1=0 + +function configure_cgroup_v1_for_yarn_gpu_isolation() { + if ! is_debian13 || [[ ! -f /sys/fs/cgroup/cgroup.controllers ]]; then + return + fi + + # YARN's GPU isolation requires the cgroup v1 devices controller. Debian 13 + # defaults to cgroup v2, and systemd 257 requires both kernel parameters to + # temporarily enable its legacy hierarchy. + local -r cgroup_v1_params="systemd.unified_cgroup_hierarchy=0 SYSTEMD_CGROUP_ENABLE_LEGACY_FORCE=1" + if ! grep -q 'SYSTEMD_CGROUP_ENABLE_LEGACY_FORCE=1' /etc/default/grub; then + sed -i \ + "s|^GRUB_CMDLINE_LINUX_DEFAULT=\"\\(.*\\)\"|GRUB_CMDLINE_LINUX_DEFAULT=\"\\1 ${cgroup_v1_params}\"|" \ + /etc/default/grub + update-grub + fi + REBOOT_FOR_CGROUP_V1=1 +} + CA_TMPDIR="$(mktemp -u -d -p /run/tmp -t ca_dir-XXXX)" PSN="$(get_metadata_attribute private_secret_name)" readonly PSN @@ -227,23 +247,38 @@ NVIDIA_DRIVER_VERSION=$(get_metadata_attribute 'driver-version' '550.54.15') #53 CUDA_VERSION_MAJOR="${CUDA_VERSION%.*}" #12.2 # EXCEPTIONS -# Debian 12 security kernels and Debian 13 kernels use the four-argument pci_resize_resource API, +# Debian 12 security kernels use the four-argument pci_resize_resource API, # which is incompatible with NVIDIA 550 open modules. -if is_debian12 || is_debian13 ; then +if is_debian12 ; then NVIDIA_DRIVER_VERSION=$(get_metadata_attribute 'driver-version' '580.95.05') if [[ "${NVIDIA_DRIVER_VERSION%%.*}" == "550" ]]; then - echo "WARNING: Driver version 550 is incompatible with Debian 12/13 kernel. Overriding to 580.95.05" >&2 + echo "WARNING: Driver version 550 is incompatible with Debian 12 kernel. Overriding to 580.95.05" >&2 NVIDIA_DRIVER_VERSION='580.95.05' fi USE_REPO_INSTALL="true" +elif is_debian13 ; then + # The Debian 13 repository starts at driver 590 and CUDA 13. + CUDA_VERSION=$(get_metadata_attribute 'cuda-version' '13.0') + NVIDIA_DRIVER_VERSION=$(get_metadata_attribute 'driver-version' '590') + CUDA_VERSION_MAJOR="${CUDA_VERSION%.*}" + if [[ "${NVIDIA_DRIVER_VERSION%%.*}" -lt 590 ]]; then + echo "WARNING: Driver version ${NVIDIA_DRIVER_VERSION} is unavailable for Debian 13. Overriding to 590" >&2 + NVIDIA_DRIVER_VERSION='590' + fi + USE_REPO_INSTALL="true" fi -# Change CUDA version for Ubuntu 18 (Cuda 12.1.1 - Driver v530.30.02 is the latest version supported by Ubuntu 18) +# Change CUDA and driver versions for Ubuntu-specific repository availability. if [[ "${OS_NAME}" == "ubuntu" ]]; then if is_ubuntu18 ; then CUDA_VERSION=$(get_metadata_attribute 'cuda-version' '12.1.1') #12.1.1 NVIDIA_DRIVER_VERSION=$(get_metadata_attribute 'driver-version' '530.30.02') #530.30.02 CUDA_VERSION_MAJOR="${CUDA_VERSION%.*}" #12.1 + elif is_ubuntu24 ; then + CUDA_VERSION=$(get_metadata_attribute 'cuda-version' '12.6.0') + NVIDIA_DRIVER_VERSION=$(get_metadata_attribute 'driver-version' '580.95.05') + CUDA_VERSION_MAJOR="${CUDA_VERSION%.*}" + USE_REPO_INSTALL="true" fi fi @@ -423,6 +458,20 @@ function install_nvidia_gpu_driver() { -o cuda.run bash cuda.run --silent --toolkit --no-opengl-libs rm cuda.run + elif [[ "${USE_REPO_INSTALL:-false}" == "true" ]]; then + execute_with_retries \ + "curl -fsSL --retry-connrefused --retry 3 --retry-max-time 5 https://developer.download.nvidia.com/compute/cuda/repos/${shortname}/x86_64/cuda-keyring_1.1-1_all.deb -o /tmp/cuda-keyring_1.1-1_all.deb" + execute_with_retries "dpkg -i /tmp/cuda-keyring_1.1-1_all.deb" + rm -f /tmp/cuda-keyring_1.1-1_all.deb + execute_with_retries "apt-get update" + + execute_with_retries "apt-get install -y -q --no-install-recommends dkms" + configure_dkms_certs + for pkg in "nvidia-driver-${NVIDIA_DRIVER_VERSION_PREFIX}-open" \ + "cuda-toolkit-${CUDA_VERSION_MAJOR//./-}" ; do + execute_with_retries "apt-get install -y -q --no-install-recommends ${pkg}" + done + clear_dkms_key else # Install from repo provided by NV readonly UBUNTU_REPO_CUDA_PIN="${NVIDIA_REPO_URL}/cuda-${shortname}.pin" @@ -578,6 +627,7 @@ function main() { fi if (lspci | grep -q NVIDIA); then + configure_cgroup_v1_for_yarn_gpu_isolation if [[ $META_MIG_VALUE -ne 0 ]]; then # if the first invocation, the NVIDIA drivers and tools are not installed if [[ -f "/usr/bin/nvidia-smi" ]]; then @@ -586,6 +636,11 @@ function main() { NUM_GPUS_WITH_DIFF_MIG_MODES=`/usr/bin/nvidia-smi --query-gpu=mig.mode.current --format=csv,noheader | uniq | wc -l` if [[ $NUM_GPUS_WITH_DIFF_MIG_MODES -eq 1 ]]; then if (/usr/bin/nvidia-smi --query-gpu=mig.mode.current --format=csv,noheader | grep Enabled); then + if [[ $REBOOT_FOR_CGROUP_V1 -ne 0 ]]; then + echo "Rebooting to enable the cgroup v1 devices controller" + reboot + exit 0 + fi echo "MIG is enabled on all GPUs, configuring instances" configure_mig_cgi exit 0 @@ -611,6 +666,11 @@ function main() { if [[ ${META_MIG_VALUE} -ne 0 ]]; then enable_mig + if [[ $REBOOT_FOR_CGROUP_V1 -ne 0 ]]; then + echo "Rebooting to enable MIG and the cgroup v1 devices controller" + reboot + exit 0 + fi NUM_GPUS_WITH_DIFF_MIG_MODES=`/usr/bin/nvidia-smi --query-gpu=mig.mode.current --format=csv,noheader | uniq | wc -l` if [[ NUM_GPUS_WITH_DIFF_MIG_MODES -eq 1 ]]; then if (/usr/bin/nvidia-smi --query-gpu=mig.mode.current --format=csv,noheader | grep Enabled); then @@ -626,6 +686,10 @@ function main() { fi else echo "Not enabling MIG" + if [[ $REBOOT_FOR_CGROUP_V1 -ne 0 ]]; then + echo "Rebooting to enable the cgroup v1 devices controller" + reboot + fi fi fi } diff --git a/spark-rapids/spark-rapids.sh b/spark-rapids/spark-rapids.sh index 9df7bb8b2..310f792d1 100644 --- a/spark-rapids/spark-rapids.sh +++ b/spark-rapids/spark-rapids.sh @@ -45,6 +45,14 @@ function is_debian12() { is_debian && [[ "$(os_version)" == '12'* ]] } +function is_debian13() { + is_debian && [[ "$(os_version)" == '13'* ]] +} + +function is_cgroup_v2() { + [[ -f /sys/fs/cgroup/cgroup.controllers ]] +} + function is_ubuntu() { [[ "$(os_id)" == 'ubuntu' ]] } @@ -312,11 +320,11 @@ function configure_dkms_certs() { function clear_dkms_key { if [[ -z "${PSN}" ]]; then - echo "No signing secret provided. skipping" >2 + echo "No signing secret provided. skipping" >&2 return 0 fi - echo "WARN -- PURGING SIGNING MATERIAL -- WARN" >2 - echo "future dkms runs will not use correct signing key" >2 + echo "WARN -- PURGING SIGNING MATERIAL -- WARN" >&2 + echo "future dkms runs will not use correct signing key" >&2 rm -rf "${CA_TMPDIR}" /var/lib/dkms/mok.key /var/lib/shim-signed/mok/MOK.priv } @@ -324,7 +332,7 @@ function add_contrib_components() { if ! is_debian ; then return fi - if is_debian12 ; then + if is_debian12 || is_debian13 ; then # Include in sources file components on which nvidia-open-kernel-dkms depends local -r debian_sources="/etc/apt/sources.list.d/debian.sources" local components="main contrib" @@ -426,6 +434,16 @@ if is_debian12 ; then NVIDIA_DRIVER_VERSION='580.95.05' fi USE_REPO_INSTALL="true" +elif is_debian13 ; then + # The Debian 13 repository starts at driver 590 and CUDA 13. + CUDA_VERSION=$(get_metadata_attribute 'cuda-version' '13.0') + NVIDIA_DRIVER_VERSION=$(get_metadata_attribute 'driver-version' '590') + CUDA_VERSION_MAJOR="${CUDA_VERSION%.*}" + if [[ "${NVIDIA_DRIVER_VERSION%%.*}" -lt 590 ]]; then + echo "WARNING: Driver version ${NVIDIA_DRIVER_VERSION} is unavailable for Debian 13. Overriding to 590" >&2 + NVIDIA_DRIVER_VERSION='590' + fi + USE_REPO_INSTALL="true" fi # Change CUDA version for Ubuntu 18 (Cuda 12.1.1 - Driver v530.30.02 is the latest version supported by Ubuntu 18) @@ -663,6 +681,7 @@ function install_nvidia_gpu_driver() { "curl -fsSL --retry-connrefused --retry 3 --retry-max-time 5 https://developer.download.nvidia.com/compute/cuda/repos/${shortname}/x86_64/cuda-keyring_1.1-1_all.deb -o /tmp/cuda-keyring_1.1-1_all.deb" execute_with_retries "dpkg -i /tmp/cuda-keyring_1.1-1_all.deb" rm -f /tmp/cuda-keyring_1.1-1_all.deb + add_contrib_components execute_with_retries "apt-get update" execute_with_retries "apt-get install -y -q --no-install-recommends dkms" @@ -978,6 +997,14 @@ function configure_yarn_nodemanager() { 'yarn.nodemanager.resource-plugins.gpu.allowed-gpu-devices' 'auto' set_hadoop_property 'yarn-site.xml' \ 'yarn.nodemanager.resource-plugins.gpu.path-to-discovery-executables' $NVIDIA_SMI_PATH + + # YARN's GPU isolation requires the cgroup v1 devices controller, which is + # not available with the unified cgroup v2 hierarchy. + if is_cgroup_v2; then + echo "WARNING: cgroup v2 detected; configuring GPU scheduling without cgroup device isolation." >&2 + return + fi + set_hadoop_property 'yarn-site.xml' \ 'yarn.nodemanager.linux-container-executor.cgroups.mount' 'true' set_hadoop_property 'yarn-site.xml' \ @@ -1048,6 +1075,10 @@ echo {\"name\": \"gpu\", \"addresses\":[\"$ADDRS\"]} } function configure_gpu_isolation() { + if is_cgroup_v2; then + return + fi + # enable GPU isolation sed -i "s/yarn\.nodemanager\.linux\-container\-executor\.group\=.*$/yarn\.nodemanager\.linux\-container\-executor\.group\=yarn/g" "${HADOOP_CONF_DIR}/container-executor.cfg" if [[ $IS_MIG_ENABLED -ne 0 ]]; then @@ -1065,7 +1096,7 @@ function configure_gpu_isolation() { Description=Set permissions to allow YARN to access device directories [Service] -ExecStart=/bin/bash -c "chmod a+rwx -R /sys/fs/cgroup/cpu,cpuacct; chmod a+rwx -R /sys/fs/cgroup/devices" +ExecStart=/bin/bash -c "if [[ -d /sys/fs/cgroup/cpu,cpuacct ]]; then chmod a+rwx -R /sys/fs/cgroup/cpu,cpuacct; fi; if [[ -d /sys/fs/cgroup/devices ]]; then chmod a+rwx -R /sys/fs/cgroup/devices; fi" [Install] WantedBy=multi-user.target @@ -1147,7 +1178,7 @@ function setup_gpu_yarn() { # Verify if compatible linux distros and secure boot options are used function check_os_and_secure_boot() { if is_debian ; then - if ! is_debian10 && ! is_debian11 && ! is_debian12 ; then + if ! is_debian10 && ! is_debian11 && ! is_debian12 && ! is_debian13 ; then echo "Error: The Debian version ($(os_version)) is not supported. Please use a compatible Debian version." exit 1 fi