CERN / TIGRE

TIGRE: Tomographic Iterative GPU-based Reconstruction Toolbox
BSD 3-Clause "New" or "Revised" License
581 stars 190 forks source link

CUDA 12.4 Can not find CUDA path after successful compling #577

Open GreameLee opened 2 months ago

GreameLee commented 2 months ago

I can run it before, but when I update the cuda to 12.4 it can not find the cuda path even nvcc -V can work:

KeyError                                  Traceback (most recent call last)
Cell In[1], [line 1](vscode-notebook-cell:?execution_count=1&line=1)
----> [1](vscode-notebook-cell:?execution_count=1&line=1) import tigre
      [2](vscode-notebook-cell:?execution_count=1&line=2) import numpy as np
      [3](vscode-notebook-cell:?execution_count=1&line=3) from tigre.utilities import sample_loader

File c:\Users\Haodong_Li\AppData\Local\anaconda3\envs\sde\lib\site-packages\tigre\__init__.py:18
     [15](file:///C:/Users/Haodong_Li/AppData/Local/anaconda3/envs/sde/lib/site-packages/tigre/__init__.py:15)     os.add_dll_directory(dll_directory)
     [17](file:///C:/Users/Haodong_Li/AppData/Local/anaconda3/envs/sde/lib/site-packages/tigre/__init__.py:17)     # The user must install the CUDA Toolkit
---> [18](file:///C:/Users/Haodong_Li/AppData/Local/anaconda3/envs/sde/lib/site-packages/tigre/__init__.py:18)     cuda_bin = os.path.join(os.environ["CUDA_PATH"], "bin")
     [19](file:///C:/Users/Haodong_Li/AppData/Local/anaconda3/envs/sde/lib/site-packages/tigre/__init__.py:19)     os.add_dll_directory(cuda_bin)
     [21](file:///C:/Users/Haodong_Li/AppData/Local/anaconda3/envs/sde/lib/site-packages/tigre/__init__.py:21) from .utilities.geometry import geometry

File c:\Users\Haodong_Li\AppData\Local\anaconda3\envs\sde\lib\os.py:675, in _Environ.__getitem__(self, key)
    [672](file:///C:/Users/Haodong_Li/AppData/Local/anaconda3/envs/sde/lib/os.py:672)     value = self._data[self.encodekey(key)]
    [673](file:///C:/Users/Haodong_Li/AppData/Local/anaconda3/envs/sde/lib/os.py:673) except KeyError:
    [674](file:///C:/Users/Haodong_Li/AppData/Local/anaconda3/envs/sde/lib/os.py:674)     # raise KeyError with the original key value
--> [675](file:///C:/Users/Haodong_Li/AppData/Local/anaconda3/envs/sde/lib/os.py:675)     raise KeyError(key) from None
    [676](file:///C:/Users/Haodong_Li/AppData/Local/anaconda3/envs/sde/lib/os.py:676) return self.decodevalue(value)

KeyError: 'CUDA_PATH'
AnderBiguri commented 1 month ago

Hi I seem to have missed this. Something seems to have changed in CUDA 12.4 so I believe TIGRE is not compatible with it yet.

tsadakane commented 1 month ago

Hi @AnderBiguri , I could not reproduce this issue in my environment. I could build the latest TIGRE from a fresh workspace and run example.py

The environment variable CUDA_PATH was updated by the CUDA toolkit installer.

With CUDA 11.8 and 12.2, it failed to build TIGRE with the error

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\include\crt/host_config.h(164): fatal error C1189: #error:  -- unsupported Microsoft Visual Studio version! Only the versions between 2017 and 2022 (inclusive) are supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.

I wrote I could run example.py above, but the result looks strange as attached below, which is probably a different issue. Figure_1

AnderBiguri commented 1 month ago

@tsadakane hum, I may have screwed up something in my fix of the Wang weigths that I did yesterday... That is the FDK error.

The error you get seems to be related to MVS, but strangely you are supposed to have a supported version... the error arises from nvcc nevertheless. But then indeed @GreameLee maybe your issue has to do with how you installed CUDA, maybe its not added to CUDA_PATH.

AnderBiguri commented 4 weeks ago

@GreameLee any update on this? have you tried having a CUDA_PATH enviroment variable?