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

Failed to build cuvec #47

Open
OliJimbo opened this issue Feb 3, 2025 · 12 comments
Open

Failed to build cuvec #47

OliJimbo opened this issue Feb 3, 2025 · 12 comments
Assignees
Labels
bug Something isn't working framework

Comments

@OliJimbo
Copy link

OliJimbo commented Feb 3, 2025

Hi folks,

I've been trying to install AMYPAD and NiftyPET packages - both of which have cuvec as a dependency.

I'm using Ubuntu 22:04LTE with an NVIDIA GTX 1660.

Whenever installing cuvec is attempted I get the following error:

Building wheel for cuvec (pyproject.toml): started
        Building wheel for cuvec (pyproject.toml): finished with status 'error'
        error: subprocess-exited-with-error
      
        × Building wheel for cuvec (pyproject.toml) did not run successfully.
        │ exit code: 1
        ╰─> [28 lines of output]
            pip_system_certs: ERROR: could not register module: No module named 'wrapt'
            *** scikit-build-core 0.10.7 using CMake 3.31.4 (wheel)
            *** Configuring CMake...
            loading initial cache file /tmp/tmpocwmrgay/build/CMakeInit.txt

It seems to be failing at importing wrapt? But wrapt is definitely installed on this system (and the VE that it is running in).

I can build cuvec manually using cmake and install using make install:

This program built for x86_64-pc-linux-gnu
Report bugs to <[email protected]>
(base) hackerman@hackerman-WS-C621E-SAGE-Series:~/.../cuvec$ make install -B
[ 16%] Building CUDA object CMakeFiles/cuvec_cpython.dir/src/cpython.cu.o
[ 33%] Linking CUDA shared library libcuvec_cpython.so
[ 33%] Built target cuvec_cpython
[ 50%] Building CUDA object src/example_cpython/CMakeFiles/example_cpython.dir/example_mod.cu.o
[ 66%] Linking CUDA shared module libexample_cpython.so
[ 66%] Built target example_cpython
[ 83%] Building CUDA object src/example_swig/CMakeFiles/example_swig.dir/example_swig.cu.o
[100%] Linking CUDA shared module libexample_swig.so
[100%] Built target example_swig

so it seems to be an issue with the pip installation pipeline.

pip install . --verbose
Using pip 25.0 from /home/hackerman/miniconda3/lib/python3.12/site-packages/pip (python 3.12)
Processing /home/hackerman/CuVec
  Running command pip subprocess to install build dependencies
  Using pip 25.0 from /home/hackerman/miniconda3/lib/python3.12/site-packages/pip (python 3.12)
  Collecting setuptools_scm>=7
    Obtaining dependency information for setuptools_scm>=7 from https://files.pythonhosted.org/packages/a0/b9/1906bfeb30f2fc13bb39bf7ddb8749784c05faadbd18a21cf141ba37bff2/setuptools_scm-8.1.0-py3-none-any.whl.metadata
    Downloading setuptools_scm-8.1.0-py3-none-any.whl.metadata (6.6 kB)
  Collecting scikit-build-core>=0.5 (from scikit-build-core[pyproject]>=0.5)
    Obtaining dependency information for scikit-build-core>=0.5 from https://files.pythonhosted.org/packages/88/fe/90476c4f6a1b2f922efa00d26e876dd40c7279e28ec18f08f0851ad21ba6/scikit_build_core-0.10.7-py3-none-any.whl.metadata
    Downloading scikit_build_core-0.10.7-py3-none-any.whl.metadata (21 kB)
  Collecting swig>=4
    Obtaining dependency information for swig>=4 from https://files.pythonhosted.org/packages/11/56/b3503019d00b2cd8bb8e770cc7ac8108a1dfba8d38fc4d16c4259d7ea914/swig-4.3.0-py2.py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl.metadata
    Downloading swig-4.3.0-py2.py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl.metadata (3.5 kB)
  Collecting pybind11
    Obtaining dependency information for pybind11 from https://files.pythonhosted.org/packages/13/2f/0f24b288e2ce56f51c920137620b4434a38fd80583dbbe24fc2a1656c388/pybind11-2.13.6-py3-none-any.whl.metadata
    Downloading pybind11-2.13.6-py3-none-any.whl.metadata (9.5 kB)
  Collecting packaging>=20 (from setuptools_scm>=7)
    Obtaining dependency information for packaging>=20 from https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl.metadata
    Downloading packaging-24.2-py3-none-any.whl.metadata (3.2 kB)
  Collecting setuptools (from setuptools_scm>=7)
    Obtaining dependency information for setuptools from https://files.pythonhosted.org/packages/69/8a/b9dc7678803429e4a3bc9ba462fa3dd9066824d3c607490235c6a796be5a/setuptools-75.8.0-py3-none-any.whl.metadata
    Downloading setuptools-75.8.0-py3-none-any.whl.metadata (6.7 kB)
  Collecting pathspec>=0.10.1 (from scikit-build-core>=0.5->scikit-build-core[pyproject]>=0.5)
    Obtaining dependency information for pathspec>=0.10.1 from https://files.pythonhosted.org/packages/cc/20/ff623b09d963f88bfde16306a54e12ee5ea43e9b597108672ff3a408aad6/pathspec-0.12.1-py3-none-any.whl.metadata
    Downloading pathspec-0.12.1-py3-none-any.whl.metadata (21 kB)
  Downloading setuptools_scm-8.1.0-py3-none-any.whl (43 kB)
  Downloading scikit_build_core-0.10.7-py3-none-any.whl (165 kB)
  Downloading swig-4.3.0-py2.py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.9/1.9 MB 40.0 MB/s eta 0:00:00
  Downloading pybind11-2.13.6-py3-none-any.whl (243 kB)
  Downloading packaging-24.2-py3-none-any.whl (65 kB)
  Downloading pathspec-0.12.1-py3-none-any.whl (31 kB)
  Downloading setuptools-75.8.0-py3-none-any.whl (1.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 23.8 MB/s eta 0:00:00
  Installing collected packages: swig, setuptools, pybind11, pathspec, packaging, setuptools_scm, scikit-build-core
    Creating /tmp/pip-build-env-b3cu9dfq/overlay/bin
    changing mode of /tmp/pip-build-env-b3cu9dfq/overlay/bin/swig to 775
    changing mode of /tmp/pip-build-env-b3cu9dfq/overlay/bin/swig4.0 to 775
    changing mode of /tmp/pip-build-env-b3cu9dfq/overlay/bin/pybind11-config to 775
  ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
  amypet 1.6.0 requires nimpa, which is not installed.
  Successfully installed packaging-24.2 pathspec-0.12.1 pybind11-2.13.6 scikit-build-core-0.10.7 setuptools-75.8.0 setuptools_scm-8.1.0 swig-4.3.0
  Installing build dependencies ... done
  Running command Getting requirements to build wheel
  Could not determine CMake version via --version, got "pip_system_certs: ERROR: could not register module: No module named 'wrapt'\n" 'Traceback (most recent call last):\n  File "/home/hackerman/miniconda3/bin/cmake", line 5, in <module>\n    from cmake import cmake\nModuleNotFoundError: No module named \'cmake\'\n'
  pip_system_certs: ERROR: could not register module: No module named 'wrapt'
  Getting requirements to build wheel ... done
  Running command pip subprocess to install backend dependencies
  Using pip 25.0 from /home/hackerman/miniconda3/lib/python3.12/site-packages/pip (python 3.12)
  Collecting cmake>=3.24
    Obtaining dependency information for cmake>=3.24 from https://files.pythonhosted.org/packages/e5/9e/2594d7fa8b263296497bf044469b4ab4797c51675ea629f9672011cdfe09/cmake-3.31.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
    Downloading cmake-3.31.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.5 kB)
  Downloading cmake-3.31.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (27.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 27.8/27.8 MB 63.7 MB/s eta 0:00:00
  Installing collected packages: cmake
    Creating /tmp/pip-build-env-b3cu9dfq/normal/bin
    changing mode of /tmp/pip-build-env-b3cu9dfq/normal/bin/ccmake to 775
    changing mode of /tmp/pip-build-env-b3cu9dfq/normal/bin/cmake to 775
    changing mode of /tmp/pip-build-env-b3cu9dfq/normal/bin/cpack to 775
    changing mode of /tmp/pip-build-env-b3cu9dfq/normal/bin/ctest to 775
  Successfully installed cmake-3.31.4
  Installing backend dependencies ... done
  Running command Preparing metadata (pyproject.toml)
  pip_system_certs: ERROR: could not register module: No module named 'wrapt'
  *** scikit-build-core 0.10.7 using CMake 3.31.4 (metadata_wheel)
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy in /home/hackerman/miniconda3/lib/python3.12/site-packages (from cuvec==6.0.1.dev5+g01a42d4) (1.26.4)
Building wheels for collected packages: cuvec
  Running command Building wheel for cuvec (pyproject.toml)
  pip_system_certs: ERROR: could not register module: No module named 'wrapt'
  *** scikit-build-core 0.10.7 using CMake 3.31.4 (wheel)
  *** Configuring CMake...
  loading initial cache file /tmp/tmpfo5iqwqr/build/CMakeInit.txt
  -- The C compiler identification is GNU 11.4.0
  -- The CXX compiler identification is GNU 11.4.0
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /usr/bin/gcc - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /usr/bin/g++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  CMake Error at /tmp/pip-build-env-b3cu9dfq/normal/lib/python3.12/site-packages/cmake/data/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
    Could NOT find Python (missing: Interpreter Development.Module) (found
    version "3.12.8")
  Call Stack (most recent call first):
    /tmp/pip-build-env-b3cu9dfq/normal/lib/python3.12/site-packages/cmake/data/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
    /tmp/pip-build-env-b3cu9dfq/normal/lib/python3.12/site-packages/cmake/data/share/cmake-3.31/Modules/FindPython.cmake:673 (find_package_handle_standard_args)
    CMakeLists.txt:16 (find_package)


  -- Configuring incomplete, errors occurred!

  *** CMake configuration failed
  error: subprocess-exited-with-error
  
  × Building wheel for cuvec (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /home/hackerman/miniconda3/bin/python /home/hackerman/miniconda3/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /tmp/tmp6q4evkjb
  cwd: /home/hackerman/CuVec
  Building wheel for cuvec (pyproject.toml) ... error
  ERROR: Failed building wheel for cuvec
Failed to build cuvec
ERROR: Failed to build installable wheels for some pyproject.toml based projects (cuvec)

Can anyone see where I might be going wrong here?

Many thanks!

Oli

casperdcl added a commit that referenced this issue Feb 3, 2025
@casperdcl
Copy link
Member

Could you try pip install "git+https://github.com/AMYPAD/CuVec@wrapt" and post the output here?

casperdcl added a commit that referenced this issue Feb 3, 2025
@casperdcl casperdcl self-assigned this Feb 3, 2025
@casperdcl casperdcl added bug Something isn't working framework labels Feb 3, 2025
@OliJimbo
Copy link
Author

OliJimbo commented Feb 3, 2025

Hello! Of course - thanks for replying! Please see below:

pip install "git+https://github.com/AMYPAD/CuVec@wrapt" 
Collecting git+https://github.com/AMYPAD/CuVec@wrapt
  Cloning https://github.com/AMYPAD/CuVec (to revision wrapt) to /tmp/pip-req-build-lcpv2lns
  Running command git clone --filter=blob:none --quiet https://github.com/AMYPAD/CuVec /tmp/pip-req-build-lcpv2lns
  Running command git checkout -b wrapt --track origin/wrapt
  Switched to a new branch 'wrapt'
  Branch 'wrapt' set up to track remote branch 'wrapt' from 'origin'.
  Resolved https://github.com/AMYPAD/CuVec to commit de4039b4f1983c186a6ffe14ee230be096dc2e6a
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy in /home/hackerman/miniconda3/lib/python3.12/site-packages (from cuvec==6.0.1.dev11+gde4039b) (1.26.4)
Building wheels for collected packages: cuvec
  Building wheel for cuvec (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for cuvec (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [72 lines of output]
      *** scikit-build-core 0.10.7 using CMake 3.31.4 (wheel)
      *** Configuring CMake...
      loading initial cache file /tmp/tmpx39o1xgg/build/CMakeInit.txt
      -- The C compiler identification is GNU 11.4.0
      -- The CXX compiler identification is GNU 11.4.0
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /usr/bin/gcc - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /usr/bin/g++ - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Found Python: /home/hackerman/miniconda3/bin/python (found version "3.12.8") found components: Interpreter Development.Module
      -- Found CUDAToolkit: /usr/include (found version "11.5.119")
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
      -- Found Threads: TRUE
      -- The CUDA compiler identification is NVIDIA 11.5.119 with host compiler GNU 11.4.0
      -- Detecting CUDA compiler ABI info
      -- Detecting CUDA compiler ABI info - done
      -- Check for working CUDA compiler: /usr/bin/nvcc - skipped
      -- Detecting CUDA compile features
      -- Detecting CUDA compile features - done
      -- Performing Test HAS_FLTO
      -- Performing Test HAS_FLTO - Success
      -- Found pybind11: /home/hackerman/miniconda3/lib/python3.12/site-packages/pybind11/include (found version "2.13.6")
      -- Found SWIG: /tmp/pip-build-env-cx7kpnfc/overlay/bin/swig4.0 (found suitable version "4.2.1", minimum required is "4.0")
      -- CUDA architectures: native
      -- Build type: Release
      -- CuVec debugging: FALSE
      -- Configuring done (10.2s)
      -- Generating done (0.0s)
      -- Build files have been written to: /tmp/tmpx39o1xgg/build
      *** Building project with Ninja...
      [1/15] Swig compile /tmp/pip-req-build-lcpv2lns/cuvec/src/example_swig/example_swig.i for python
      [2/15] Swig compile src/cuvec_swig.i for python
      [3/15] Building CXX object src/example_swig/CMakeFiles/example_swig.dir/tmp/tmpx39o1xgg/wheel/platlib/cuvec/example_swigPYTHON_wrap.cxx.o
      [4/15] Building CUDA object src/example_swig/CMakeFiles/example_swig.dir/example_swig.cu.o
      [5/15] Linking CXX shared module src/example_swig/_example_swig.cpython-312-x86_64-linux-gnu.so
      [6/15] Building CUDA object src/example_cpython/CMakeFiles/example_cpython.dir/example_mod.cu.o
      [7/15] Linking CUDA shared module src/example_cpython/example_cpython.cpython-312-x86_64-linux-gnu.so
      [8/15] Building CUDA object CMakeFiles/cuvec_cpython.dir/src/cpython.cu.o
      [9/15] Linking CUDA shared module cuvec_cpython.cpython-312-x86_64-linux-gnu.so
      [10/15] Building CUDA object src/example_pybind11/CMakeFiles/example_pybind11.dir/example_pybind11.cu.o
      FAILED: src/example_pybind11/CMakeFiles/example_pybind11.dir/example_pybind11.cu.o
      /usr/bin/nvcc -forward-unknown-to-host-compiler -Dexample_pybind11_EXPORTS -I/tmp/pip-req-build-lcpv2lns/cuvec/src -I/tmp/pip-req-build-lcpv2lns/cuvec/include -isystem /home/hackerman/miniconda3/include/python3.12 -isystem /home/hackerman/miniconda3/lib/python3.12/site-packages/pybind11/include -O3 -DNDEBUG -std=c++11 "--generate-code=arch=compute_75,code=[sm_75]" -Xcompiler=-fPIC -Xcompiler=-fvisibility=hidden -MD -MT src/example_pybind11/CMakeFiles/example_pybind11.dir/example_pybind11.cu.o -MF src/example_pybind11/CMakeFiles/example_pybind11.dir/example_pybind11.cu.o.d -x cu -c /tmp/pip-req-build-lcpv2lns/cuvec/src/example_pybind11/example_pybind11.cu -o src/example_pybind11/CMakeFiles/example_pybind11.dir/example_pybind11.cu.o
      /usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’:
        435 |         function(_Functor&& __f)
            |                                                                                                                                                 ^
      /usr/include/c++/11/bits/std_function.h:435:145: note:         ‘_ArgTypes’
      /usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘...’:
        530 |         operator=(_Functor&& __f)
            |                                                                                                                                                  ^
      /usr/include/c++/11/bits/std_function.h:530:146: note:         ‘_ArgTypes’
      [11/15] Building CXX object CMakeFiles/cuvec_swig.dir/tmp/tmpx39o1xgg/wheel/platlib/cuvec/cuvec_swigPYTHON_wrap.cxx.o
      [12/15] Building CUDA object CMakeFiles/cuvec_pybind11.dir/src/pybind11.cu.o
      FAILED: CMakeFiles/cuvec_pybind11.dir/src/pybind11.cu.o
      /usr/bin/nvcc -forward-unknown-to-host-compiler -Dcuvec_pybind11_EXPORTS -I/tmp/pip-req-build-lcpv2lns/cuvec/src -I/tmp/pip-req-build-lcpv2lns/cuvec/include -isystem /home/hackerman/miniconda3/include/python3.12 -isystem /home/hackerman/miniconda3/lib/python3.12/site-packages/pybind11/include -O3 -DNDEBUG -std=c++11 "--generate-code=arch=compute_75,code=[sm_75]" -Xcompiler=-fPIC -Xcompiler=-fvisibility=hidden -MD -MT CMakeFiles/cuvec_pybind11.dir/src/pybind11.cu.o -MF CMakeFiles/cuvec_pybind11.dir/src/pybind11.cu.o.d -x cu -c /tmp/pip-req-build-lcpv2lns/cuvec/src/pybind11.cu -o CMakeFiles/cuvec_pybind11.dir/src/pybind11.cu.o
      /usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’:
        435 |         function(_Functor&& __f)
            |                                                                                                                                                 ^
      /usr/include/c++/11/bits/std_function.h:435:145: note:         ‘_ArgTypes’
      /usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘...’:
        530 |         operator=(_Functor&& __f)
            |                                                                                                                                                  ^
      /usr/include/c++/11/bits/std_function.h:530:146: note:         ‘_ArgTypes’
      ninja: build stopped: subcommand failed.
      
      *** CMake build failed
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for cuvec
Failed to build cuvec
ERROR: Failed to build installable wheels for some pyproject.toml based projects (cuvec)

@casperdcl
Copy link
Member

interesting... based on NVlabs/instant-ngp#119 this looks like a compiler version issue.

@OliJimbo
Copy link
Author

OliJimbo commented Feb 4, 2025

Indeed!
It might be something dumb that I've done.

I've just purged cuda from my system and reinstalled the runtime (version 12.8) and toolkit (11.5.1) and am still getting the same error (will repeat below just in case there's a subtle difference!).

If it's of any help at all, I can get everything working using the docker image that you uploaded on a previous issue. https://github.com/NiftyPET/NIPET/pkgs/container/nipet

BW

Oli

pip install "git+https://github.com/AMYPAD/CuVec@wrapt"
Collecting git+https://github.com/AMYPAD/CuVec@wrapt
  Cloning https://github.com/AMYPAD/CuVec (to revision wrapt) to /tmp/pip-req-build-gspoho8_
  Running command git clone --filter=blob:none --quiet https://github.com/AMYPAD/CuVec /tmp/pip-req-build-gspoho8_
  Running command git checkout -b wrapt --track origin/wrapt
  Switched to a new branch 'wrapt'
  Branch 'wrapt' set up to track remote branch 'wrapt' from 'origin'.
  Resolved https://github.com/AMYPAD/CuVec to commit de4039b4f1983c186a6ffe14ee230be096dc2e6a
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy in ./miniconda3/lib/python3.12/site-packages (from cuvec==6.0.1.dev11+gde4039b) (1.26.4)
Building wheels for collected packages: cuvec
  Building wheel for cuvec (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for cuvec (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [72 lines of output]
      *** scikit-build-core 0.10.7 using CMake 3.31.4 (wheel)
      *** Configuring CMake...
      loading initial cache file /tmp/tmppnv5xb02/build/CMakeInit.txt
      -- The C compiler identification is GNU 11.4.0
      -- The CXX compiler identification is GNU 11.4.0
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /usr/bin/gcc - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /usr/bin/g++ - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Found Python: /home/hackerman/miniconda3/bin/python (found version "3.12.8") found components: Interpreter Development.Module
      -- Found CUDAToolkit: /usr/include (found version "11.5.119")
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
      -- Found Threads: TRUE
      -- The CUDA compiler identification is NVIDIA 11.5.119 with host compiler GNU 11.4.0
      -- Detecting CUDA compiler ABI info
      -- Detecting CUDA compiler ABI info - done
      -- Check for working CUDA compiler: /usr/bin/nvcc - skipped
      -- Detecting CUDA compile features
      -- Detecting CUDA compile features - done
      -- Performing Test HAS_FLTO
      -- Performing Test HAS_FLTO - Success
      -- Found pybind11: /home/hackerman/miniconda3/lib/python3.12/site-packages/pybind11/include (found version "2.13.6")
      -- Found SWIG: /tmp/pip-build-env-44powxr2/overlay/bin/swig4.0 (found suitable version "4.2.1", minimum required is "4.0")
      -- CUDA architectures: native
      -- Build type: Release
      -- CuVec debugging: FALSE
      -- Configuring done (10.2s)
      -- Generating done (0.0s)
      -- Build files have been written to: /tmp/tmppnv5xb02/build
      *** Building project with Ninja...
      [1/15] Swig compile /tmp/pip-req-build-gspoho8_/cuvec/src/example_swig/example_swig.i for python
      [2/15] Swig compile src/cuvec_swig.i for python
      [3/15] Building CXX object src/example_swig/CMakeFiles/example_swig.dir/tmp/tmppnv5xb02/wheel/platlib/cuvec/example_swigPYTHON_wrap.cxx.o
      [4/15] Building CUDA object src/example_swig/CMakeFiles/example_swig.dir/example_swig.cu.o
      [5/15] Linking CXX shared module src/example_swig/_example_swig.cpython-312-x86_64-linux-gnu.so
      [6/15] Building CUDA object src/example_cpython/CMakeFiles/example_cpython.dir/example_mod.cu.o
      [7/15] Linking CUDA shared module src/example_cpython/example_cpython.cpython-312-x86_64-linux-gnu.so
      [8/15] Building CUDA object CMakeFiles/cuvec_cpython.dir/src/cpython.cu.o
      [9/15] Linking CUDA shared module cuvec_cpython.cpython-312-x86_64-linux-gnu.so
      [10/15] Building CUDA object src/example_pybind11/CMakeFiles/example_pybind11.dir/example_pybind11.cu.o
      FAILED: src/example_pybind11/CMakeFiles/example_pybind11.dir/example_pybind11.cu.o
      /usr/bin/nvcc -forward-unknown-to-host-compiler -Dexample_pybind11_EXPORTS -I/tmp/pip-req-build-gspoho8_/cuvec/src -I/tmp/pip-req-build-gspoho8_/cuvec/include -isystem /home/hackerman/miniconda3/include/python3.12 -isystem /home/hackerman/miniconda3/lib/python3.12/site-packages/pybind11/include -O3 -DNDEBUG -std=c++11 "--generate-code=arch=compute_75,code=[sm_75]" -Xcompiler=-fPIC -Xcompiler=-fvisibility=hidden -MD -MT src/example_pybind11/CMakeFiles/example_pybind11.dir/example_pybind11.cu.o -MF src/example_pybind11/CMakeFiles/example_pybind11.dir/example_pybind11.cu.o.d -x cu -c /tmp/pip-req-build-gspoho8_/cuvec/src/example_pybind11/example_pybind11.cu -o src/example_pybind11/CMakeFiles/example_pybind11.dir/example_pybind11.cu.o
      /usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’:
        435 |         function(_Functor&& __f)
            |                                                                                                                                                 ^
      /usr/include/c++/11/bits/std_function.h:435:145: note:         ‘_ArgTypes’
      /usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘...’:
        530 |         operator=(_Functor&& __f)
            |                                                                                                                                                  ^
      /usr/include/c++/11/bits/std_function.h:530:146: note:         ‘_ArgTypes’
      [11/15] Building CXX object CMakeFiles/cuvec_swig.dir/tmp/tmppnv5xb02/wheel/platlib/cuvec/cuvec_swigPYTHON_wrap.cxx.o
      [12/15] Building CUDA object CMakeFiles/cuvec_pybind11.dir/src/pybind11.cu.o
      FAILED: CMakeFiles/cuvec_pybind11.dir/src/pybind11.cu.o
      /usr/bin/nvcc -forward-unknown-to-host-compiler -Dcuvec_pybind11_EXPORTS -I/tmp/pip-req-build-gspoho8_/cuvec/src -I/tmp/pip-req-build-gspoho8_/cuvec/include -isystem /home/hackerman/miniconda3/include/python3.12 -isystem /home/hackerman/miniconda3/lib/python3.12/site-packages/pybind11/include -O3 -DNDEBUG -std=c++11 "--generate-code=arch=compute_75,code=[sm_75]" -Xcompiler=-fPIC -Xcompiler=-fvisibility=hidden -MD -MT CMakeFiles/cuvec_pybind11.dir/src/pybind11.cu.o -MF CMakeFiles/cuvec_pybind11.dir/src/pybind11.cu.o.d -x cu -c /tmp/pip-req-build-gspoho8_/cuvec/src/pybind11.cu -o CMakeFiles/cuvec_pybind11.dir/src/pybind11.cu.o
      /usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’:
        435 |         function(_Functor&& __f)
            |                                                                                                                                                 ^
      /usr/include/c++/11/bits/std_function.h:435:145: note:         ‘_ArgTypes’
      /usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘...’:
        530 |         operator=(_Functor&& __f)
            |                                                                                                                                                  ^
      /usr/include/c++/11/bits/std_function.h:530:146: note:         ‘_ArgTypes’
      ninja: build stopped: subcommand failed.
      
      *** CMake build failed
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for cuvec
Failed to build cuvec
ERROR: Failed to build installable wheels for some pyproject.toml based projects (cuvec)

@casperdcl
Copy link
Member

casperdcl commented Feb 4, 2025

But from the linked issue, I gather trying a different gcc/g++ version might help.

@OliJimbo
Copy link
Author

OliJimbo commented Feb 4, 2025

I'm using 11, but tried 12 yesterday but that didn't seem to help. Can try again though

@casperdcl
Copy link
Member

casperdcl commented Feb 4, 2025

What about gcc 10?

@OliJimbo
Copy link
Author

OliJimbo commented Feb 4, 2025

I downgraded gcc and gpp (just doing gcc led to cplus.1 not being found?).
Now I'm getting a cuda compiler error - I did try reinstalling (--force-reinstall) but got the same error:

pip install "git+https://github.com/AMYPAD/CuVec@wrapt"
Collecting git+https://github.com/AMYPAD/CuVec@wrapt
  Cloning https://github.com/AMYPAD/CuVec (to revision wrapt) to /tmp/pip-req-build-7tcmdj6y
  Running command git clone --filter=blob:none --quiet https://github.com/AMYPAD/CuVec /tmp/pip-req-build-7tcmdj6y
  Running command git checkout -b wrapt --track origin/wrapt
  Switched to a new branch 'wrapt'
  Branch 'wrapt' set up to track remote branch 'wrapt' from 'origin'.
  Resolved https://github.com/AMYPAD/CuVec to commit de4039b4f1983c186a6ffe14ee230be096dc2e6a
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy in /home/hackerman/miniconda3/lib/python3.12/site-packages (from cuvec==6.0.1.dev11+gde4039b) (1.26.4)
Building wheels for collected packages: cuvec
  Building wheel for cuvec (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for cuvec (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [118 lines of output]
      *** scikit-build-core 0.10.7 using CMake 3.31.4 (wheel)
      *** Configuring CMake...
      loading initial cache file /tmp/tmpiszr_zvs/build/CMakeInit.txt
      -- The C compiler identification is GNU 10.5.0
      -- The CXX compiler identification is GNU 10.5.0
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /usr/bin/gcc - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /usr/bin/g++ - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Found Python: /home/hackerman/miniconda3/bin/python (found version "3.12.8") found components: Interpreter Development.Module
      -- Found CUDAToolkit: /usr/include (found version "11.5.119")
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
      -- Found Threads: TRUE
      CMake Error at /tmp/pip-build-env-6d9lb5hr/normal/lib/python3.12/site-packages/cmake/data/share/cmake-3.31/Modules/CMakeDetermineCompilerId.cmake:865 (message):
        Compiling the CUDA compiler identification source file
        "CMakeCUDACompilerId.cu" failed.
      
        Compiler: /usr/bin/nvcc
      
        Build flags:
      
        Id flags: --keep;--keep-dir;tmp -v
      
      
      
        The output was:
      
        1
      
        #$ _NVVM_BRANCH_=nvvm
      
        #$ _SPACE_=
      
        #$ _CUDART_=cudart
      
        #$ _HERE_=/usr/lib/nvidia-cuda-toolkit/bin
      
        #$ _THERE_=/usr/lib/nvidia-cuda-toolkit/bin
      
        #$ _TARGET_SIZE_=
      
        #$ _TARGET_DIR_=
      
        #$ _TARGET_SIZE_=64
      
        #$ NVVMIR_LIBRARY_DIR=/usr/lib/nvidia-cuda-toolkit/libdevice
      
        #$
        PATH=/usr/lib/nvidia-cuda-toolkit/bin:/tmp/pip-build-env-6d9lb5hr/overlay/bin:/tmp/pip-build-env-6d9lb5hr/normal/bin:/home/hackerman/ants-2.5.2/bin:/usr/local/MATLAB/R2023b/bin:/home/hackerman/perl5/bin:/home/hackerman/miniconda3/bin:/home/hackerman/miniconda3/condabin:/home/hackerman/.juliaup/bin:/usr/local/fsl/share/fsl/bin:/usr/local/fsl/share/fsl/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/hackerman/abin:/home/hackerman/abin:
      
      
        #$ LIBRARIES= -L/usr/lib/x86_64-linux-gnu/stubs -L/usr/lib/x86_64-linux-gnu
      
        #$ rm tmp/a_dlink.reg.c
      
        #$ gcc -D__CUDA_ARCH__=520 -D__CUDA_ARCH_LIST__=520 -E -x c++
        -DCUDA_DOUBLE_MATH_FUNCTIONS -D__CUDACC__ -D__NVCC__
        -D__CUDACC_VER_MAJOR__=11 -D__CUDACC_VER_MINOR__=5
        -D__CUDACC_VER_BUILD__=119 -D__CUDA_API_VER_MAJOR__=11
        -D__CUDA_API_VER_MINOR__=5 -D__NVCC_DIAG_PRAGMA_SUPPORT__=1 -include
        "cuda_runtime.h" -m64 "CMakeCUDACompilerId.cu" -o
        "tmp/CMakeCUDACompilerId.cpp1.ii"
      
        #$ cicc --c++14 --gnu_version=100500 --display_error_number
        --orig_src_file_name "CMakeCUDACompilerId.cu" --orig_src_path_name
        "/tmp/tmpiszr_zvs/build/CMakeFiles/3.31.4/CompilerIdCUDA/CMakeCUDACompilerId.cu"
        --allow_managed -arch compute_52 -m64 --no-version-ident -ftz=0 -prec_div=1
        -prec_sqrt=1 -fmad=1 --include_file_name "CMakeCUDACompilerId.fatbin.c"
        -tused --gen_module_id_file --module_id_file_name
        "tmp/CMakeCUDACompilerId.module_id" --gen_c_file_name
        "tmp/CMakeCUDACompilerId.cudafe1.c" --stub_file_name
        "tmp/CMakeCUDACompilerId.cudafe1.stub.c" --gen_device_file_name
        "tmp/CMakeCUDACompilerId.cudafe1.gpu" "tmp/CMakeCUDACompilerId.cpp1.ii" -o
        "tmp/CMakeCUDACompilerId.ptx"
      
        /usr/include/c++/11/bits/stl_pair.h(460): error: argument list for class
        template "std::pair" is missing
      
      
      
        /usr/include/c++/11/bits/stl_pair.h(460): error: expected a ")"
      
      
      
        /usr/include/c++/11/bits/stl_pair.h(460): error: template parameter "_T1"
        may not be redeclared in this scope
      
      
      
        /usr/include/c++/11/bits/stl_pair.h(460): error: expected a ";"
      
      
      
        4 errors detected in the compilation of "CMakeCUDACompilerId.cu".
      
        # --error 0x1 --
      
      
      
      
      
      Call Stack (most recent call first):
        /tmp/pip-build-env-6d9lb5hr/normal/lib/python3.12/site-packages/cmake/data/share/cmake-3.31/Modules/CMakeDetermineCompilerId.cmake:8 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
        /tmp/pip-build-env-6d9lb5hr/normal/lib/python3.12/site-packages/cmake/data/share/cmake-3.31/Modules/CMakeDetermineCompilerId.cmake:53 (__determine_compiler_id_test)
        /tmp/pip-build-env-6d9lb5hr/normal/lib/python3.12/site-packages/cmake/data/share/cmake-3.31/Modules/CMakeDetermineCUDACompiler.cmake:131 (CMAKE_DETERMINE_COMPILER_ID)
        CMakeLists.txt:23 (enable_language)
      
      
      -- Configuring incomplete, errors occurred!
      
      *** CMake configuration failed
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for cuvec
Failed to build cuvec


@casperdcl
Copy link
Member

I'm unsure what's wrong with your system... the docker image has:

root@niftypet:/# gcc --version
gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0

root@niftypet:/# nvcc --version
Built on Tue_Jun_13_19:16:58_PDT_2023
Cuda compilation tools, release 12.2, V12.2.91
Build cuda_12.2.r12.2/compiler.32965470_0

root@niftypet:/# python --version
Python 3.10.12

@OliJimbo
Copy link
Author

OliJimbo commented Feb 5, 2025

OK - I've tried a VE with the same config as that and am still having problems - so it's likely an issue with my environment. I'll try reinstalling ubuntu and see if it works then.
Thanks!
Oli

@casperdcl
Copy link
Member

Based on NVIDIA/nccl#650 perhaps modifying the system headers or forcing GCC 10?

pip install -Ccmake.define.CMAKE_C_COMPILER=gcc-10 -Ccmake.define.CMAKE_CXX_COMPILER=g++-10 "git+https://github.com/AMYPAD/CuVec@wrapt"

@OliJimbo
Copy link
Author

OliJimbo commented Feb 6, 2025

OK! Go there.

So forcing gcc-10 did not work - however I commented out the suggested lines in usr/include/c++/*/bits/std_function.h (this comment NVIDIA/nccl#650 (comment)).

However I could only find these lines in usr/include/c++/11/bits/std_function.h and not /10/bits - so I then removed all traces of cuvec from site packages and ran the following successfully:

pip install -Ccmake.define.CMAKE_C_COMPILER=gcc-11 -Ccmake.define.CMAKE_CXX_COMPILER=g++-11 "git+https://github.com/AMYPAD/CuVec@wrapt"
Collecting git+https://github.com/AMYPAD/CuVec@wrapt
  Cloning https://github.com/AMYPAD/CuVec (to revision wrapt) to /tmp/pip-req-build-yzl3cjru
  Running command git clone --filter=blob:none --quiet https://github.com/AMYPAD/CuVec /tmp/pip-req-build-yzl3cjru
  Running command git checkout -b wrapt --track origin/wrapt
  Switched to a new branch 'wrapt'
  Branch 'wrapt' set up to track remote branch 'wrapt' from 'origin'.
  Resolved https://github.com/AMYPAD/CuVec to commit de4039b4f1983c186a6ffe14ee230be096dc2e6a
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy in ./miniconda3/lib/python3.12/site-packages (from cuvec==6.0.1.dev11+gde4039b) (2.2.2)
Building wheels for collected packages: cuvec
  Building wheel for cuvec (pyproject.toml) ... done
  Created wheel for cuvec: filename=cuvec-6.0.1.dev11+gde4039b-cp312-cp312-linux_x86_64.whl size=1568613 sha256=03adcd8f25f17b4c78b0d3cfb04459fe3dff77c1013e890185824a5fd7815c4c
  Stored in directory: /tmp/pip-ephem-wheel-cache-z2i21y5s/wheels/a0/58/e6/8b148e9ee8fce385a8af11eec987ca09e389088d4a232b21a3
Successfully built cuvec
Installing collected packages: cuvec
Successfully installed cuvec-6.0.1.dev11+gde4039b

Not sure what the long term solution is - but I am now up and running - thanks very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working framework
Projects
None yet
Development

No branches or pull requests

2 participants