Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for higher version of Pytorch/CUDA #43

Open
Masaaki-75 opened this issue Jan 3, 2023 · 3 comments
Open

Support for higher version of Pytorch/CUDA #43

Masaaki-75 opened this issue Jan 3, 2023 · 3 comments

Comments

@Masaaki-75
Copy link

Hi.

I find torch-radon library extremely helpful in accelerating forward/backward projection.

It worked well on machines with CUDA 10.2. However, when I tried to run codes on machines with CUDA 11.x, I got the following error message:

Checking requirements
Operating System: linux OK
Python version: 3.7 OK
PyTorch: 1.1 ERROR
Precompiled packages are build for PyTorch 1.5 to 1.7
Consider manually compiling torch-radon

It turns out that this conflicts with the CUDA requirements for pytorch (1.11+), and I am wondering if there's a plan for an updated version of torch-radon that could solve this problem?

Thanks!

@roflmaostc
Copy link

Hi @matteo-ronchetti ,

installation is getting quite difficult with newer GPUs (even RTX 3060 fails early).

Do you have any plans to continue this? Would be quite sad to not have it working anymore 😢

@Masaaki-75
Copy link
Author

Masaaki-75 commented Apr 27, 2023

Can relate 😇 I've try installing it for over 10x and here are some tricks that I found may be useful:

1. Use (Updated) Precompile Packages

  • Build a virtual environment with python=3.7.
  • Use pip instead of conda to build pytorch to avoid OSError related to libcublasLt.so.11:
pip install torch==1.7.1+cu110 torchvision==0.8.2+cu110 torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html
  • Install all other packages needed for your project, but remember to select a version that supports torch==1.7 and python=3.7. For example, monai>=1.0.1 does not support torch==1.7 any more.

  • Install torch-radon v2 branch if possible, using:

wget -qO- https://raw.githubusercontent.com/matteo-ronchetti/torch-radon/v2/auto_install.py  | python -

This command is provided in Issue #23, but surprisingly the authors did not update it in the README.md.

  • If you installed v2, then import will be like:
from torch_radon.radon import FanBeam, ParallelBeam, RadonFanbeam, Radon
# ParallelBeam is the new version for Radon, and Fanbeam for RadonFanbeam

If Method 1 produces problem with version conflicts, try

2. build from source

git clone https://github.com/matteo-ronchetti/torch-radon.git
cd torch-radon
python setup.py install

This will support higher versions of cuda and pytorch (I succeeded on RTX 3090 with cuda 11.7). However, when compiling you may encounter other issues:

  • Wrong naming of variables in compiling code (in torch-radon/build_tools/__init__.py):
    image
  • some other compiling issues like compile error #46 :(

@roflmaostc
Copy link

roflmaostc commented Apr 27, 2023

Wow, cool!
Yeah in my case it failed because of the RTX 3060 which was too new for those versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants