-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[BUG]: Cuda 12.1: error: expected template-name before ‘<’ token #4606
Comments
I fixed this by editing - return caster.operator typename make_caster<T>::template cast_op_type<T>();
+ return caster; 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 |
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. |
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. |
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:
|
The combination of pybind11 + GCC 12 + nvcc 12 runs into compilation errors. This is documented in a pybind11 issue. To workaround this, configure the CUDA 12 migrator to use GCC 11, which shouldn't have this issue. xref: pybind/pybind11#4606
The combination of pybind11 + GCC 12 + nvcc 12 runs into compilation errors. This is documented in a pybind11 issue. To workaround this, configure the CUDA 12 migrator to use GCC 11, which shouldn't have this issue. xref: pybind/pybind11#4606
The combination of pybind11 + GCC 12 + nvcc 12 runs into compilation errors. This is documented in a pybind11 issue. To workaround this, configure the CUDA 12 migrator to use GCC 11, which shouldn't have this issue. xref: pybind/pybind11#4606
* Rebuild for CUDA 12 The transition to CUDA 12 SDK includes new packages for all CUDA libraries and build tools. Notably, the cudatoolkit package no longer exists, and packages should depend directly on the specific CUDA libraries (libblas, libcusolver, etc) as needed. For an in-depth overview of the changes and to report problems [see this issue]( conda-forge/conda-forge.github.io#1963 ). Please feel free to raise any issues encountered there. Thank you! 🙏 * MNT: Re-rendered with conda-build 3.25.0, conda-smithy 3.23.1, and conda-forge-pinning 2023.06.08.00.22.40 * Use GCC 11 in CUDA 12 migrator The combination of pybind11 + GCC 12 + nvcc 12 runs into compilation errors. This is documented in a pybind11 issue. To workaround this, configure the CUDA 12 migrator to use GCC 11, which shouldn't have this issue. xref: pybind/pybind11#4606 * MNT: Re-rendered with conda-build 3.24.0, conda-smithy 3.23.1, and conda-forge-pinning 2023.06.27.16.55.53 Now that GCC 11 is configured for use with CUDA 12 in the migrator, re-render to propagate that changes to the variants and CI. * Use LLVM 14 on macOS As build issues are being encountered with LLVM 15 on macOS, pin to LLVM 14 in this feedstock to workaround those build issues. To ensure `llvm-openmp` matches pin it as well. Also, as the new `libcxx` will introduce this problem even with the older compiler toolchain, add `libcxx` as an explicit dependency in `build` & `host` along with pinning it. These build issues still need to be fixed upstream. However, this workaround should just allow this feedstock to continue to build on macOS. * MNT: Re-rendered with conda-build 3.24.0, conda-smithy 3.23.1, and conda-forge-pinning 2023.06.27.16.55.53 Now that the LLVM 14 toolchain is pinned on macOS, re-render to update the variants with these constraints. --------- Co-authored-by: jakirkham <jakirkham@gmail.com>
I haven't had a chance to test yet, but NVIDIA says that this has been fixed in the recently released 12.2. |
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. |
The combination of pybind11 + GCC 12 + nvcc 12 runs into compilation errors. This is documented in a pybind11 issue. To workaround this, configure the CUDA 12 migrator to use GCC 11, which shouldn't have this issue. xref: pybind/pybind11#4606
The combination of pybind11 + GCC 12 + nvcc 12 runs into compilation errors. This is documented in a pybind11 issue. To workaround this, configure the CUDA 12 migrator to use GCC 11, which shouldn't have this issue. xref: pybind/pybind11#4606
* Rebuild for CUDA 12 w/arch support The transition to CUDA 12 SDK includes new packages for all CUDA libraries and build tools. Notably, the cudatoolkit package no longer exists, and packages should depend directly on the specific CUDA libraries (libcublas, libcusolver, etc) as needed. For an in-depth overview of the changes and to report problems [see this issue]( conda-forge/conda-forge.github.io#1963 ). Please feel free to raise any issues encountered there. Thank you! 🙏 * MNT: Re-rendered with conda-build 3.26.1, conda-smithy 3.24.1, and conda-forge-pinning 2023.08.23.22.00.02 * Use GCC 11 in CUDA 12 migrator The combination of pybind11 + GCC 12 + nvcc 12 runs into compilation errors. This is documented in a pybind11 issue. To workaround this, configure the CUDA 12 migrator to use GCC 11, which shouldn't have this issue. xref: pybind/pybind11#4606 * MNT: Re-rendered with conda-build 3.24.0, conda-smithy 3.24.1, and conda-forge-pinning 2023.08.24.19.16.55 --------- Co-authored-by: jakirkham <jakirkham@gmail.com>
There is a bug in some CUDA versions (observed in CUDA 12.1 and 11.7 w/ GCC 12.2), that makes `cast_op` fail to compile: `cast.h:45:120: error: expected template-name before ‘<’ token` Defining the nested type as an alias and using it allows this to work without any change in semantics. Fixes pybind#4606
* Workaround NVCC parse failure in `cast_op` There is a bug in some CUDA versions (observed in CUDA 12.1 and 11.7 w/ GCC 12.2), that makes `cast_op` fail to compile: `cast.h:45:120: error: expected template-name before ‘<’ token` Defining the nested type as an alias and using it allows this to work without any change in semantics. Fixes #4606 * style: pre-commit fixes * Add comments to result_t referencing PR --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
The combination of pybind11 + GCC 12 + nvcc 12 runs into compilation errors. This is documented in a pybind11 issue. To workaround this, configure the CUDA 12 migrator to use GCC 11, which shouldn't have this issue. xref: pybind/pybind11#4606 xref: conda-forge/pp-sketchlib-feedstock@68d36e6
The combination of pybind11 + GCC 12 + nvcc 12 runs into compilation errors. This is documented in a pybind11 issue. To workaround this, configure the CUDA 12 migrator to use GCC 11, which shouldn't have this issue. xref: pybind/pybind11#4606 xref: conda-forge/pp-sketchlib-feedstock@68d36e6
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 |
The combination of pybind11 + GCC 12 + nvcc 12 runs into compilation errors. This is documented in a pybind11 issue. To workaround this, configure the CUDA 12 migrator to use GCC 11, which shouldn't have this issue. xref: pybind/pybind11#4606
Copying from @jakirkham from regro-cf-autotick-bot/pp-sketchlib-feedstock@da7a213 The combination of pybind11 + GCC 12 + nvcc 12 runs into compilation errors. This is documented in a pybind11 issue. To workaround this, configure the CUDA 12 migrator to use GCC 11, which shouldn't have this issue. xref: pybind/pybind11#4606
The combination of pybind11 + GCC 12 + nvcc 12 runs into compilation errors. This is documented in a pybind11 issue. To workaround this, configure the CUDA 12 migrator to use GCC 11, which shouldn't have this issue. xref: pybind/pybind11#4606
The pybind11 issue (pybind/pybind11#4606) requiring a deviation from the upstream migration in conda-forge-pinning-feedstock should be fixed in the latest release (2.12).
* Clean up C build dependencies (and bump Qiskit) * Remove muparserx which is not needed as of version 0.13 * Patch out muparserx cmake configuration * Ignore run exports from spdlog. Only its headers are used at build time. * Make numpy a run dependency only. Qiskit Aer interfaces with numpy through the pybind11 headers and does not link directly to numpy. * Make the nlohmann_json bounds consistent across environments instead of special for osx arm64. * Increase qiskit minimum version * Add missing psutil dependency - This was missed before and being pulled in by Qiskit (which recently dropped it as a dependency). * Increment build number * Revert to the upstream CUDA 12 migration - The pybind11 issue (pybind/pybind11#4606) requiring a deviation from the upstream migration in conda-forge-pinning-feedstock should be fixed in the latest release (2.12). * MNT: Re-rendered with conda-build 3.28.3, conda-smithy 3.34.1, and conda-forge-pinning 2024.04.05.13.18.18 --------- Co-authored-by: conda-forge-webservices[bot] <91080706+conda-forge-webservices[bot]@users.noreply.github.com>
Required prerequisites
What version (or hash if on master) of pybind11 are you using?
2.10.4
Problem description
Reproducible example code
Is this a regression? Put the last known working version here if it is.
Not a regression
The text was updated successfully, but these errors were encountered: