mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Summary: Fixes : https://github.com/pytorch/pytorch/issues/73377 We've migrated to CUDA-11.3 as default toolkit in 1.9, it's time to stop builds (especially considering forward-compatibility guarantee across CUDA-11.x drivers) Hence we are removing CUDA 11.1 support. We should also cleanup old cuda related code from our builder and pytorch repo making scripts a little more clean. We have code that references cuda 9.2 , 10.1 , 11.0, 11.1, 11.2 and none of these are currently use Pull Request resolved: https://github.com/pytorch/pytorch/pull/73514 Reviewed By: janeyx99 Differential Revision: D34551989 Pulled By: atalman fbshipit-source-id: 9ceaaa9b25ad49689986f4b29a26d20370d9d011 (cherry picked from commit fe109c62daf429e9053c03f6e374568ba23cd041)
73 lines
2.4 KiB
Makefile
73 lines
2.4 KiB
Makefile
DOCKER_REGISTRY = docker.io
|
|
DOCKER_ORG = $(shell docker info 2>/dev/null | sed '/Username:/!d;s/.* //')
|
|
DOCKER_IMAGE = pytorch
|
|
DOCKER_FULL_NAME = $(DOCKER_REGISTRY)/$(DOCKER_ORG)/$(DOCKER_IMAGE)
|
|
|
|
ifeq ("$(DOCKER_ORG)","")
|
|
$(warning WARNING: No docker user found using results from whoami)
|
|
DOCKER_ORG = $(shell whoami)
|
|
endif
|
|
|
|
CUDA_VERSION = 11.3
|
|
CUDNN_VERSION = 8
|
|
BASE_RUNTIME = ubuntu:18.04
|
|
BASE_DEVEL = nvidia/cuda:$(CUDA_VERSION)-cudnn$(CUDNN_VERSION)-devel-ubuntu18.04
|
|
|
|
# The conda channel to use to install cudatoolkit
|
|
CUDA_CHANNEL = nvidia
|
|
# The conda channel to use to install pytorch / torchvision
|
|
INSTALL_CHANNEL = pytorch
|
|
|
|
PYTHON_VERSION = 3.7
|
|
PYTORCH_VERSION = $(shell git describe --tags --always)
|
|
# Can be either official / dev
|
|
BUILD_TYPE = dev
|
|
BUILD_PROGRESS = auto
|
|
BUILD_ARGS = --build-arg BASE_IMAGE=$(BASE_IMAGE) \
|
|
--build-arg PYTHON_VERSION=$(PYTHON_VERSION) \
|
|
--build-arg CUDA_VERSION=$(CUDA_VERSION) \
|
|
--build-arg CUDA_CHANNEL=$(CUDA_CHANNEL) \
|
|
--build-arg PYTORCH_VERSION=$(PYTORCH_VERSION) \
|
|
--build-arg INSTALL_CHANNEL=$(INSTALL_CHANNEL)
|
|
EXTRA_DOCKER_BUILD_FLAGS ?=
|
|
DOCKER_BUILD = DOCKER_BUILDKIT=1 \
|
|
docker build \
|
|
--progress=$(BUILD_PROGRESS) \
|
|
$(EXTRA_DOCKER_BUILD_FLAGS) \
|
|
--target $(BUILD_TYPE) \
|
|
-t $(DOCKER_FULL_NAME):$(DOCKER_TAG) \
|
|
$(BUILD_ARGS) .
|
|
DOCKER_PUSH = docker push $(DOCKER_FULL_NAME):$(DOCKER_TAG)
|
|
|
|
.PHONY: all
|
|
all: devel-image
|
|
|
|
.PHONY: devel-image
|
|
devel-image: BASE_IMAGE := $(BASE_DEVEL)
|
|
devel-image: DOCKER_TAG := $(PYTORCH_VERSION)-devel
|
|
devel-image:
|
|
$(DOCKER_BUILD)
|
|
|
|
.PHONY: devel-image
|
|
devel-push: BASE_IMAGE := $(BASE_DEVEL)
|
|
devel-push: DOCKER_TAG := $(PYTORCH_VERSION)-devel
|
|
devel-push:
|
|
$(DOCKER_PUSH)
|
|
|
|
.PHONY: runtime-image
|
|
runtime-image: BASE_IMAGE := $(BASE_RUNTIME)
|
|
runtime-image: DOCKER_TAG := $(PYTORCH_VERSION)-runtime
|
|
runtime-image:
|
|
$(DOCKER_BUILD)
|
|
docker tag $(DOCKER_FULL_NAME):$(DOCKER_TAG) $(DOCKER_FULL_NAME):latest
|
|
|
|
.PHONY: runtime-image
|
|
runtime-push: BASE_IMAGE := $(BASE_RUNTIME)
|
|
runtime-push: DOCKER_TAG := $(PYTORCH_VERSION)-runtime
|
|
runtime-push:
|
|
$(DOCKER_PUSH)
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
-docker rmi -f $(shell docker images -q $(DOCKER_FULL_NAME))
|