Skip to content

Commit 1593d56

Browse files
authored
docker : support specifying the GCC version for CUDA (#24447)
1 parent 4c65955 commit 1593d56

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

.devops/cuda.Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
ARG UBUNTU_VERSION=24.04
22
# This needs to generally match the container host's environment.
33
ARG CUDA_VERSION=12.8.1
4+
ARG GCC_VERSION=14
45
# Target the CUDA build image
56
ARG BASE_CUDA_DEV_CONTAINER=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION}
67

@@ -12,13 +13,14 @@ ARG APP_REVISION=N/A
1213

1314
FROM ${BASE_CUDA_DEV_CONTAINER} AS build
1415

16+
ARG GCC_VERSION
1517
# CUDA architecture to build for (defaults to all supported archs)
1618
ARG CUDA_DOCKER_ARCH=default
1719

1820
RUN apt-get update && \
19-
apt-get install -y gcc-14 g++-14 build-essential cmake python3 python3-pip git libssl-dev libgomp1
21+
apt-get install -y gcc-${GCC_VERSION} g++-${GCC_VERSION} build-essential cmake python3 python3-pip git libssl-dev libgomp1
2022

21-
ENV CC=gcc-14 CXX=g++-14 CUDAHOSTCXX=g++-14
23+
ENV CC=gcc-${GCC_VERSION} CXX=g++-${GCC_VERSION} CUDAHOSTCXX=g++-${GCC_VERSION}
2224

2325
WORKDIR /app
2426

0 commit comments

Comments
 (0)