-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathcuda-builder.cf
More file actions
43 lines (37 loc) · 1.35 KB
/
cuda-builder.cf
File metadata and controls
43 lines (37 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# syntax=docker/dockerfile:1.7
# Pristine CUDA builder image:
# - Based on NVIDIA CUDA devel (Ubuntu 22.04)
# - Installs toolchain and Rust
# - No source copied, no build performed
# Use this image in CI to mount your workspace and build artifacts.
ARG CUDA_TAG=12.9.0
FROM nvcr.io/nvidia/cuda:${CUDA_TAG}-devel-ubuntu22.04
ARG CUDA_TAG
ENV CUDA_TAG=${CUDA_TAG}
# System dependencies for building Rust/CUDA projects
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
ca-certificates \
pkg-config \
build-essential \
libssl-dev \
git \
clang \
cmake \
&& rm -rf /var/lib/apt/lists/*
# Install Rust (stable, minimal profile)
ENV RUSTUP_HOME=/opt/rustup \
CARGO_HOME=/opt/cargo \
CUDA_HOME=/usr/local/cuda \
CARGO_TERM_COLOR=always \
PATH=/opt/cargo/bin:/usr/local/cuda/bin:${PATH}
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
| sh -s -- -y --profile minimal --default-toolchain stable && \
rustc --version && cargo --version
# Working directory for consumers (CI jobs mount source here)
WORKDIR /workspace
# Notes:
# - CI should use this image as a base and run cargo build inside the workspace.
# - Optional environment knobs like CUDA_ARCH, MINER_CUDA_ALLOW_UNSUPPORTED_COMPILER,
# MINER_NVCC_CCBIN can be provided at runtime as needed.