Skip to content

Add dedicated build config to streamline setting up CUDA-enabled Tesseracts #609

Description

@andrinr

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions