From 559c046ab29e86e5940c7897ed837637bb018e72 Mon Sep 17 00:00:00 2001 From: Wesley Maxey Date: Wed, 14 Oct 2026 22:20:03 +0000 Subject: [PATCH 1/4] Fix main devcontainer startup issues --- .devcontainer/main/devcontainer.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.devcontainer/main/devcontainer.json b/.devcontainer/main/devcontainer.json index a1bde8f19..81912d870 100644 --- a/.devcontainer/main/devcontainer.json +++ b/.devcontainer/main/devcontainer.json @@ -1,5 +1,5 @@ { - "image": "mcr.microsoft.com/devcontainers/javascript-node:0-18", + "image": "mcr.microsoft.com/devcontainers/javascript-node:24", "customizations": { "vscode": { "extensions": [ @@ -8,7 +8,9 @@ } }, "features": { - "ghcr.io/devcontainers/features/docker-in-docker:2": {} + "ghcr.io/devcontainers/features/docker-in-docker:4.1.3": { + "moby": false + } }, "remoteUser": "node", "updateContentCommand": "sudo apt update && sudo apt install -y bash-completion && npm i -g @devcontainers/cli" From 330d018c6ab82beab57072f3c5b75d6883c36743 Mon Sep 17 00:00:00 2001 From: Wesley Maxey Date: Wed, 14 Oct 2026 22:21:37 +0000 Subject: [PATCH 2/4] Add a setup script and installer bits for cuda-compat --- features/src/cuda/README.md | 1 + features/src/cuda/devcontainer-feature.json | 7 +++- features/src/cuda/install.sh | 17 ++++++++ features/src/cuda/setup-cuda-compat.sh | 45 +++++++++++++++++++++ 4 files changed, 69 insertions(+), 1 deletion(-) create mode 100755 features/src/cuda/setup-cuda-compat.sh diff --git a/features/src/cuda/README.md b/features/src/cuda/README.md index 340bc2d8f..f398f6d7b 100644 --- a/features/src/cuda/README.md +++ b/features/src/cuda/README.md @@ -26,6 +26,7 @@ A feature to install the NVIDIA CUDA Toolkit | installcuTensor | Install CUDA Tensor Linear Algebra Library (cuTensor) | boolean | false | | installNCCL | Install NVIDIA Collective Communications Library (NCCL) | boolean | true | | installCUDARuntime | Install CUDA Runtime Library (cudart) | boolean | true | +| installCudaCompat | Install CUDA Compatibility Package (cuda-compat) | boolean | false | | installNVRTC | Install NVIDIA Runtime Compilation Library (NVRTC) | boolean | false | | installOpenCL | Install NVIDIA CUDA OpenCL Library | boolean | false | | installcuBLAS | Install CUDA Basic Linear Algebra Library (cuBLAS) | boolean | false | diff --git a/features/src/cuda/devcontainer-feature.json b/features/src/cuda/devcontainer-feature.json index 795b35146..ff37b2e22 100644 --- a/features/src/cuda/devcontainer-feature.json +++ b/features/src/cuda/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "CUDA Toolkit", "id": "cuda", - "version": "26.12.1", + "version": "26.12.2", "description": "A feature to install the NVIDIA CUDA Toolkit", "options": { "version": { @@ -86,6 +86,11 @@ "default": true, "description": "Install CUDA Runtime Library (cudart)" }, + "installCudaCompat": { + "type": "boolean", + "default": false, + "description": "Install CUDA Compatibility Package (cuda-compat)" + }, "installNVRTC": { "type": "boolean", "default": false, diff --git a/features/src/cuda/install.sh b/features/src/cuda/install.sh index 3832001fa..beca08050 100644 --- a/features/src/cuda/install.sh +++ b/features/src/cuda/install.sh @@ -201,6 +201,10 @@ if "${INSTALLCUDSS:-false}"; then PKGS+=("cudss-cuda-${cuda_ver_major}"); fi +if [ "${INSTALLCUDACOMPAT:-false}" = true ]; then + PKGS+=("cuda-compat-${cuda_ver}"); +fi + if [ "${INSTALLNCCL:-false}" = true ] \ && test -n "$(apt-cache search libnccl2 2>/dev/null)" \ && apt-cache policy libnccl2 2>/dev/null | grep -q "+${cuda_tag}"; then @@ -270,6 +274,15 @@ export CUDA_VERSION_MAJOR; export CUDA_VERSION_MINOR; export CUDA_VERSION_PATCH; +# Track whether the cuda-compat forward compatibility package was +# installed, so container entrypoints (via setup-cuda-compat) can decide +# whether to configure the system to use it. +CUDA_COMPAT_INSTALLED="false"; +if [ "${INSTALLCUDACOMPAT:-false}" = true ]; then + CUDA_COMPAT_INSTALLED="true"; +fi +export CUDA_COMPAT_INSTALLED; + if [ "${INSTALLCUTENSOR:-false}" = true ]; then # Remove extra libcutensor versions source ./prune-extra-cutensor-libs.sh; @@ -282,6 +295,7 @@ vars_+=('$CUDA_VERSION'); vars_+=('$CUDA_VERSION_MAJOR'); vars_+=('$CUDA_VERSION_MINOR'); vars_+=('$CUDA_VERSION_PATCH'); +vars_+=('$CUDA_COMPAT_INSTALLED'); printf -v vars_ '%s,' "${vars_[@]}"; # export envvars in bashrc files @@ -296,6 +310,9 @@ cat < /etc/ld.so.conf.d/nvidia.conf /usr/local/nvidia/lib64 EOF +# Install the cuda-compat setup script for use by container entrypoints. +install -m 0755 setup-cuda-compat.sh /usr/local/bin/setup-cuda-compat; + # Clean up # rm -rf /tmp/*; rm -rf /var/tmp/*; diff --git a/features/src/cuda/setup-cuda-compat.sh b/features/src/cuda/setup-cuda-compat.sh new file mode 100755 index 000000000..b0a77f10f --- /dev/null +++ b/features/src/cuda/setup-cuda-compat.sh @@ -0,0 +1,45 @@ +#! /usr/bin/env bash + +# Configures the system to use the CUDA forward compatibility libraries +# (cuda-compat) in preference to the host driver libraries. +# +# This script is installed into the image by the `cuda` feature and is +# intended to be invoked from container entrypoints. It is a no-op unless +# the feature was installed with `installCudaCompat: true`, which sets +# CUDA_COMPAT_INSTALLED=true in the container environment. + +set -euo pipefail; + +# Only configure the system if cuda-compat was installed by the cuda feature. +if [ "${CUDA_COMPAT_INSTALLED:-false}" != "true" ]; then + exit 0; +fi + +# WSL hosts pass the Windows driver through to containers, so the compat +# libraries are unnecessary there. +if grep -qi microsoft /proc/version 2>/dev/null; then + echo "WSL host detected, skipping cuda-compat configuration."; + exit 0; +fi + +compat_dir="${CUDA_HOME:-/usr/local/cuda}/compat"; + +if [ ! -d "${compat_dir}" ]; then + echo "CUDA_COMPAT_INSTALLED is true, but '${compat_dir}' does not exist." >&2; + exit 1; +fi + +# Run privileged commands via sudo unless already running as root. +if [ "$(id -u)" = 0 ]; then + as_root() { "$@"; }; +else + as_root() { sudo "$@"; }; +fi + +# Point the dynamic linker at the compat libraries so they take precedence +# over the host driver libs. The conf file sorts before the system library +# dirs in ldconfig's search order, giving the compat libs precedence. +as_root tee /etc/ld.so.conf.d/cuda-compat.conf <<< "${compat_dir}" > /dev/null; +as_root ldconfig; + +echo "cuda-compat forward compatibility libraries configured from '${compat_dir}'."; From 1b6a5c8fa0e5c69e46d9dae56a9d8d4b09c0502c Mon Sep 17 00:00:00 2001 From: Wesley Maxey Date: Wed, 14 Oct 2026 22:50:09 +0000 Subject: [PATCH 3/4] Update matrix to enable installing cuda-compat in 13.4 images --- matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matrix.yml b/matrix.yml index 3de9d60d9..3d04ee10f 100644 --- a/matrix.yml +++ b/matrix.yml @@ -1,7 +1,7 @@ x-cuda-prev-min: &cuda_prev_min { name: "cuda", version: "12.0" } x-cuda-prev-max: &cuda_prev_max { name: "cuda", version: "12.9" } x-cuda-curr-min: &cuda_curr_min { name: "cuda", version: "13.0" } -x-cuda-curr-max: &cuda_curr_max { name: "cuda", version: "13.4" } +x-cuda-curr-max: &cuda_curr_max { name: "cuda", version: "13.4", installCudaCompat: true } x-cuda-prev-max-rapids: &cuda_prev_max_rapids { name: "cuda", version: "12.9" } x-cuda-curr-max-rapids: &cuda_curr_max_rapids { name: "cuda", version: "13.3" } From 5b41902c74129e25ab36ef846afa7ed4d1e85343 Mon Sep 17 00:00:00 2001 From: Wesley Maxey Date: Wed, 14 Oct 2026 22:56:52 +0000 Subject: [PATCH 4/4] Fix exporting the CUDA_COMPAT_INSTALLED flag --- features/src/cuda/.bashrc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/features/src/cuda/.bashrc b/features/src/cuda/.bashrc index b059c702b..82fc8af92 100644 --- a/features/src/cuda/.bashrc +++ b/features/src/cuda/.bashrc @@ -5,6 +5,7 @@ __cuda_version="${CUDA_VERSION:-${CUDA_VERSION}}"; __cuda_version_major="${CUDA_VERSION_MAJOR:-${CUDA_VERSION_MAJOR}}"; __cuda_version_minor="${CUDA_VERSION_MINOR:-${CUDA_VERSION_MINOR}}"; __cuda_version_patch="${CUDA_VERSION_PATCH:-${CUDA_VERSION_PATCH}}"; +__cuda_compat_installed="${CUDA_COMPAT_INSTALLED:-${CUDA_COMPAT_INSTALLED}}"; export NVARCH="${__nvarch}"; export CUDA_HOME="${__cuda_home}"; @@ -13,6 +14,7 @@ export CUDA_VERSION="${__cuda_version}"; export CUDA_VERSION_MAJOR="${__cuda_version_major}"; export CUDA_VERSION_MINOR="${__cuda_version_minor}"; export CUDA_VERSION_PATCH="${__cuda_version_patch}"; +export CUDA_COMPAT_INSTALLED="${__cuda_compat_installed}"; if [ -n "${PATH##*"/usr/local/nvidia/bin:${__cuda_home}/bin"*}" ]; then export PATH="/usr/local/nvidia/bin:${__cuda_home}/bin:${PATH}"; @@ -28,4 +30,4 @@ if [ -z "${LD_LIBRARY_PATH:-}" ] \ export LD_LIBRARY_PATH="/usr/local/nvidia/lib:/usr/local/nvidia/lib64${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" fi -unset __nvarch __cuda_home __cuda_path __cuda_version __cuda_version_major __cuda_version_minor __cuda_version_patch +unset __nvarch __cuda_home __cuda_path __cuda_version __cuda_version_major __cuda_version_minor __cuda_version_patch __cuda_compat_installed