[demo] add GPU to resources (#355)

This small PR adds GPU specification in `docker-compose.yaml` for the SAM 2 interactive webdemo, following https://docs.docker.com/compose/how-tos/gpu-support/#example-of-a-compose-file-for-running-a-service-with-access-to-1-gpu-device. It fixes a GPU access error as reported in https://github.com/facebookresearch/sam2/issues/354.

(close https://github.com/facebookresearch/sam2/issues/354)
This commit is contained in:
Ronghang Hu
2024-10-03 16:48:56 -07:00
committed by GitHub
parent 8bf0920e66
commit e22521832f

View File

@@ -33,3 +33,10 @@ services:
- VIDEO_ENCODE_MAX_WIDTH=1280
- VIDEO_ENCODE_MAX_HEIGHT=720
- VIDEO_ENCODE_VERBOSE=False
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]