cucim icon indicating copy to clipboard operation
cucim copied to clipboard

[BUG] Non-JPEG TIFFs with device='cuda' abort instead of raising an exception.

Open gigony opened this issue 3 months ago • 1 comments

Describe the bug

Loading TIFF image with adobe_deflate compression, with device='cuda' aborts execution, instead of raising an exception in Python.

Steps/Code to reproduce bug

You can download the tiff file from https://huggingface.co/datasets/MahmoodLab/hest/blob/main/wsis/NCBI11.tif (huggingface login on the dataset is needed).

python -m pip install cucim-cu12==24.10  # or 25.08

main.py

import cupy as cp
from cucim import CuImage

img = CuImage("image.tif")
resolutions = img.resolutions
level_dimensions = resolutions["level_dimensions"]
level_count = resolutions["level_count"]

region = img.read_region([0,0], level_dimensions[level_count - 1], level_count - 1, device="cuda")
$ python main.py 
NCBI11.tif: AdobeDeflate compression support is not configured.
NCBI11.tif: AdobeDeflate compression support is not configured.
NCBI11.tif: AdobeDeflate compression support is not configured.
NCBI11.tif: AdobeDeflate compression support is not configured.
NCBI11.tif: AdobeDeflate compression support is not configured.
NCBI11.tif: AdobeDeflate compression support is not configured.
NCBI11.tif: AdobeDeflate compression support is not configured.
[Error] cuFileHandleRegister fd: 36 (NCBI11.tif), status: internal error. Would work with cuCIM's compatibility mode.
terminate called after throwing an instance of 'std::runtime_error'
  what():  Unsupported compression method
[1]    1386998 abort (core dumped)  python main.py

Expected behavior Read image without any messages.

Environment details (please complete the following information):

  • Environment location: Bare-metal
  • Method of cuCIM install: both Conda/PyPI

gigony avatar Sep 07 '25 01:09 gigony

I also see the wrong output when the TIFF image is compressed with JPEG (but non-YCbCr format).

gigony avatar Sep 16 '25 18:09 gigony