File size: 1,214 Bytes
5a3fcf5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
# Once, on a node with internet: install uv $UV_VERSION into $POPT_WORK/uv/bin, then Python 3.10 and the locked
# packages (uv.lock) into $UV_PROJECT_ENVIRONMENT, and check that AV1 video decodes.
set -euo pipefail
cd "$(dirname "$0")"
source config.env
mkdir -p "$POPT_WORK/uv/bin"
if [ ! -x "$POPT_WORK/uv/bin/uv" ]; then
  curl -LsSf "https://astral.sh/uv/$UV_VERSION/install.sh" | env UV_UNMANAGED_INSTALL="$POPT_WORK/uv/bin" sh
fi
[ "$(command -v uv)" = "$POPT_WORK/uv/bin/uv" ] || { echo "uv on PATH is not $POPT_WORK/uv/bin/uv"; exit 1; }
uv --version
uv sync --frozen
uv run --no-sync python - <<'PY'
import sys
import av, numpy, pyarrow, torch, huggingface_hub
dec = [n for n in ("libdav1d", "libaom-av1", "av1") if n in av.codecs_available]
assert dec, "this PyAV build has no AV1 decoder; most videos in the dataset are AV1"
print(f"python {sys.version.split()[0]}, torch {torch.__version__} (CUDA {torch.version.cuda}, GPUs visible here: "
      f"{torch.cuda.device_count()}), av {av.__version__} (AV1 decoders: {dec}), pyarrow {pyarrow.__version__}, "
      f"numpy {numpy.__version__}, huggingface_hub {huggingface_hub.__version__}")
PY
echo "environment ready: $UV_PROJECT_ENVIRONMENT"