|
| 1 | +FROM nvidia/cuda:13.1.0-devel-ubuntu24.04 |
| 2 | + |
| 3 | +ENV DEBIAN_FRONTEND=noninteractive |
| 4 | + |
| 5 | +USER root |
| 6 | + |
| 7 | +# Configure LLVM nightly repo |
| 8 | +RUN apt-get update -qq && apt-get install --no-install-recommends -yqq curl ca-certificates |
| 9 | +RUN curl -sSL https://apt.llvm.org/llvm-snapshot.gpg.key -o /etc/apt/trusted.gpg.d/apt.llvm.org.asc |
| 10 | +RUN echo 'deb http://apt.llvm.org/noble/ llvm-toolchain-noble main' > /etc/apt/sources.list.d/llvm.list |
| 11 | +RUN echo 'deb http://apt.llvm.org/noble/ llvm-toolchain-noble-22 main' > /etc/apt/sources.list.d/llvm.list |
| 12 | + |
| 13 | +# Install SYCL prerequisites |
| 14 | +COPY scripts/install_build_tools.sh /install.sh |
| 15 | +RUN /install.sh |
| 16 | + |
| 17 | +COPY scripts/install_vulkan.sh /install_vulkan.sh |
| 18 | +RUN /install_vulkan.sh |
| 19 | + |
| 20 | +# libzstd-dev installed by default on Ubuntu 24.04 is not compiled with -fPIC flag. |
| 21 | +# This causes linking errors when building SYCL runtime. |
| 22 | +# Bug: https://github.com/intel/llvm/issues/15935 |
| 23 | +# Workaround: build zstd from sources with -fPIC flag. |
| 24 | +COPY scripts/build_zstd.sh /build_zstd.sh |
| 25 | +RUN /build_zstd.sh |
| 26 | + |
| 27 | +SHELL ["/bin/bash", "-ec"] |
| 28 | + |
| 29 | +# Make the directory if it doesn't exist yet. |
| 30 | +# This location is recommended by the distribution maintainers. |
| 31 | +RUN mkdir --parents --mode=0755 /etc/apt/keyrings |
| 32 | +# Download the key, convert the signing-key to a full |
| 33 | +# keyring required by apt and store in the keyring directory |
| 34 | +RUN curl -sSL https://repo.radeon.com/rocm/rocm.gpg.key | \ |
| 35 | +gpg --dearmor | tee /etc/apt/keyrings/rocm.gpg > /dev/null && \ |
| 36 | +# Add rocm repo |
| 37 | +echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/amdgpu/6.3/ubuntu noble main" \ |
| 38 | + | tee /etc/apt/sources.list.d/amdgpu.list && \ |
| 39 | +echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/6.3 noble main" \ |
| 40 | + | tee --append /etc/apt/sources.list.d/rocm.list && \ |
| 41 | +echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' \ |
| 42 | + | tee /etc/apt/preferences.d/rocm-pin-600 && \ |
| 43 | +echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' \ |
| 44 | + | tee /etc/apt/preferences.d/rocm-pin-600 |
| 45 | +# Install the ROCM kernel driver |
| 46 | +RUN apt update && apt install -yqq rocm-dev && \ |
| 47 | + apt-get clean && \ |
| 48 | + rm -rf /var/lib/apt/lists/* |
| 49 | + |
| 50 | +# Fix Vulkan install inside container |
| 51 | +# https://stackoverflow.com/questions/74965945/vulkan-is-unable-to-detect-nvidia-gpu-from-within-a-docker-container-when-using |
| 52 | +RUN apt-get update && \ |
| 53 | + apt-get install -y libegl1 && \ |
| 54 | + apt-get install -y --no-install-recommends --download-only libnvidia-gl-565 && \ |
| 55 | + dpkg-deb --extract /var/cache/apt/archives/libnvidia-gl-565_*.deb extracted && \ |
| 56 | + cp -R ./extracted/usr/* /usr/ && \ |
| 57 | + rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*.deb ./extracted |
| 58 | + |
| 59 | +COPY scripts/create-sycl-user.sh /user-setup.sh |
| 60 | +RUN /user-setup.sh |
| 61 | + |
| 62 | +COPY scripts/docker_entrypoint.sh /docker_entrypoint.sh |
| 63 | + |
| 64 | +COPY actions/cached_checkout /actions/cached_checkout |
| 65 | +COPY actions/cleanup /actions/cleanup |
| 66 | +COPY scripts/install_drivers.sh /opt/install_drivers.sh |
| 67 | + |
| 68 | +USER sycl |
| 69 | + |
| 70 | +ENTRYPOINT ["/docker_entrypoint.sh"] |
| 71 | + |
0 commit comments