Skip to content

read_geotiff_gpu: silent CPU fallback hides GPU bugs #1516

@brendancol

Description

@brendancol

Problem

read_geotiff_gpu in xrspatial/geotiff/__init__.py wraps the GPU decode in an outer try/except Exception that turns any GPU error into a silent CPU fallback:

try:
    arr_gpu = gpu_decode_tiles_from_file(...)
except Exception:
    pass

Output stays correct, but real bugs in the GPU path go undetected. #1508 was a one-line AttributeError that lived in the codebase invisibly because of this handler.

Suggested change

Either:

  • Catch only the specific exceptions we expect to recover from (e.g. MemoryError, cuda.RuntimeError) and log/re-raise the rest.
  • Add an environment variable or kwarg (e.g. gpu='strict') that disables the fallback so users testing GPU paths get loud failures.
  • At minimum, log a warning when the fallback fires.

Severity

LOW. Correctness is fine. Detectability of GPU regressions is the issue.

Related

Discovered while fixing #1508.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions