Skip to content

Commit 0be5cc4

Browse files
committed
m105 contains multiple cuda versions, select the one we are building against
1 parent 4a71401 commit 0be5cc4

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

Dockerfile.tmpl

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ ARG CUDA_MAJOR_VERSION
2525
ARG CUDA_MINOR_VERSION
2626
ENV CUDA_MAJOR_VERSION=${CUDA_MAJOR_VERSION}
2727
ENV CUDA_MINOR_VERSION=${CUDA_MINOR_VERSION}
28+
# Make sure we are on the right version of CUDA
29+
RUN update-alternatives --set cuda /usr/local/cuda-$CUDA_MAJOR_VERSION.$CUDA_MINOR_VERSION
2830
# NVIDIA binaries from the host are mounted to /opt/bin.
2931
ENV PATH=/opt/bin:${PATH}
3032
# Add CUDA stubs to LD_LIBRARY_PATH to support building the GPU image on a CPU machine.

Jenkinsfile

+6-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@ pipeline {
5252
set -exo pipefail
5353
source config.txt
5454
cd packages/
55-
./build_package --base-image $BASE_IMAGE_REPO/$GPU_BASE_IMAGE_NAME:$BASE_IMAGE_TAG --package lightgbm --version $LIGHTGBM_VERSION --push
55+
./build_package --base-image $BASE_IMAGE_REPO/$GPU_BASE_IMAGE_NAME:$BASE_IMAGE_TAG \
56+
--package lightgbm \
57+
--version $LIGHTGBM_VERSION \
58+
--build-arg CUDA_MAJOR_VERSION=$CUDA_MAJOR_VERSION \
59+
--build-arg CUDA_MINOR_VERSION=$CUDA_MINOR_VERSION \
60+
--push
5661
'''
5762
}
5863
}

packages/lightgbm.Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ ARG BASE_IMAGE
33
FROM ${BASE_IMAGE} AS builder
44

55
ARG PACKAGE_VERSION
6+
ARG CUDA_MAJOR_VERSION
7+
ARG CUDA_MINOR_VERSION
8+
9+
# Make sure we are on the right version of CUDA
10+
RUN update-alternatives --set cuda /usr/local/cuda-$CUDA_MAJOR_VERSION.$CUDA_MINOR_VERSION
611

712
# Build instructions: https://lightgbm.readthedocs.io/en/latest/GPU-Tutorial.html#build-lightgbm
813
RUN apt-get update && \

packages/torch.Dockerfile

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ ARG TORCHVISION_VERSION
99
ARG CUDA_MAJOR_VERSION
1010
ARG CUDA_MINOR_VERSION
1111

12+
# Make sure we are on the right version of CUDA
13+
RUN update-alternatives --set cuda /usr/local/cuda-$CUDA_MAJOR_VERSION.$CUDA_MINOR_VERSION
14+
1215
# TORCHVISION_VERSION is mandatory
1316
RUN test -n "$TORCHVISION_VERSION"
1417

0 commit comments

Comments
 (0)