Skip to content

Commit

Permalink
Specify --shm-size=2g and fix typo in code comments
Browse files Browse the repository at this point in the history
Fix OOM crash in data loader workers caused by docker's small default
shared memory size.
  • Loading branch information
jannehellsten committed Feb 11, 2021
1 parent ecfea65 commit d3a616a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docker_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ set -e
#
# Use it like:
#
# ./run_docker.sh python generate.py --help
# ./docker_run.sh python generate.py --help
#
# To override the default `stylegan2ada:latest` image, run:
#
# IMAGE=my_image:v1.0 ./run_docker.sh python generate.py --help
# IMAGE=my_image:v1.0 ./docker_run.sh python generate.py --help
#

rest=$@
Expand All @@ -30,7 +30,7 @@ IMAGE="${IMAGE:-sg2ada:latest}"

CONTAINER_ID=$(docker inspect --format="{{.Id}}" ${IMAGE} 2> /dev/null)
if [[ "${CONTAINER_ID}" ]]; then
docker run --gpus all -it --rm -v `pwd`:/scratch --user $(id -u):$(id -g) \
docker run --shm-size=2g --gpus all -it --rm -v `pwd`:/scratch --user $(id -u):$(id -g) \
--workdir=/scratch -e HOME=/scratch $IMAGE $@
else
echo "Unknown container image: ${IMAGE}"
Expand Down

0 comments on commit d3a616a

Please sign in to comment.