Skip to content

TDT/label-looping decoder crashes instead of falling back when libcuda is absent (e.g. ROCm builds of torch) #15905

Description

@matt-shearing

Environment

  • nemo_toolkit[asr] 2.x (pip, 2026-07), torch 2.9.1+rocm6.4 (AMD gfx1100; torch.cuda works via HIP)
  • cuda-python installed (pulled in transitively)

Repro

import nemo.collections.asr as nemo_asr
m = nemo_asr.models.EncDecRNNTBPEModel.from_pretrained("nvidia/parakeet-tdt-0.6b-v3").to("cuda")
m.transcribe(["any.wav"])   # RuntimeError: Failed to dlopen libcuda.so.1

Analysis

label_looping_base.py::maybe_enable_cuda_graphs() guards CUDA-graph support with
check_cuda_python_cuda_graphs_conditional_nodes_supported(), catching only
(ImportError, ModuleNotFoundError, EnvironmentError). But on a system where
cuda-python is importable yet no NVIDIA driver exists (ROCm torch, CPU-only
boxes with cuda-python installed), cuda.cuDriverGetVersion() raises
RuntimeError("Failed to dlopen libcuda.so.1") from inside the C extension —
before NeMo's own CUDA_SUCCESS check — and nothing catches it.

Expected

Same graceful degradation the function already provides when cuda-python is
missing: log a warning, decode without CUDA graphs (that path works perfectly —
we transcribed ~650 h of audio on ROCm this way).

Suggested fix

Add RuntimeError to the except clause (or wrap the driver-version probe).
Not a ROCm-support request — purely a graceful-degradation gap.

Workarounds (verified)

  • decoding.greedy.use_cuda_graph_decoder = False via change_decoding_strategy, or
  • uninstall cuda-python.

Found while batch-transcribing ~650h of audio with parakeet-tdt-0.6b-v3 on an AMD gfx1100 workstation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions