Skip to content

nvImageCodec Warning Too Frequent #9133

Open

Description

@ericspod

Describe the bug
The following warning is being printed whenever MONAI is imported without the mentioned libraries:

Failed to load nvtiff library! Please install nvTIFF (see https://docs.nvidia.com/cuda/nvtiff/userguide.html#installing-nvtiff).
Note: If using nvImageCodec's Python distribution, it is enough to install the nvTIFF wheel: e.g. `python3 -m pip install nvidia-nvtiff-cu13`
[ERROR] [nvtiff_ext] Failed to load nvTIFF library or retrieve version. Decoders and encoders will not be registered.
Failed to load nvjpeg2k library! Please install nvJPEG2000 (see https://docs.nvidia.com/cuda/nvjpeg2000/userguide.html#installing-nvjpeg2000).
Note: If using nvImageCodec's Python distribution, it is enough to install the nvJPEG2000 wheel: e.g. `python3 -m pip install nvidia-nvjpeg2k-cu13`
[ERROR] [nvjpeg2k_ext] Failed to load nvJPEG2000 library or retrieve version. Decoders and encoders will not be registered.

These are important if a user is attempting to use the new NvImgCodecPydicomReader class for accelerated DICOM reading, but these shouldn't appear until that time. I think the time at which the imports are attempted in NvImgCodecPydicomReader or in nvimgcodec_pydicom_plugin.py can be shifted around to be later rather than at MONAI's import time.

To Reproduce
Steps to reproduce the behavior:

  1. import MONAI without nvidia-nvtiff-cu13 or nvidia-nvjpeg2k-cu13

Expected behavior
No warning.

Activity

  1. ericspod commented on Sep 26, 2026

    @ericspod
    MemberAuthor

    Hi @MMelQin I should have considered this with your PR introducing the feature, but we can look into this in follow-up work for the next release.

  2. added
    Module: datadatasets, readers/writers, synthetic data
    Low risknice-to-have features
    refactorNon-breaking feature enhancements
    on Sep 26, 2026
  3. vikasreddy11 commented on Oct 12, 2026

    @vikasreddy11

    Hi @ericspod @MMelQin, I’d be interested in helping with this. Are you both already working on it, or is there a part I could take, such as making the nvTIFF/nvJPEG2000 imports lazy? Happy to wait for your guidance before starting

  4. ericspod commented on Oct 12, 2026

    @ericspod
    MemberAuthor

    Hi @vikasreddy11 if you'd like to suggest a PR to fix the issue it would be appreciated. I think there's a way of moving the imports into a method somewhere which isn't invoked until a user tries to load Dicom data, if you wanted to look into where that would be we can review a PR on the solution. Thanks!

  5. vikasreddy11 commented on Oct 14, 2026

    @vikasreddy11

    Thanks for the suggestion! I've opened #9176 to exclude nvimgcodec_pydicom_plugin from eager submodule loading during MONAI initialization and added a regression test to verify that nvidia.nvimgcodec is not imported automatically. Feedback on the approach is welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Low risknice-to-have featuresModule: datadatasets, readers/writers, synthetic datarefactorNon-breaking feature enhancements

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions