Skip to content

chore(docker): add support for multiple Linux distributions and CUDA versions #176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 24, 2025

Conversation

adamcavendish
Copy link
Contributor

Motivation

This PR refactors the Docker setup to support multiple Linux distributions and CUDA versions, replacing the previous Ubuntu 18.04-specific configuration. New Dockerfiles are added for Ubuntu 20.04, Ubuntu 24.04, and Rocky Linux 9, each paired with CUDA 11 and 12. The build process now handles distribution-specific package managers and dependencies to ensure compatibility.

Key Changes

  1. Dockerfile Refactoring
  • Removed: The original Dockerfile (Ubuntu 18.04 + CUDA 11.4).
  • Added: Four new Dockerfiles in the container directory:
    • ubuntu20-cuda11: Ubuntu 20.04 with CUDA 11.2 (11.2 is used to align with the CI)
    • ubuntu20-cuda12: Ubuntu 20.04 with CUDA 12.8
    • ubuntu24-cuda12: Ubuntu 24.04 with CUDA 12.8
    • rockylinux9-cuda12: Rocky Linux 9 with CUDA 12.8
  • Changes:
    • Distribution-specific package installation (e.g., apt-get for Ubuntu, dnf for Rocky Linux).
    • Custom handling of LLVM 7 dependencies and libffi compatibility for each OS.
    • Rust installation and environment setup standardized across all Dockerfiles.
  1. Build Script Adjustments
  • build.rs update in crates/rustc_codegen_nvvm:
    • Previously there are undefined symbols when running tests in here because LLVM config thinks that linking to the LLVM shared libraries will automatically provide transitive dependencies to these system dependencies.
    • Use static vs. shared flag to ensure llvm-config is giving us correct flags.
  1. Documentation Updates
  • README.md:
    • Added a section "Use Rust-CUDA in Container Environments" with usage instructions.
    • Clarified how to build and run containers for each distribution/CUDA version pair.

…versions

The Docker setup has been refactored to support Ubuntu 20.04, 24.04, and
Rocky Linux 9 with CUDA 11/12. The original Dockerfile (Ubuntu 18.04 +
CUDA 11.4) has been replaced with a matrix of distribution-specific
Dockerfiles. Dependencies like LLVM 7 and Rust are now configured to
work across these environments.
@adamcavendish
Copy link
Contributor Author

@LegNeato @jorge-ortega Please help review when you are available. Thanks.

@LegNeato
Copy link
Contributor

Awesome! I think this is strictly better than what is there so let's land and iterate. Thanks for the PR 🍻

@LegNeato LegNeato merged commit 7eb199c into Rust-GPU:main Mar 24, 2025
4 checks passed
@adamcavendish adamcavendish deleted the chore/docker-matrix branch March 25, 2025 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants