CERN / TIGRE

TIGRE: Tomographic Iterative GPU-based Reconstruction Toolbox

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ERROR: Could not build wheels for pytigre, which is required to install pyproject.toml-based projects

AIIAAI opened this issue · comments

commented

Expected Behavior

When I try to run:pip install .

it appears:

  error: subprocess-exited-with-error
  
  × Building wheel for pytigre (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [37 lines of output]
      which: no nvcc in (/tmp/pip-build-env-sf042_vp/overlay/bin:/tmp/pip-build-env-sf042_vp/normal/bin:/users/psi/wxie/anaconda3/envs/NeRP/bin:/users/psi/wxie/anaconda3/condabin:/users/psi/wxie/anaconda3/bin:/users/psi/wxie/.vscode-server/bin/b3e4e68a0bc097f0ae7907b217c1119af9e03435/bin/remote-cli:/users/psi/wxie/anaconda3/bin:/users/psi/wxie/anaconda3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/freeware/bin/gnu-tools:/freeware/bin:/software/bin)
      running bdist_wheel
      running build
      running build_py
      file tigre/py.py (for module tigre.py) not found
      running egg_info
      writing pytigre.egg-info/PKG-INFO
      writing dependency_links to pytigre.egg-info/dependency_links.txt
      writing requirements to pytigre.egg-info/requires.txt
      writing top-level names to pytigre.egg-info/top_level.txt
      file tigre/py.py (for module tigre.py) not found
      reading manifest file 'pytigre.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no files found matching '*.ipynb' under directory 'tigre/demos'
      warning: no files found matching '*.mat' under directory 'tigre/demos'
      adding license file 'LICENSE'
      writing manifest file 'pytigre.egg-info/SOURCES.txt'
      file tigre/py.py (for module tigre.py) not found
      running build_ext
      Compiling tigre/utilities/cuda_interface/_Ax.pyx because it depends on /tmp/pip-build-env-sf042_vp/overlay/lib/python3.7/site-packages/Cython/Includes/libc/string.pxd.
      [1/1] Cythonizing tigre/utilities/cuda_interface/_Ax.pyx
      building '_Ax' extension
      gcc -pthread -B /users/psi/wxie/anaconda3/envs/NeRP/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DIS_FOR_PYTIGRE -I/tmp/pip-build-env-sf042_vp/overlay/lib/python3.7/site-packages/numpy/core/include -I/usr/local/cuda/include -I../Common/CUDA/ -I/users/psi/wxie/anaconda3/envs/NeRP/include/python3.7m -c ../Common/CUDA/GpuIds.cpp -o build/temp.linux-x86_64-cpython-37/../Common/CUDA/GpuIds.o -std=c++11
      cc1plus: warning: command-line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
      ../Common/CUDA/GpuIds.cpp: In member function ‘void GpuIds::SetAllGpus(int)’:
      ../Common/CUDA/GpuIds.cpp:44:21: warning: ignoring return value of ‘void* malloc(size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
         44 |         (int*)malloc(iTotalDeviceCount*sizeof(int));
            |               ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /usr/local/cuda/bin/nvcc -DIS_FOR_PYTIGRE -I/tmp/pip-build-env-sf042_vp/overlay/lib/python3.7/site-packages/numpy/core/include -I/usr/local/cuda/include -I../Common/CUDA/ -I/users/psi/wxie/anaconda3/envs/NeRP/include/python3.7m -c ../Common/CUDA/Siddon_projection.cu -o build/temp.linux-x86_64-cpython-37/../Common/CUDA/Siddon_projection.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -gencode=arch=compute_90,code=sm_90 -gencode=arch=compute_87,code=sm_87 -gencode=arch=compute_86,code=sm_86 -gencode=arch=compute_80,code=sm_80 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_61,code=sm_61 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_52,code=sm_52 -gencode=arch=compute_70,code=compute_70 --ptxas-options=-v -c --default-stream=per-thread -std=c++11
      In file included from /usr/local/cuda/include/cuda_runtime.h:82,
                       from <command-line>:
      /usr/local/cuda/include/crt/host_config.h:143:2: error: #error -- unsupported GNU version! gcc versions later than 12 are not 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.
        143 | #error -- unsupported GNU version! gcc versions later than 12 are not 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.
            |  ^~~~~
      /tmp/pip-build-env-sf042_vp/overlay/lib/python3.7/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /esat/vauxite/wxie/naf_cbct/TIGRE/Python/tigre/utilities/cuda_interface/_Ax.pyx
        tree = Parsing.p_module(s, pxd, full_module_name)
      error: command '/usr/local/cuda/bin/nvcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pytigre
Failed to build pytigre
ERROR: Could not build wheels for pytigre, which is required to install pyproject.toml-based projects

Specifications

  • python version: 3.7.4
  • OS: Linux version 6.5.6-200.fc38.x86_64 (mockbuild@39479204bd704ee0abe1946d2acfd6e6) (gcc (GCC) 13.2.1 20230728 (Red Hat 13.2.1-1), GNU ld version 2.39-9.fc38) # 1 SMP PREEMPT_DYNAMIC Fri Oct 6 19:02:35 UTC 2023
  • nvcc: NVIDIA (R) Cuda compiler driver
    Copyright (c) 2005-2023 NVIDIA Corporation
    Built on Tue_Aug_15_22:02:13_PDT_2023
    Cuda compilation tools, release 12.2, V12.2.140
    Build cuda_12.2.r12.2/compiler.33191640_0
commented

It appears that your installed CUDA version is incompatible with your installed GCC version, as the error message suggests:

error: #error -- unsupported GNU version! gcc versions later than 12 are not 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.

You need to find a gcc that is compatible with your CUDA version, otherwise you won't be able to compile anything CUDA. This is unfortunately not something we can control from TIGRE, NVIDIA keeps changing which GCCs they accept in every version, its hard to keep track.

commented

Thanks so much for your help! I changed a machine and I fix it! The example.py and d01_CreateGeometry.py was run smoothly. But when I try to run d02_SampleData.py. I appears:

/users/psi/wxie/anaconda3/envs/NeRP/lib/python3.7/site-packages/matplotlib/animation.py:888: UserWarning: Animation was deleted without rendering anything. This is most likely not intended. To prevent deletion, assign the Animation to a variable, e.g. anim, that exists until you have outputted the Animation using plt.show() or anim.save().
'Animation was deleted without rendering anything. This is '
Traceback (most recent call last):
File "/users/psi/wxie/anaconda3/envs/NeRP/lib/python3.7/site-packages/scipy/io/matlab/mio.py", line 39, in _open_file
return open(file_like, mode), True
FileNotFoundError: [Errno 2] No such file or directory: '/users/psi/wxie/anaconda3/envs/NeRP/lib/python3.7/site-packages/tigre/utilities/./../../data/head.mat'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "d02_SampleData.py", line 64, in
head = sample_loader.load_head_phantom(geo.nVoxel)
File "/users/psi/wxie/anaconda3/envs/NeRP/lib/python3.7/site-packages/tigre/utilities/sample_loader.py", line 16, in load_head_phantom
test_data = scipy.io.loadmat(dirname)
File "/users/psi/wxie/anaconda3/envs/NeRP/lib/python3.7/site-packages/scipy/io/matlab/mio.py", line 224, in loadmat
with _open_file_context(file_name, appendmat) as f:
File "/users/psi/wxie/anaconda3/envs/NeRP/lib/python3.7/contextlib.py", line 112, in enter
return next(self.gen)
File "/users/psi/wxie/anaconda3/envs/NeRP/lib/python3.7/site-packages/scipy/io/matlab/mio.py", line 17, in _open_file_context
f, opened = _open_file(file_like, appendmat, mode)
File "/users/psi/wxie/anaconda3/envs/NeRP/lib/python3.7/site-packages/scipy/io/matlab/mio.py", line 45, in _open_file
return open(file_like, mode), True
FileNotFoundError: [Errno 2] No such file or directory: '/users/psi/wxie/anaconda3/envs/NeRP/lib/python3.7/site-packages/tigre/utilities/./../../data/head.mat'

I don't know how can I find the'/users/psi/wxie/anaconda3/envs/NeRP/lib/python3.7/site-packages/tigre/utilities/./../../data/head.mat'?

commented

@Window-Duo This error is on us (#493), still trying to solve it, but it has an easy solution:

take the file https://github.com/CERN/TIGRE/tree/master/Common/data/head.mat and then copy it in /users/psi/wxie/anaconda3/envs/NeRP/lib/python3.7/site-packages/tigre/utilities/./../../data/head.mat

you can do it with the mv command in command line.

commented

@Window-Duo I just updated the master branch to fix this, if you can pull again and try installing again, that would be great.

commented

Hi AnderBiguri, thanks so much! It's fine now. But when I run d04_SimpleReconstruction.py, it shows:

(NeRP) [wxie@fasso demos]$ python d04_SimpleReconstruction.py
OSSART algorithm in progress.
Estimated time until completion : 00:00:48
/users/psi/wxie/anaconda3/envs/NeRP/lib/python3.7/site-packages/matplotlib/animation.py:888: UserWarning: Animation was deleted without rendering anything. This is most likely not intended. To prevent deletion, assign the Animation to a variable, e.g. anim, that exists until you have outputted the Animation using plt.show() or anim.save().
'Animation was deleted without rendering anything. This is '

And When I run d03_generateData.py ,it shows:

(NeRP) [wxie@fasso demos]$ python d03_generateData.py
/users/psi/wxie/anaconda3/envs/NeRP/lib/python3.7/site-packages/matplotlib/animation.py:888: UserWarning: Animation was deleted without rendering anything. This is most likely not intended. To prevent deletion, assign the Animation to a variable, e.g. anim, that exists until you have outputted the Animation using plt.show() or anim.save().
'Animation was deleted without rendering anything. This is

I know it's just a Warning I can ignore. But I still want to double check if it's okay and if this warning will cause some bad things when I use it in the future?

commented

@Window-Duo It seems that you are using an older version of python + matplotlib, so some displaying stuff may not work for you, but it should not stop the code from working.

commented

I got it. Thanks so much! AnderBiguri.