-
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]: Build Error with CUDA 11.4-11.8.0 & Operators #4193
Comments
Vanilla Nvidia Linux Docker with CTK 11.7.1: $ docker run -it nvidia/cuda:11.7.1-devel-ubuntu20.04 $ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Wed_Jun__8_16:49:14_PDT_2022
Cuda compilation tools, release 11.7, V11.7.99
Build cuda_11.7.r11.7/compiler.31442593_0
$ g++ --version
g++ (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ apt update && apt install -y git cmake python3 python3-dev python3-setuptools
$ git clone https://github.com/pybind/pybind11.git
$ cmake -S pybind11 -B build -DPYBIND11_CUDA_TESTS=ON -DPYBIND11_WERROR=ON
$ cmake --build build -> same issue. Looks like it's not HPE specific but a general Nvidia NVCC issue. |
We have CI run for CUDA, right? Maybe we could add 11.7 & show it breaking in CI? |
Ahh, yes: #3968 |
I repeated the compilation with the following docker containers - but with
|
Uff, tried again today and still cannot find a simple work-around. |
Happy to report we made great progress on this with the help of Nvidia developers 🎉
Issue Description from NvidiaNVCC parses the input and regenerates host side C++ to send to the host compiler. There’s a bug in the host C++ generation, where the template <detail::op_id id, detail::op_type ot, typename L, typename R, typename... Extra>
class_ &def(const detail::op_<( detail::op_id )id, (detail::op_type)ot, L, R> &op, const Extra &...extra) Work-Around for CTK 11.4-11.8Replace the logic in template <typename T, typename... Extra>
class_ &def(const T &op, const Extra &...extra) For example: diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h
index c889dc41..43f4abc3 100644
--- a/include/pybind11/pybind11.h
+++ b/include/pybind11/pybind11.h
@@ -1578,14 +1578,14 @@ public:
return *this;
}
- template <detail::op_id id, detail::op_type ot, typename L, typename R, typename... Extra>
- class_ &def(const detail::op_<id, ot, L, R> &op, const Extra &...extra) {
+ template <typename T, typename... Extra>
+ class_ &def(const T &op, const Extra &...extra) {
op.execute(*this, extra...);
return *this;
}
- template <detail::op_id id, detail::op_type ot, typename L, typename R, typename... Extra>
- class_ &def_cast(const detail::op_<id, ot, L, R> &op, const Extra &...extra) {
+ template <typename T, typename... Extra>
+ class_ &def_cast(const T &op, const Extra &...extra) {
op.execute_cast(*this, extra...);
return *this;
} This unbreaks the test suite for me 🎉 all runtime tests pass as well. Due to the broad pattern, this is probably not suitable for mainline @henryiii @Skylion007? But I think it is good enough to patch in package managers. Should we add an |
I think it's fine to patch it for a restricted range of compilers. nvcc 11.4 - 11.8.0? I'd like to avoid package managers patching pybind11 if possible. Is this something that might land in 11.8.1 or is it 11.9+ only? |
Ok, sounds good.
I don't know, since these are internal roadmap details. I assume all following CUDA Toolkit releases after 11.8.0. |
Required prerequisites
Problem description
I am compiling pybind11
v2.10.0-38-g424ac4fe
on Perlmutter at NERSC.I use the following software modules:
Reproducible example code
cmake -S . -B build -DPYBIND11_CUDA_TESTS=ON -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON
cmake --build build
error.txt
More details
Failing compile line:
Pre-processed file from
-E
: test_operator_overloading.cpp.txtCross-References
NERSC ticket: INC0191398
Nvidia ticket: 3820295
The text was updated successfully, but these errors were encountered: