Skip to content

Compatibility with PyTorch >= 2.8 for Future Hardware (e.g., RTX 50 series) #8507

Closed
1 of 1 issue completed

Description

@unumbrela

Hi everyone,

I just wanted to share a successful workaround for installing MONAI on a system with an RTX 50 series GPU (5070 Ti), which requires a newer PyTorch version (2.8 preview in my case) than what is currently allowed by the pip package dependencies (torch<=2.6).

My Setup:

Ubuntu 24.04 (WSL2)
RTX 5070 Ti
CUDA 12.9
PyTorch 2.8.0 (preview)

The Workaround:

I downloaded the MONAI v1.5.0 source code from the releases page.
https://github.com/Project-MONAI/MONAI/releases

I ran pip install . from the source directory. This installed MONAI but also downgraded PyTorch to 2.6.

I immediately re-installed my required PyTorch 2.8.0 version.

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128

After these steps, both MONAI 1.5.0 and PyTorch 2.8.0 are co-existing happily in my environment.

This seems to be a dependency constraint issue in setup.py. While my method is a bit of a hack, it does work. Hope this helps anyone else with next-gen hardware!

Activity

  1. pcanas commented on Jul 16, 2025

    @pcanas

    It would be great if we could update monai in order to support Pytorch >= 2.6. Is this plan anytime soon?

  2. ericspod commented on Jul 24, 2025

    @ericspod
    Member

    MONAI has now been updated to support 2.7. @unumbrela thanks for looking into this, if there's anything that needs to be changed to support 2.8 please do make a PR and we'll consider it. 2.8 will be released soon and we want to support it then, though we lack 50 series hardware for testing purposes.

  3. self-assigned this
    on Jul 24, 2025
  4. ogencoglu commented on Aug 23, 2025

    @ogencoglu

    Any updates to support newer torch versions?

    uv gives:

    Because monai==1.5.0 depends on torch>=2.4.1,<2.7.0

  5. jamesobutler commented on Sep 5, 2025

    @jamesobutler
    Contributor

    With cafc1fe adding PyTorch 2.8 support @ericspod will there soon be a new published monai version to PyPI to then be able to use PyTorch 2.7 and 2.8?

  6. ericspod commented on Sep 12, 2025

    @ericspod
    Member

    Yes, we plan on a release soon to include support along with a number of fixes.

  7. garciadias commented on Sep 19, 2025

    @garciadias
    Collaborator

    I can confirm that installing the monai-weekly solves the problem and works well with uv installations.
    I did not observe any issues, but I will run further tests today. monai-weekly

  8. garciadias commented on Sep 19, 2025

    @garciadias
    Collaborator

    Hi @ericspod,

    I further tested this by using docker image nvcr.io/nvidia/pytorch:25.08-py3 .

    To do that, I run the ./runtests.sh -u -q inside the container using the main branch and branch 6327a86, which I believe is the version deployed at monai-weekly (please confirm).

    These are the results:

    results_weekly.txt
    results_main.txt
    results_weekly_net.txt

    Basically, the tests fail with monai 1.5.0, and most of the tests pass with monai-weekly. There are a couple of issues with the former as well, but I don't think they are critical.

    Please, let me know if you want me to run any other tests.

  9. ericspod commented on Sep 19, 2025

    @ericspod
    Member

    Thanks @garciadias! The hash for weekly was probably b5bc69d but yours is close enough. I think we're sure enough that it's working with 50 series now. We'll return the question of testing hardware later.

  10. garciadias commented on Sep 19, 2025

    @garciadias
    Collaborator

    Thanks @garciadias! The hash for weekly was probably b5bc69d but yours is close enough. I think we're sure enough that it's working with 50 series now. We'll return the question of testing hardware later.

    Thank you, @ericspod . I will try that and use --net --coverage and let you know.

  11. garciadias commented on Sep 20, 2025

    @garciadias
    Collaborator

    I added the report to my previous comment. There are some errors, but nothing seems to be related to GPU, CUDA, or Torch.
    I observed many tests running with substantial GPU load. So, yes, I think monai-weekly is working fine with the 50 series.

  12. ericspod commented on Sep 26, 2025

    @ericspod
    Member

    With the release of MONAI 1.5.1 I think we can close this issue as addressed.

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

Metadata

Metadata

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