Azusachan / python-cupy-rocm

AUR of ROCm enabled CuPy
0 stars 0 forks source link

Cython error when tring to build #4

Closed flying-sheep closed 4 months ago

flying-sheep commented 4 months ago
[26/60] Cythonizing cupy/_core/internal.pyx
warning: cupy_backends/cuda/api/runtime.pxd:28:0: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310
warning: cupy_backends/cuda/api/_runtime_typedef.pxi:120:4: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310
warning: cupy_backends/cuda/api/_runtime_typedef.pxi:135:4: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310
warning: cupy_backends/cuda/api/_runtime_typedef.pxi:157:4: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310
warning: cupy_backends/cuda/api/_runtime_typedef.pxi:345:8: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310
warning: cupy_backends/cuda/api/driver.pxd:8:0: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310
warning: cupy_backends/cuda/api/_runtime_enum.pxd:102:0: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310
warning: cupy_backends/cuda/api/_runtime_enum.pxd:219:4: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310
performance hint: cupy/_core/dlpack.pyx:87:5: Exception check on 'deleter' will always require the GIL to be acquired.
Possible solutions:
        1. Declare 'deleter' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
        2. Use an 'int' return type on 'deleter' to allow an error code to be returned.
warning: cupy/_core/dlpack.pyx:98:6: Only extern functions can throw C++ exceptions.
warning: cupy/_core/dlpack.pyx:217:6: Only extern functions can throw C++ exceptions.
warning: cupy/_core/dlpack.pyx:267:5: Only extern functions can throw C++ exceptions.

Error compiling Cython file:
------------------------------------------------------------
...
    dtype.lanes = <uint16_t>1
    dtype.bits = <uint8_t>(array.dtype.itemsize * 8)

    dlm_tensor.manager_ctx = <void*>array
    cpython.Py_INCREF(array)
    dlm_tensor.deleter = deleter
                         ^
------------------------------------------------------------

cupy/_core/dlpack.pyx:152:25: Cannot assign type 'void (DLManagedTensor *) except * nogil' to 'void (*)(DLManagedTensor *) noexcept'. Exception values are incompatible. Suggest adding 'noexcept' to the type of 'deleter'.

Error compiling Cython file:
------------------------------------------------------------
...

    dlm_tensor.manager_ctx = <void*>array
    cpython.Py_INCREF(array)
    dlm_tensor.deleter = deleter

    return cpython.PyCapsule_New(dlm_tensor, 'dltensor', pycapsule_deleter)
                                                         ^
------------------------------------------------------------

cupy/_core/dlpack.pyx:154:57: Cannot assign type 'void (object) except *' to 'PyCapsule_Destructor' (alias of 'void (*)(object) noexcept'). Exception values are incompatible. Suggest adding 'noexcept' to the type of 'pycapsule_deleter'.
[27/60] Cythonizing cupy/_core/new_fusion.pyx
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/Cython/Build/Dependencies.py", line 1345, in cythonize_one_helper
    return cythonize_one(*m)
           ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one
    raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: cupy/_core/dlpack.pyx
Azusachan commented 4 months ago

Check https://github.com/cython/cython/issues/5708 You may use https://github.com/arch4edu/arch4edu for built binaries.

flying-sheep commented 4 months ago

thanks for the help! So the core issue is https://github.com/cupy/cupy/issues/4610