chore: configure devcontainer
This commit is contained in:
parent
1f64f8a176
commit
fc9fd5a6c3
6 changed files with 136 additions and 3 deletions
15
.devcontainer/post-create.sh
Normal file
15
.devcontainer/post-create.sh
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Detect if a GPU is available via nvidia-smi.
|
||||
# This works for Linux hosts and Windows (WSL2) with NVIDIA Container Toolkit.
|
||||
# On Mac (Apple Silicon) or systems without NVIDIA GPUs, this will skip the 'cuda' extra.
|
||||
if command -v nvidia-smi &> /dev/null && nvidia-smi &> /dev/null; then
|
||||
echo "GPU detected. Syncing with 'cuda' extra..."
|
||||
uv sync --frozen --extra cuda
|
||||
else
|
||||
echo "No GPU detected or nvidia-smi failed. Syncing without 'cuda' extra..."
|
||||
uv sync --frozen
|
||||
fi
|
||||
|
||||
echo "Environment synced successfully."
|
||||
Reference in a new issue