Repository navigation
Installation macOS
ottco-dev edited this page May 27, 2026
·
2 revisions
Apple Silicon (M1/M2/M3): GPU acceleration via Metal/MPS (no CUDA). Intel Mac: CPU-only recommended (eGPU with CUDA not officially supported). Tested: macOS 13 Ventura, macOS 14 Sonoma
xcode-select --install/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Apple Silicon — add to PATH
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zshrc
source ~/.zshrcbrew install git python@3.12 node nginx
# uv (fast Python package manager)
curl -LsSf https://astral.sh/uv/install.sh | sh
source ~/.zshrcgit clone https://github.com/ottco-dev/ctip-oss.git
cd ctip-oss
uv venv --python 3.12
source .venv/bin/activate
uv pip install -e ".[all]"
# Verify MPS (Apple Silicon GPU)
python -c "
import torch
print('PyTorch:', torch.__version__)
print('MPS available:', torch.backends.mps.is_available())
"CTIP auto-detects MPS. Set explicitly in .env:
CUDA_DEVICE="mps"
CUDA_VISIBLE_DEVICES=""
VRAM_LIMIT_GB="8.0" # MPS shares RAM — on 16 GB Mac, ~8–10 GB usable for GPUMPS limitations:
- No half-precision (fp16) in all ops — some ops fall back to CPU
- Shared memory: GPU tasks compete with system RAM
- No CUDA streams → sequential inference only
cd frontend && npm install && cd ..- Download Docker Desktop for Mac → Apple Silicon: select Arm64 version
- Install and start
- Verify:
docker run hello-world
Homebrew nginx runs as your user (not root):
# Fix hardcoded paths in nginx config
sed -i '' "s|/home/ottcouture/trichome-analysis|$HOME/ctip-oss|g" nginx-local/nginx.conf
# Start nginx
nginx -c "$(pwd)/nginx-local/nginx.conf"cp .env.example .env # edit with your paths
./scripts/dev-start.sh
# http://localhost:3001| Task | Apple M2 (MPS) | RTX 4060 (CUDA) |
|---|---|---|
| YOLO11s inference (1280px tile) | ~180ms | ~45ms |
| SAM2-tiny segmentation | ~350ms | ~80ms |
| Training 1 epoch / 100 images | ~12 min | ~2 min |
macOS is good for development and annotation, not for extended training runs.
brew link --overwrite python@3.12# Reduce in .env:
VRAM_INFERENCE_BUDGET_GB="4.0"
# Or reduce tile size:
TILE_SIZE="640" # default 1280sudo nginx -c "$(pwd)/nginx-local/nginx.conf"/Applications/Python\\ 3.12/Install\\ Certificates.commandCTIP — Cannabis Trichome Intelligence Platform · RTX 4060 / 8 GB VRAM · Backend API · MLflow · Label Studio
Installation & Setup
Scientific Workflow
Reference