-
Notifications
You must be signed in to change notification settings - Fork 863
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Invokes docker with --runtime=nvidia for GPU Added the option to specify the GPU / specific GPU ids in start.sh Fixed the documentation for start.sh script Fixed the JDK version in Dockerfile.gpu Co-authored-by: Aaqib <maaquib@gmail.com>
- Loading branch information
Showing
5 changed files
with
50 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,37 @@ | ||
#!/bin/bash | ||
IMAGE_NAME="torchserve:1.0" | ||
IMAGE_NAME="pytorch/torchserve:latest" | ||
|
||
echo "Starting torchserve:1.0 docker image" | ||
for arg in "$@" | ||
do | ||
case $arg in | ||
-h|--help) | ||
echo "options:" | ||
echo "-h, --help show brief help" | ||
echo "-g, --gpu specify to use gpu" | ||
echo "-d, --gpu_devices to use specific gpu device ids" | ||
exit 0 | ||
;; | ||
-g|--gpu) | ||
DOCKER_RUNTIME="--runtime=nvidia" | ||
IMAGE_NAME="pytorch/torchserve:latest-gpu" | ||
shift | ||
;; | ||
-d|--gpu_devices) | ||
if test $ | ||
then | ||
DOCKER_RUNTIME="--runtime=nvidia" | ||
IMAGE_NAME="pytorch/torchserve:latest-gpu" | ||
GPU_DEVICES="-e NVIDIA_VISIBLE_DEVICES=$2" | ||
shift | ||
fi | ||
shift | ||
;; | ||
esac | ||
done | ||
echo "Starting $IMAGE_NAME docker image" | ||
|
||
docker run $DOCKER_RUNTIME $GPU_DEVICES -d --rm -it -p 8080:8080 -p 8081:8081 $IMAGE_NAME > /dev/null 2>&1 | ||
This comment has been minimized.
Sorry, something went wrong.
chauhang
Contributor
|
||
|
||
docker run -d --rm -it -p 8080:8080 -p 8081:8081 torchserve:1.0 > /dev/null 2>&1 | ||
container_id=$(docker ps --filter="ancestor=$IMAGE_NAME" -q | xargs) | ||
|
||
sleep 30 | ||
|
@maaquib Please remove the extra --gpus (showing up twice). Also clarify that "device=all" will enable for all gpus