Summary
Add a cuda: block to build_config that installs a CUDA toolkit on top of a non-CUDA base image, so Tesseract authors don't have to hand-roll the apt-keyring + component install + arch-list dance.
Motivation
CUDA-from-source Tesseracts currently carry ~10 lines of boilerplate per image:
- NVIDIA apt keyring + repo setup
cuda-nvcc, cuda-cudart, libcublas, libcusparse component installs
TORCH_CUDA_ARCH_LIST env var with the target SM list
This is duplicated across every CUDA-from-source Tesseract and is the slowest part of those builds (20+ min end-to-end).
Proposal
build_config:
cuda:
version: \"12.3\"
components: [nvcc, cudart-dev, cublas-dev, cusparse-dev]
arch_list: [\"7.0\", \"7.5\", \"8.0\", \"8.6\", \"9.0\"]
Behavior:
- Adds the NVIDIA apt repo + keyring for the requested CUDA version.
- Installs the requested components via apt.
- Sets
TORCH_CUDA_ARCH_LIST from arch_list so PyTorch / extensions compile for the right SMs.
- Sane defaults for
components and arch_list if omitted.
Impact
CUDA-from-source builds are the slowest Tesseract images in practice (~20+ min). Centralizing the install also makes it easier to bump CUDA versions across the fleet.
Summary
Add a
cuda:block tobuild_configthat installs a CUDA toolkit on top of a non-CUDA base image, so Tesseract authors don't have to hand-roll the apt-keyring + component install + arch-list dance.Motivation
CUDA-from-source Tesseracts currently carry ~10 lines of boilerplate per image:
cuda-nvcc,cuda-cudart,libcublas,libcusparsecomponent installsTORCH_CUDA_ARCH_LISTenv var with the target SM listThis is duplicated across every CUDA-from-source Tesseract and is the slowest part of those builds (20+ min end-to-end).
Proposal
Behavior:
TORCH_CUDA_ARCH_LISTfromarch_listso PyTorch / extensions compile for the right SMs.componentsandarch_listif omitted.Impact
CUDA-from-source builds are the slowest Tesseract images in practice (~20+ min). Centralizing the install also makes it easier to bump CUDA versions across the fleet.