The installed careless/0.5.4 venv already contains the NVIDIA wheels ([cuda] extra), which need only the node driver and fall back to CPU, so a separate GPU module and cuda module dep are unnecessary. Revert careless/build to careless[cuda] to match the actual install. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
32 lines
1.2 KiB
Python
Executable File
32 lines
1.2 KiB
Python
Executable File
#!/usr/bin/env modbuild
|
|
|
|
pbuild::prep() {
|
|
:
|
|
}
|
|
|
|
pbuild::configure() {
|
|
# repo.anaconda.com is unreachable from Ra (GnuTLS error), so no conda.
|
|
# uv fetches a standalone CPython instead; keep it inside PREFIX so the
|
|
# venv's interpreter symlinks don't depend on the builder's home cache.
|
|
UV="${UV:-$HOME/.local/bin/uv}"
|
|
# ~/.cache/uv hits the home disk quota; default the cache into PREFIX
|
|
# (overridable: UV_CACHE_DIR=<path> modbuild build <version>)
|
|
export UV_CACHE_DIR="${UV_CACHE_DIR:-$PREFIX/.uv-cache}"
|
|
export UV_PYTHON_INSTALL_DIR="$PREFIX/python"
|
|
"$UV" venv --python 3.12 "$PREFIX/venv"
|
|
}
|
|
|
|
pbuild::compile() {
|
|
:
|
|
}
|
|
|
|
pbuild::install() {
|
|
UV="${UV:-$HOME/.local/bin/uv}"
|
|
export UV_CACHE_DIR="${UV_CACHE_DIR:-$PREFIX/.uv-cache}"
|
|
# [cuda] extra ships the NVIDIA stack (CUDA, cuDNN, ...) as pip wheels:
|
|
# uses the GPU when present (needs only the node driver), else falls back to CPU
|
|
"$UV" pip install --python "$PREFIX/venv/bin/python" "careless[cuda]==${V_PKG}"
|
|
# only auto-remove the cache if it lives inside this PREFIX (never a shared one)
|
|
[[ "$UV_CACHE_DIR" == "$PREFIX"* ]] && rm -rf "$UV_CACHE_DIR" || :
|
|
}
|