@@ -384,6 +384,52 @@ function cmd_install {
384384 log_info " Docker installation complete"
385385 fi
386386
387+ # Install NVIDIA Container Toolkit for GPU support
388+ if [ " $OS " = " ubuntu" ] || [ " $OS " = " debian" ]; then
389+ log_info " Installing NVIDIA Container Toolkit..."
390+
391+ # Install prerequisites
392+ log_info " Installing prerequisites for NVIDIA Container Toolkit..."
393+ sudo apt-get update && sudo apt-get install -y --no-install-recommends \
394+ curl \
395+ gnupg2
396+
397+ # Configure the production repository
398+ log_info " Configuring NVIDIA Container Toolkit repository..."
399+ curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
400+ && curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
401+ sed ' s#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
402+ sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list > /dev/null
403+
404+ # Update the packages list from the repository
405+ log_info " Updating package list..."
406+ sudo apt-get update
407+
408+ # Install the NVIDIA Container Toolkit packages
409+ log_info " Installing NVIDIA Container Toolkit packages..."
410+ export NVIDIA_CONTAINER_TOOLKIT_VERSION=1.18.1-1
411+ sudo apt-get install -y \
412+ nvidia-container-toolkit=${NVIDIA_CONTAINER_TOOLKIT_VERSION} \
413+ nvidia-container-toolkit-base=${NVIDIA_CONTAINER_TOOLKIT_VERSION} \
414+ libnvidia-container-tools=${NVIDIA_CONTAINER_TOOLKIT_VERSION} \
415+ libnvidia-container1=${NVIDIA_CONTAINER_TOOLKIT_VERSION}
416+
417+ # Configure Docker to use NVIDIA runtime
418+ log_info " Configuring Docker to use NVIDIA runtime..."
419+ sudo nvidia-ctk runtime configure --runtime=docker
420+
421+ # Restart Docker service to apply changes
422+ if systemctl is-active --quiet docker; then
423+ log_info " Restarting Docker service to apply NVIDIA runtime configuration..."
424+ sudo systemctl restart docker
425+ fi
426+
427+ log_info " NVIDIA Container Toolkit installation complete"
428+ else
429+ log_warn " NVIDIA Container Toolkit installation is only supported on Ubuntu/Debian systems"
430+ log_info " For other systems, please install manually: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html"
431+ fi
432+
387433 # Install Docker Compose if needed
388434 if ! command -v docker compose & > /dev/null && [ " $force " = false ]; then
389435 log_info " Installing Docker Compose..."
0 commit comments