Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
apex
Commits
3ae89c75
Unverified
Commit
3ae89c75
authored
Sep 12, 2019
by
mcarilli
Committed by
GitHub
Sep 12, 2019
Browse files
Seems to work locally (#490)
parent
e6cb749b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
examples/docker/Dockerfile
examples/docker/Dockerfile
+1
-1
setup.py
setup.py
+12
-2
No files found.
examples/docker/Dockerfile
View file @
3ae89c75
# Base image must at least have pytorch and CUDA installed.
# Base image must at least have pytorch and CUDA installed.
ARG
BASE_IMAGE=nvcr.io/nvidia/pytorch:19.0
3
-py3
ARG
BASE_IMAGE=nvcr.io/nvidia/pytorch:19.0
7
-py3
FROM
$BASE_IMAGE
FROM
$BASE_IMAGE
ARG
BASE_IMAGE
ARG
BASE_IMAGE
RUN
echo
"Installing Apex on top of
${
BASE_IMAGE
}
"
RUN
echo
"Installing Apex on top of
${
BASE_IMAGE
}
"
...
...
setup.py
View file @
3ae89c75
...
@@ -5,10 +5,20 @@ import subprocess
...
@@ -5,10 +5,20 @@ import subprocess
from
pip._internal
import
main
as
pipmain
from
pip._internal
import
main
as
pipmain
import
sys
import
sys
import
warnings
import
warnings
import
os
if
not
torch
.
cuda
.
is_available
():
if
not
torch
.
cuda
.
is_available
():
print
(
"
\n
Warning: Torch did not find available GPUs on this system.
\n
"
,
# https://github.com/NVIDIA/apex/issues/486
"If your intention is to cross-compile, this is not an error.
\n
"
)
# 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
(
'
\n
Warning: 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__
)
print
(
"torch.__version__ = "
,
torch
.
__version__
)
TORCH_MAJOR
=
int
(
torch
.
__version__
.
split
(
'.'
)[
0
])
TORCH_MAJOR
=
int
(
torch
.
__version__
.
split
(
'.'
)[
0
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment