Skip to content

Commit 2946b23

Browse files
authored
conda: Add CUDA_HOME, cuda binaries to path (#1224)
1 parent 5770ed3 commit 2946b23

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

conda/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,12 @@ RUN bash ./install_conda.sh && rm install_conda.sh
4141

4242
# Install CUDA
4343
FROM base as cuda
44+
ARG CUDA_VERSION=10.2
4445
RUN rm -rf /usr/local/cuda-*
4546
ADD ./common/install_cuda.sh install_cuda.sh
47+
ENV CUDA_HOME=/usr/local/cuda-${CUDA_VERSION}
48+
# Make things in our path by default
49+
ENV PATH=/usr/local/cuda-${CUDA_VERSION}/bin:$PATH
4650

4751
FROM cuda as cuda11.6
4852
RUN bash ./install_cuda.sh 11.6

conda/build_docker.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ if [[ "${DOCKER_TAG}" =~ ^cuda* ]]; then
5252
set -x
5353
docker tag ${DOCKER_IMAGE} "pytorch/conda-builder:cuda${CUDA_VERSION/./}"
5454
)
55+
# Test that we're using the right CUDA compiler
56+
(
57+
set -x
58+
docker run --rm "${DOCKER_IMAGE}" nvcc --version | grep "cuda_${CUDA_VERSION}"
59+
)
5560
fi
5661

5762
if [[ -n ${GITHUB_REF} ]]; then

0 commit comments

Comments
 (0)