-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
83 lines (74 loc) · 2.03 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
PROJECT ?= refine
WORKSPACE ?= /opt/app/${PROJECT}
DOCKER_IMAGE ?= ${PROJECT}:latest
SHMSIZE ?= 444G
WANDB_MODE ?= run
DOCKER_LIGHT_OPTS := \
--name refine \
--rm -it \
--gpus all \
--shm-size=${SHMSIZE} \
-e AWS_DEFAULT_REGION \
-e AWS_ACCESS_KEY_ID \
-e AWS_SECRET_ACCESS_KEY \
-e HOST_HOSTNAME= \
-e OMP_NUM_THREADS=1 -e KMP_AFFINITY="granularity=fine,compact,1,0" \
-e OMPI_ALLOW_RUN_AS_ROOT=1 \
-e OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 \
-e NCCL_DEBUG=VERSION \
-e DISPLAY=${DISPLAY} \
-e XAUTHORITY \
-e NVIDIA_DRIVER_CAPABILITIES=all \
-v /dev/null:/dev/raw1394 \
-v /tmp/.X11-unix/X0:/tmp/.X11-unix/X0 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ${PWD}:${WORKSPACE} \
-w ${WORKSPACE} \
--privileged \
--ipc=host \
--network=host
DOCKER_OPTS := \
--name refine \
--rm -it \
--gpus all \
--shm-size=${SHMSIZE} \
-e AWS_DEFAULT_REGION \
-e AWS_ACCESS_KEY_ID \
-e AWS_SECRET_ACCESS_KEY \
-e WANDB_API_KEY \
-e WANDB_ENTITY \
-e WANDB_MODE \
-e HOST_HOSTNAME= \
-e OMP_NUM_THREADS=1 -e KMP_AFFINITY="granularity=fine,compact,1,0" \
-e OMPI_ALLOW_RUN_AS_ROOT=1 \
-e OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 \
-e NCCL_DEBUG=VERSION \
-e DISPLAY=${DISPLAY} \
-e XAUTHORITY \
-e NVIDIA_DRIVER_CAPABILITIES=all \
-v ~/.aws:/root/.aws \
-v /root/.ssh:/root/.ssh \
-v ~/.cache:/root/.cache \
-v /dev/null:/dev/raw1394 \
-v /tmp/.X11-unix/X0:/tmp/.X11-unix/X0 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ${PWD}:${WORKSPACE} \
-w ${WORKSPACE} \
--privileged \
--ipc=host \
--network=host
NGPUS=$(shell nvidia-smi -L | wc -l)
all: clean
clean:
find . -name "*.pyc" | xargs rm -f && \
find . -name "__pycache__" | xargs rm -rf
docker-build:
docker build \
-f docker/Dockerfile \
-t ${DOCKER_IMAGE} .
docker-build-clean:
docker build \
-f docker/Dockerfile \
-t ${DOCKER_IMAGE} --no-cache .
docker-interactive:
docker run ${DOCKER_LIGHT_OPTS} refine bash