You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG]: Cuda 12.1: error: expected template-name before ‘<’ token #4606
It seems nvcc 12.x cannot parse correctly... not sure if this is a nvcc bug, maybe we should just use the unfancy syntax to do the cast, either implicit cast or c-style cast, rather than .operator T...
Reacted by lancercat, Paul Melis, Nick Perez, Birch-san, Peng Wang, Daniel Beitler, MistApproach, Alex Mai, Zoey, Tim Hanson and 18 more
Reacted by Nick Perez, camenduru, j.b.huang, Prajwal Singh, Maximilien Nowak and zhenshan0127
The takes_ref_wrap and takes_const_ref_wrap tests in test_builtin_casters.cpp fails to compile with the workaround applied:
include/pybind11/detail/../cast.h:47:12: error: invalid initialization of reference of type ‘pybind11::detail::type_caster<ConstRefCasted>::cast_op_type<ConstRefCasted&>’ {aka ‘ConstRefCasted&’} from expression of type ‘pybind11::detail::make_caster<ConstRefCasted&>’ {aka ‘pybind11::detail::type_caster<ConstRefCasted>’}
47 | return caster;
| ^~~~~~
They also fail to compile with an explicit cast:
include/pybind11/detail/../cast.h:46:12: error: conversion from ‘pybind11::detail::make_caster<const ConstRefCasted&>’ {aka ‘pybind11::detail::type_caster<ConstRefCasted>’} to ‘pybind11::detail::type_caster<ConstRefCasted>::cast_op_type<const ConstRefCasted&>’ {aka ‘const ConstRefCasted&’} is ambiguous
46 | return (typename make_caster<T>::template cast_op_type<T>)caster;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Activity
archibate commentedon Apr 5, 2023
I fixed this by editing
/usr/include/pybind11/cast.h:It seems nvcc 12.x cannot parse correctly... not sure if this is a nvcc bug, maybe we should just use the unfancy syntax to do the cast, either implicit cast or c-style cast, rather than
.operator T...Add patch to pybind11 to work around pybind/pybind11#4606
hubutui commentedon Apr 21, 2023
I also encounter this issue when I build https://github.com/NVIDIA/apex on ArchLinux with cuda 12.1.0, gcc 12.2.1, pybind11 2.10.4.
But I could build it with gcc 10.4.0.
thwalker3 commentedon May 12, 2023
I was able to confirm via an NVIDIA contact that this is indeed an nvcc bug and they've opened an internal issue for it.
cebtenzzre commentedon May 31, 2023
The takes_ref_wrap and takes_const_ref_wrap tests in test_builtin_casters.cpp fails to compile with the workaround applied:
They also fail to compile with an explicit cast:
Use GCC 11 in CUDA 12 migrator
Use GCC 11 in CUDA 12 migrator
Use GCC 11 in CUDA 12 migrator
Rebuild for CUDA 12 (#40)
thwalker3 commentedon Jul 10, 2023
I haven't had a chance to test yet, but NVIDIA says that this has been fixed in the recently released 12.2.
hubutui commentedon Jul 11, 2023
Cool, I could confirm that I could build https://github.com/NVIDIA/apex on ArchLinux with cuda 12.2.0, gcc 13.1.1, pybind11 2.10.4.
Use GCC 11 in CUDA 12 migrator
Use GCC 11 in CUDA 12 migrator
Rebuild for CUDA 12 w/arch support (#44)
Workaround NVCC parse failure in `cast_op`
Workaround NVCC parse failure in `cast_op` (#4893)
Use GCC 11 in CUDA 12 migrator
Use GCC11 in CUDA 12 migrator
serby2000 commentedon Nov 18, 2023
I can build https://github.com/NVIDIA/apex with no issue on Debian 12 Bookworm with cuda 12.1.r12.1 and gcc 11.3.0
Use GCC 11 in CUDA 12 migrator
Use GCC 11 in CUDA 12 migrator
Use GCC 11 in CUDA 12 migrator
Revert to the upstream CUDA 12 migration
Clean up C build dependencies (and bump Qiskit) (#32)
build: bump nvcc version to 12.2