mirror of
https://github.com/karpathy/nanochat.git
synced 2026-01-04 10:42:47 +00:00
Updated runcpu.sh to use the gpu sometimes
This commit is contained in:
parent
d513db792e
commit
e72efbbf14
|
|
@ -6,15 +6,9 @@
|
|||
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||
"features": {
|
||||
// CUDA support with GPU passthrough
|
||||
"ghcr.io/devcontainers/features/nvidia-cuda:2": {},
|
||||
"ghcr.io/devcontainers/features/nvidia-cuda:2": {}
|
||||
|
||||
// Python
|
||||
"ghcr.io/devcontainers/features/python:1": {
|
||||
"version": "3.10" // sync with .python-version file
|
||||
},
|
||||
|
||||
// (Optional) access to system's docker host
|
||||
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}
|
||||
// Everythong else gets installed automatically by uv
|
||||
},
|
||||
|
||||
// Needed for GPU passthrough for CUDA in the container
|
||||
|
|
|
|||
|
|
@ -14,7 +14,14 @@ NANOCHAT_BASE_DIR="$HOME/.cache/nanochat"
|
|||
mkdir -p $NANOCHAT_BASE_DIR
|
||||
command -v uv &> /dev/null || curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
[ -d ".venv" ] || uv venv
|
||||
uv sync --extra cpu
|
||||
|
||||
# check if there's a Nvidia GPU installed (even if it's a mediocre one), if so still use CUDA
|
||||
if nvidia-smi -L >/dev/null 2>&1; then
|
||||
uv sync --extra gpu
|
||||
else
|
||||
uv sync --extra cpu
|
||||
fi
|
||||
|
||||
source .venv/bin/activate
|
||||
if [ -z "$WANDB_RUN" ]; then
|
||||
WANDB_RUN=dummy
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user