diff --git a/examples/docker/Dockerfile b/examples/docker/Dockerfile index 37bed888c..47fd422cd 100644 --- a/examples/docker/Dockerfile +++ b/examples/docker/Dockerfile @@ -1,5 +1,5 @@ # Base image must at least have pytorch and CUDA installed. -ARG BASE_IMAGE=nvcr.io/nvidia/pytorch:19.03-py3 +ARG BASE_IMAGE=nvcr.io/nvidia/pytorch:19.07-py3 FROM $BASE_IMAGE ARG BASE_IMAGE RUN echo "Installing Apex on top of ${BASE_IMAGE}" diff --git a/setup.py b/setup.py index f94925a68..53b84d08e 100644 --- a/setup.py +++ b/setup.py @@ -5,10 +5,20 @@ from pip._internal import main as pipmain import sys import warnings +import os if not torch.cuda.is_available(): - print("\nWarning: Torch did not find available GPUs on this system.\n", - "If your intention is to cross-compile, this is not an error.\n") + # https://github.com/NVIDIA/apex/issues/486 + # Extension builds after https://github.com/pytorch/pytorch/pull/23408 attempt to query torch.cuda.get_device_capability(), + # which will fail if you are compiling in an environment without visible GPUs (e.g. during an nvidia-docker build command). + print('\nWarning: Torch did not find available GPUs on this system.\n', + 'If your intention is to cross-compile, this is not an error.\n' + 'By default, Apex will cross-compile for Pascal (compute capabilities 6.0, 6.1, 6.2),\n' + 'Volta (compute capability 7.0), and Turing (compute capability 7.5).\n' + 'If you wish to cross-compile for a single specific architecture,\n' + 'export TORCH_CUDA_ARCH_LIST="compute capability" before running setup.py.\n') + if os.environ.get("TORCH_CUDA_ARCH_LIST", None) is None: + os.environ["TORCH_CUDA_ARCH_LIST"] = "6.0;6.1;6.2;7.0;7.5" print("torch.__version__ = ", torch.__version__) TORCH_MAJOR = int(torch.__version__.split('.')[0])