LLNL / LEAP

comprehensive library of 3D transmission Computed Tomography (CT) algorithms with Python API and fully integrated with PyTorch
https://leapct.readthedocs.io
MIT License
74 stars 8 forks source link

Installing error #67

Closed GreameLee closed 1 day ago

GreameLee commented 6 days ago

I download the LEAP, libleapct.dll and libleapct.so and try to install the pakages as instruction pip install .but this error happen:

ERROR: No .egg-info directory found in C:\Users\haodo\AppData\Local\Temp\pip-pip-egg-info-9kj7olsi

So I try to use manual_install.py to install but though all files are in right folder, this error happen:

Traceback (most recent call last):
  File "D:\anaconda\envs\SiT\Lib\site-packages\leapctype.py", line 124, in __init__
    self.libprojectors = windll.LoadLibrary(fullPath)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\anaconda\envs\SiT\Lib\ctypes\__init__.py", line 460, in LoadLibrary
    return self._dlltype(name)
           ^^^^^^^^^^^^^^^^^^^
  File "D:\anaconda\envs\SiT\Lib\ctypes\__init__.py", line 379, in __init__
    self._handle = _dlopen(self._name, mode)
f its dependencies). Try using the full path with constructor syntax.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\SiT\LEAP\demo_leapctype\d01_standard_geometries.py", line 6, in <module>
    leapct = tomographicModels()
             ^^^^^^^^^^^^^^^^^^^
  File "D:\anaconda\envs\SiT\Lib\site-packages\leapctype.py", line 126, in __init__
    self.libprojectors = ctypes.CDLL(fullPath, winmode=0)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\anaconda\envs\SiT\Lib\ctypes\__init__.py", line 379, in __init__
    self._handle = _dlopen(self._name, mode)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: Could not find module 'D:\anaconda\envs\SiT\Lib\site-packages\libleapct.dll' (or one of its dependencies). Try using the full path with constructor syntax.

OS: Windows11 Pytorch version: 2.3.1 CUDA:12.2

kylechampley commented 6 days ago

Hello, have you verified that libleapct.dll is in the folder: D:\anaconda\envs\SiT\Lib\site-packages

If it is there, then likely the reason for the error is that this DLL is looking for libraries of different versions than you have on your computer. Could be the CUDA version. Thus, the easiest thing might be to use the pip install method. Have you installed the required dependencies and followed the install directions here. Note that you need CMake (version 3.18 or newer) and Visual Studio 2019.

Please install any dependencies you don't have and try again. This time use the "-v option like this: pip install . -v

The "-v" prints out all the error messages. Please copy any error messages and send them to me. Good luck!

GreameLee commented 6 days ago

yes, I have checked the libleapct.dll is in the right folder. And I have installed CMAKE3.30 and pytorch Does the Visual studio have to be 2019 Version? I installed 2022 version

kylechampley commented 6 days ago

Yes, it does have to be 2019. Cuda does not work with the 2022 version.

kylechampley commented 5 days ago

Did you get it to compile?

GreameLee commented 5 days ago

I try to uninstall 2022 and reinstall 2019 version but it always shows there is a error like: image So I have to try with manau_install.py

kylechampley commented 5 days ago

I'm sorry, that is very annoying. Please look at issue #32 which may provide a workaround for you issue related to the fact that you are using a newer CUDA library than the one that LEAP was compile with. For the next LEAP release, I'll make sure I update to CUDA 12, so this won't be an issue.

GreameLee commented 5 days ago

so how this error happen?

Traceback (most recent call last):
  File "D:\anaconda\envs\SiT\Lib\site-packages\leapctype.py", line 124, in __init__
    self.libprojectors = windll.LoadLibrary(fullPath)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\anaconda\envs\SiT\Lib\ctypes\__init__.py", line 460, in LoadLibrary
    return self._dlltype(name)
           ^^^^^^^^^^^^^^^^^^^
  File "D:\anaconda\envs\SiT\Lib\ctypes\__init__.py", line 379, in __init__
    self._handle = _dlopen(self._name, mode)
f its dependencies). Try using the full path with constructor syntax.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\SiT\LEAP\demo_leapctype\d01_standard_geometries.py", line 6, in <module>
    leapct = tomographicModels()
             ^^^^^^^^^^^^^^^^^^^
  File "D:\anaconda\envs\SiT\Lib\site-packages\leapctype.py", line 126, in __init__
    self.libprojectors = ctypes.CDLL(fullPath, winmode=0)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\anaconda\envs\SiT\Lib\ctypes\__init__.py", line 379, in __init__
    self._handle = _dlopen(self._name, mode)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: Could not find module 'D:\anaconda\envs\SiT\Lib\site-packages\libleapct.dll' (or one of its dependencies). Try using the full path with constructor syntax.

in WINDOWS?

kylechampley commented 5 days ago

I think the key message here is at the end where it says "FileNotFoundError: Could not find module 'D:\anaconda\envs\SiT\Lib\site-packages\libleapct.dll' (or one of its dependencies)"

The "dependencies" part is the problem. I compiled LEAP with CUDA 11 and you have CUDA 12 installed on your system. To avoid this problem, you can do what was done in issue https://github.com/LLNL/LEAP/issues/32 where @LabTelc made a copy of his CUDA 12 libraries and renamed them as if they were CUDA 11 files. This seemed to work for them.

GreameLee commented 4 days ago

I got it, appreciate that. Can you great guys update the Visual Studio version from 2019 to 2022?

kylechampley commented 4 days ago

NVIDIA does not yet support Visual Studio 2022, so there is nothing I can do about this.

kylechampley commented 3 days ago

@GreameLee I added a new LEAP dll to release v1.15 that is compiled using CUDA 12.5. The file is called libleapct_cuda12.dll. Would you download this file, rename it to libleapct.dll and then retry the manual_install.py script?

kylechampley commented 3 days ago

Would you also try something else for me? I might have been wrong about VS 2022. It may actually be my fault LEAP is not compiling with VS 2022. Would you open etc\win_build.dat and change the line that says: cmake .. -G "Visual Studio 16" -DDEV_MODE=1 to this: cmake .. -G "Visual Studio 17" -DDEV_MODE=1

And then try the pip install . -v

GreameLee commented 1 day ago

Thanks for yoru help! I did not run successfully with pip install . -v but I install it with manual_install.py finally

kylechampley commented 1 day ago

Glad it worked. I'm making changes to the next release that will hopefully fix these issues. Thanks for sticking with it.