@@ -335,8 +335,9 @@ RUN if [ -f /tmp/.GPU_build ]; \
335335ARG CTO_TORCH=1.11
336336RUN mkdir -p /usr/local/src \
337337 && cd /usr/local/src \
338- && git clone --depth 1 --branch release/ ${CTO_TORCH} https://github.com/pytorch/pytorch.git \
338+ && git clone --depth 1 --branch v ${CTO_TORCH} https://github.com/pytorch/pytorch.git \
339339 && cd /usr/local/src/pytorch \
340+ && git submodule sync && git submodule update --init --recursive \
340341 && if [ -f /tmp/.GPU_build ]; \
341342 then \
342343 time env USE_CUDA=ON USE_CUDNN=ON TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0 7.5 8.0 8.6+PTX" USE_MKLDNN=ON USE_FFMPEG=ON USE_OPENCV=ON python3 ./setup.py bdist_wheel | tee /tmp/torch_config.txt; \
@@ -351,12 +352,23 @@ RUN mkdir -p /usr/local/src \
351352 && rm -rf /root/.cache/pip /usr/local/src/pytorch
352353RUN python3 -c "import torch"
353354
355+ ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH
356+ ENV NVIDIA_VISIBLE_DEVICES all
357+ ENV NVIDIA_DRIVER_CAPABILITIES video,compute,utility
358+
354359ARG CTO_TORCHVISION=0.12
355360RUN mkdir -p /usr/local/src \
356361 && cd /usr/local/src \
357- && git clone --depth 1 --branch release/ ${CTO_TORCHVISION} https://github.com/pytorch/vision.git \
362+ && git clone --depth 1 --branch v ${CTO_TORCHVISION} https://github.com/pytorch/vision.git \
358363 && cd /usr/local/src/vision \
359- && time sh -c "python3 ./setup.py bdist_wheel | tee /tmp/torchvision_config.txt" \
364+ && git submodule sync && git submodule update --init --recursive \
365+ && if [ -f /tmp/.GPU_build ]; \
366+ then \
367+ time env FORCE_CUDA=ON CUDA_HOME=/usr/local/nvidia USE_CUDNN=ON TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0 7.5 8.0 8.6+PTX" USE_MKLDNN=ON USE_FFMPEG=ON USE_OPENCV=ON python3 ./setup.py bdist_wheel | tee /tmp/torchvision_config.txt; \
368+ else \
369+ time env FORCE_CUDA=OFF USE_CUDNN=OFF USE_MKLDNN=ON USE_FFMPEG=ON USE_OPENCV=ON python3 ./setup.py bdist_wheel | tee /tmp/torchvision_config.txt; \
370+ fi \
371+ # && time sh -c "python3 ./setup.py bdist_wheel | tee /tmp/torchvision_config.txt" \
360372 && time pip3 install /usr/local/src/vision/dist/*.whl \
361373 && cd /tmp \
362374 && perl -i.bak -pe 'exit if m%^running bdist_wheel%' torchvision_config.txt \
@@ -366,17 +378,24 @@ RUN mkdir -p /usr/local/src \
366378RUN python3 -c "import torchvision"
367379
368380ARG CTO_TORCHAUDIO=0.11
369- RUN mkdir -p /usr/local/src/builder \
381+ RUN mkdir -p /usr/local/src \
370382 && cd /usr/local/src \
371- && git clone --depth 1 --branch release/ ${CTO_TORCHAUDIO} https://github.com/pytorch/audio.git \
383+ && git clone --depth 1 --branch v ${CTO_TORCHAUDIO} https://github.com/pytorch/audio.git \
372384 && cd /usr/local/src/audio \
373- && time sh -c "python3 ./setup.py bdist_wheel | tee /tmp/torchaudio_config.txt" \
385+ && git submodule sync && git submodule update --init --recursive \
386+ && if [ -f /tmp/.GPU_build ]; \
387+ then \
388+ time env USE_CUDA=ON USE_CUDNN=ON TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0 7.5 8.0 8.6+PTX" USE_MKLDNN=ON USE_FFMPEG=ON USE_OPENCV=ON python3 ./setup.py bdist_wheel | tee /tmp/torchaudio_config.txt; \
389+ else \
390+ time env USE_CUDA=OFF USE_CUDNN=OFF USE_MKLDNN=ON USE_FFMPEG=ON USE_OPENCV=ON python3 ./setup.py bdist_wheel | tee /tmp/torchaudio_config.txt; \
391+ fi \
392+ # && time sh -c "python3 ./setup.py bdist_wheel | tee /tmp/torchaudio_config.txt" \
374393 && time pip3 install /usr/local/src/audio/dist/*.whl \
375394 && cd /tmp \
376395 && perl -i.bak -pe 'exit if m%^-- Configuring done%' torchaudio_config.txt \
377396 && sh -c "cmp --silent torchaudio_config.txt torchaudio_config.txt.bak && exit 1 || rm torchaudio_config.txt.bak" \
378397 && ldconfig \
379- && rm -rf /root/.cache/pip /usr/local/src/builder
398+ && rm -rf /root/.cache/pip /usr/local/src/audio
380399RUN python3 -c "import torchaudio"
381400
382401
@@ -390,11 +409,6 @@ COPY tools/tf_info.sh /tmp/
390409RUN chmod +x /tmp/tf_info.sh \
391410 && touch /.within_container
392411
393- # ENV NVIDIA_VISIBLE_DEVICES all
394- # ENV NVIDIA_DRIVER_CAPABILITIES all
395-
396- ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH
397-
398412# Setting up working directory
399413RUN mkdir /dmc
400414WORKDIR /dmc
0 commit comments