mirror of
https://github.com/saymrwulf/stable-baselines3.git
synced 2026-05-14 20:58:03 +00:00
19 lines
588 B
Bash
Executable file
19 lines
588 B
Bash
Executable file
#!/bin/bash
|
|
# Launch an experiment using the docker gpu image
|
|
|
|
cmd_line="$@"
|
|
|
|
echo "Executing in the docker (gpu image):"
|
|
echo $cmd_line
|
|
|
|
# TODO: always use new-style once sufficiently widely used (probably 2021 onwards)
|
|
if [ -x "$(which nvidia-docker)" ]; then
|
|
# old-style nvidia-docker2
|
|
NVIDIA_ARG="--runtime=nvidia"
|
|
else
|
|
NVIDIA_ARG="--gpus all"
|
|
fi
|
|
|
|
docker run -it ${NVIDIA_ARG} --rm --network host --ipc=host \
|
|
--mount src=$(pwd),target=/root/code/stable-baselines3,type=bind stablebaselines/stable-baselines3:latest \
|
|
bash -c "cd /root/code/stable-baselines3/ && $cmd_line"
|