Skip to content

[BUG]: Error when building from sources #731

Closed as duplicate
Closed as duplicate

Description

@BwL1289

Is this a duplicate?

Type of Bug

Compile-time Error

Component

cuda.bindings

Describe the bug

When compiling from sources, I encounter:

cuda/bindings/_lib/cyruntime/cyruntime.cpp:52397:115: error: cannot initialize a parameter of type 'cuuint64_t *' (aka 'unsigned long *') with an lvalue of type 'unsigned long long *'
   52397 |   __pyx_t_3 = __pyx_f_4cuda_8bindings_9_bindings_8cydriver__cuGraphExecGetFlags(((CUgraphExec)__pyx_v_graphExec), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((CUresult)CUDA_ERROR_NOT_FOUND) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3814, __pyx_L1_error)
         |                                                                                                                   ^~~~~~~~~~~~~
  1 error generated.
  error: command '/opt/llvm_toolchain/bin/clang++' failed with exit code 1
  error: subprocess-exited-with-error
  
  × Building wheel for cuda-python (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

It seems to be due to a C++ type‐mismatch in the Cython‐generated binding for cuGraphExecGetFlags(CUgraphExec, cuuint64_t* flags) vs. the real CUDA header, which expects CUgraphExecGetFlags(CUgraphExec, unsigned long long* flags)

I have not been able to figure out a workaround yet.

How to Reproduce

  1. Build from sources
  2. Attempt to compile cuda-bindings
  3. See error

Expected behavior

Compilation succeeds.

Operating System

No response

nvidia-smi output

No response

Activity

  1. leofang commented on Jun 27, 2025

    @leofang
    Member

    Could you attach the full build log like what you did in #732?

  2. BwL1289 commented on Jun 27, 2025

    @BwL1289
    Author

    Could you attach the full build log like what you did in #732?

    On my phone at the moment so don't have the full, but see below.

    Compilation fails after code generation step.

    "/opt/llvm_toolchain/bin/ld.lld" -EL --hash-style=gnu --eh-frame-hdr -m aarch64linux -shared -o build/lib.linux-aarch64-cpython-312/cuda/bindings/runtime.cpython-312-aarch64-linux-gnu.so /lib/../lib64/crti.o /opt/llvm_toolchain/lib/clang/20/lib/aarch64-unknown-linux-gnu/clang_rt.crtbegin.o -L/usr/local/cuda/lib64 -L/usr/local/cuda/lib -L/usr/local/lib64 -L/usr/local/lib -L/usr/local/cuda/lib64 -L/usr/local/cuda/lib -L/usr/local/lib64 -L/usr/local/lib -L/usr/local/cuda/lib64/stubs -L/usr/local/cuda/lib64 -L/usr/local/cuda/lib -L/usr/local/lib64 -L/usr/local/lib -L/usr/local/lib/python3.12/site-packages -L/usr/local/lib -L/usr/local/lib -L/opt/llvm_toolchain/bin/../lib/aarch64-unknown-linux-gnu -L/opt/llvm_toolchain/lib/clang/20/lib/aarch64-unknown-linux-gnu -L/lib/../lib64 -L/usr/lib/../lib64 -L/lib -L/usr/lib --fat-lto-objects -plugin-opt=mcpu=neoverse-n1 -plugin-opt=O3 -plugin-opt=thinlto --undefined-version --undefined-version --lto-whole-program-visibility --undefined-version build/temp.linux-aarch64-cpython-312/cuda/bindings/runtime.o -lc++ -lm /opt/llvm_toolchain/lib/clang/20/lib/aarch64-unknown-linux-gnu/libclang_rt.builtins.a --as-needed -lunwind --no-as-needed -lc /opt/llvm_toolchain/lib/clang/20/lib/aarch64-unknown-linux-gnu/libclang_rt.builtins.a --as-needed -lunwind --no-as-needed /opt/llvm_toolchain/lib/clang/20/lib/aarch64-unknown-linux-gnu/clang_rt.crtend.o /lib/../lib64/crtn.o
      building 'cuda.bindings.driver' extension
      /opt/llvm_toolchain/bin/clang++ -std=gnu++23 -O3 -mcpu=neoverse-n1 -mno-outline-atomics -mllvm=-polly -mllvm=-polly-vectorizer=stripmine -pipe -fident -fcolor-diagnostics -v -fPIC -fmacro-backtrace-limit=0 -D__CUDACC_VER_MAJOR__=12 -D__CUDACC_VER_MINOR__=6 -D__CUDACC_VER_BUILD__=85 -I/usr/local/cuda/include -I/usr/local/include -fcolor-diagnostics -v -fPIC -Icuda/bindings -I/usr/local/include -I/usr/local/cuda/include -I/usr/local/include/python3.12 -c cuda/bindings/driver.cpp -o build/temp.linux-aarch64-cpython-312/cuda/bindings/driver.o -O3 -mcpu=neoverse-n1 -Xarch_host -mno-outline-atomics -Xarch_host -mllvm=-polly -Xarch_host -mllvm=-polly-vectorizer=stripmine -pipe -fident -fcolor-diagnostics -Wno-cuda-compat -v -fpermissive -Wno-deprecated-declarations "-D _GLIBCXX_ASSERTIONS" -O3
      clang version 20.0.0git
      Target: aarch64-unknown-linux-gnu
      Thread model: posix
      InstalledDir: /opt/llvm_toolchain/bin
      Found CUDA installation: /usr/local/cuda-12.6, version 12.6
       (in-process)
       "/opt/llvm_toolchain/bin/clang-20" -cc1 -triple aarch64-unknown-linux-gnu -emit-obj -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name driver.cpp -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=non-leaf -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu neoverse-n1 -target-feature +v8.2a -target-feature +aes -target-feature +crc -target-feature +dotprod -target-feature +fp-armv8 -target-feature +fullfp16 -target-feature +lse -target-feature +neon -target-feature +perfmon -target-feature +ras -target-feature +rcpc -target-feature +rdm -target-feature +sha2 -target-feature +spe -target-feature +ssbs -target-abi aapcs -debugger-tuning=gdb -fdebug-compilation-dir=/tmp/eugo/cuda-python-12.6.2/cuda_bindings -v -v -v -fcoverage-compilation-dir=/tmp/eugo/cuda-python-12.6.2/cuda_bindings -resource-dir /opt/llvm_toolchain/lib/clang/20 -D __CUDACC_VER_MAJOR__=12 -D __CUDACC_VER_MINOR__=6 -D __CUDACC_VER_BUILD__=85 -I /usr/local/cuda/include -I /usr/local/include -I cuda/bindings -I /usr/local/include -I /usr/local/cuda/include -I /usr/local/include/python3.12 -D " _GLIBCXX_ASSERTIONS" -internal-isystem /opt/llvm_toolchain/bin/../include/aarch64-unknown-linux-gnu/c++/v1 -internal-isystem /opt/llvm_toolchain/bin/../include/c++/v1 -internal-isystem /opt/llvm_toolchain/lib/clang/20/include -internal-isystem /usr/local/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O3 -Wno-cuda-compat -Wno-deprecated-declarations -std=gnu++23 -fdeprecated-macro -ferror-limit 19 -fmacro-backtrace-limit=0 -fno-signed-char -fgnuc-version=4.2.1 -fno-implicit-modules -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -fcolor-diagnostics -vectorize-loops -vectorize-slp -mllvm -polly -mllvm -polly-vectorizer=stripmine -mllvm -polly -mllvm -polly-vectorizer=stripmine -target-feature -outline-atomics -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o build/temp.linux-aarch64-cpython-312/cuda/bindings/driver.o -x c++ cuda/bindings/driver.cpp
      clang -cc1 version 20.0.0git based upon LLVM 20.0.0git default target aarch64-unknown-linux-gnu
      ignoring nonexistent directory "/include"
      ignoring duplicate directory "/usr/local/include"
      ignoring duplicate directory "/usr/local/cuda/include"
      ignoring duplicate directory "/usr/local/include"
        as it is a non-system directory that duplicates a system directory
      #include "..." search starts here:
      #include <...> search starts here:
       /usr/local/cuda/include
       cuda/bindings
       /usr/local/include/python3.12
       /opt/llvm_toolchain/bin/../include/aarch64-unknown-linux-gnu/c++/v1
       /opt/llvm_toolchain/bin/../include/c++/v1
       /opt/llvm_toolchain/lib/clang/20/include
       /usr/local/include
       /usr/include
      End of search list.
      cuda/bindings/driver.cpp:453982:91: error: cannot initialize a parameter of type 'unsigned long long *' with an rvalue of type 'cuuint64_t *' (aka 'unsigned long *')
       453982 |   __pyx_t_5 = __pyx_f_4cuda_8bindings_8cydriver_cuGraphExecGetFlags(__pyx_v_cyhGraphExec, ((cuuint64_t *)__pyx_v_flags->_ptr)); if (unlikely(__pyx_t_5 == ((CUresult)CUDA_ERROR_NOT_FOUND) && PyErr_Occurred())) __PYX_ERR(1, 35791, __pyx_L1_error)
              |                                                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      1 error generated.
      error: command '/opt/llvm_toolchain/bin/clang++' failed with exit code 1
      error: subprocess-exited-with-error
      
      × Building wheel for cuda-python (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: /usr/local/bin/python3.12 /usr/local/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /tmp/tmpbm13wawl
      cwd: /tmp/eugo/cuda-python-12.6.2/cuda_bindings
      Building wheel for cuda-python (pyproject.toml) ... error
      ERROR: Failed building wheel for cuda-python
    Failed to build cuda-python
    ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (cuda-python)
    
  3. leofang commented on Jun 27, 2025

    @leofang
    Member

    This is a duplicate of #101 and was already fixed in cuda-bindings 12.8.0.

  4. moved this from Todo to Done in CCCLon Jun 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions