mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
docs: add CUDA/GPU documentation and benchmarks
- Add :cuda tag to Docker Tags docs with setup, benchmarks, compose example - Add GPU acceleration tip to AI engine docs - Include benchmark table from RTX 4070 testing
This commit is contained in:
@@ -8,6 +8,10 @@ All model weights are bundled in the Docker image during the build. No downloads
|
|||||||
AI tools are not available in the `:lite` Docker image. The API returns `501 Not Available` for these endpoints when running the lite variant. Use `:latest` for AI features. See [Docker Tags](/guide/docker-tags) for details.
|
AI tools are not available in the `:lite` Docker image. The API returns `501 Not Available` for these endpoints when running the lite variant. Use `:latest` for AI features. See [Docker Tags](/guide/docker-tags) for details.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
::: tip GPU acceleration
|
||||||
|
The `:cuda` Docker image includes GPU-accelerated versions of the ML libraries. Background removal, upscaling, and OCR all benefit from NVIDIA GPU acceleration. The image auto-detects your GPU and falls back to CPU if none is available. See [Docker Tags](/guide/docker-tags) for setup.
|
||||||
|
:::
|
||||||
|
|
||||||
## Background removal
|
## Background removal
|
||||||
|
|
||||||
Removes the background from an image and returns a transparent PNG.
|
Removes the background from an image and returns a transparent PNG.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Docker Image Tags
|
# Docker Image Tags
|
||||||
|
|
||||||
Stirling Image ships two Docker image variants to fit different use cases.
|
Stirling Image ships three Docker image variants to fit different use cases.
|
||||||
|
|
||||||
## Full (default)
|
## Full (default)
|
||||||
|
|
||||||
@@ -35,6 +35,38 @@ Use this if you:
|
|||||||
|
|
||||||
All other tools (27+) work identically in both variants.
|
All other tools (27+) work identically in both variants.
|
||||||
|
|
||||||
|
## CUDA (GPU acceleration)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker pull stirlingimage/stirling-image:cuda
|
||||||
|
```
|
||||||
|
|
||||||
|
Same tools as the full image, but built with GPU-accelerated Python packages (onnxruntime-gpu, PyTorch CUDA, PaddlePaddle GPU). The image auto-detects your NVIDIA GPU at runtime and falls back to CPU if none is found.
|
||||||
|
|
||||||
|
Requires [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html) on the host. Linux amd64 only.
|
||||||
|
|
||||||
|
### What gets faster with GPU
|
||||||
|
|
||||||
|
| Tool | CPU | GPU (RTX 4070) | Speedup |
|
||||||
|
|------|-----|----------------|---------|
|
||||||
|
| Background removal | 2.4s | 0.9s | 2.7x |
|
||||||
|
| Upscale 2x | 350ms | 310ms | ~1.1x |
|
||||||
|
| Upscale 4x | 910ms | 310ms | ~3x |
|
||||||
|
| OCR (PaddleOCR) | 137ms | 94ms | ~1.5x |
|
||||||
|
|
||||||
|
Benchmarked with a 572x1024 JPEG portrait. Larger images show bigger speedups, especially for upscaling.
|
||||||
|
|
||||||
|
Non-AI tools (resize, crop, convert, etc.) are unaffected since they use Sharp (CPU-based).
|
||||||
|
|
||||||
|
### GPU health check
|
||||||
|
|
||||||
|
After the first AI request, the admin health endpoint reports GPU status:
|
||||||
|
|
||||||
|
```
|
||||||
|
GET /api/v1/admin/health
|
||||||
|
{"ai": {"gpu": true}}
|
||||||
|
```
|
||||||
|
|
||||||
## Docker Compose
|
## Docker Compose
|
||||||
|
|
||||||
### Full
|
### Full
|
||||||
@@ -71,6 +103,30 @@ volumes:
|
|||||||
stirling-workspace:
|
stirling-workspace:
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### CUDA
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
services:
|
||||||
|
stirling-image:
|
||||||
|
image: stirlingimage/stirling-image:cuda
|
||||||
|
ports:
|
||||||
|
- "1349:1349"
|
||||||
|
volumes:
|
||||||
|
- stirling-data:/data
|
||||||
|
- stirling-workspace:/tmp/workspace
|
||||||
|
deploy:
|
||||||
|
resources:
|
||||||
|
reservations:
|
||||||
|
devices:
|
||||||
|
- driver: nvidia
|
||||||
|
count: 1
|
||||||
|
capabilities: [gpu]
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
stirling-data:
|
||||||
|
stirling-workspace:
|
||||||
|
```
|
||||||
|
|
||||||
## Switching from lite to full
|
## Switching from lite to full
|
||||||
|
|
||||||
To upgrade from lite to full and unlock AI tools:
|
To upgrade from lite to full and unlock AI tools:
|
||||||
@@ -90,7 +146,10 @@ Both variants support semver tags for pinning:
|
|||||||
|-----|------------|
|
|-----|------------|
|
||||||
| `latest` | Latest full release |
|
| `latest` | Latest full release |
|
||||||
| `lite` | Latest lite release |
|
| `lite` | Latest lite release |
|
||||||
|
| `cuda` | Latest full release with GPU support |
|
||||||
| `1.6.0` | Exact full version |
|
| `1.6.0` | Exact full version |
|
||||||
| `1.6.0-lite` | Exact lite version |
|
| `1.6.0-lite` | Exact lite version |
|
||||||
|
| `1.6.0-cuda` | Exact CUDA version |
|
||||||
| `1.6` | Latest patch in 1.6.x (full) |
|
| `1.6` | Latest patch in 1.6.x (full) |
|
||||||
| `1.6-lite` | Latest patch in 1.6.x (lite) |
|
| `1.6-lite` | Latest patch in 1.6.x (lite) |
|
||||||
|
| `1.6-cuda` | Latest patch in 1.6.x (CUDA) |
|
||||||
|
|||||||
Reference in New Issue
Block a user