Skip to content
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

Work-Around: NVCC 11.4.0 - 11.8.0 #4220

Merged
merged 3 commits into from
Oct 7, 2022
Merged

Conversation

ax3l
Copy link
Collaborator

@ax3l ax3l commented Oct 6, 2022

Adds a targeted NVCC work around for limited number of CUDA releases. Fixed in NVCC development.

Fix #4193

Description

Suggested changelog entry:

* work-around for Nvidia's CUDA nvcc compiler in versions 11.4.0 - 11.8.0

Adds a targeted NVCC work around for limited number of CUDA
releases. Fixed in NVCC development.
@henryiii
Copy link
Collaborator

henryiii commented Oct 6, 2022

Could we also bump the docker image used to build the cuda tests?

@ax3l
Copy link
Collaborator Author

ax3l commented Oct 7, 2022

Good point. Bumped.

@ax3l ax3l mentioned this pull request Oct 7, 2022
@henryiii henryiii merged commit 6cb2147 into pybind:master Oct 7, 2022
@github-actions github-actions bot added the needs changelog Possibly needs a changelog entry label Oct 7, 2022
@henryiii
Copy link
Collaborator

henryiii commented Oct 7, 2022

Thanks! I'd like to target a 2.10.1 release in the next (max) 2.5 weeks, hopefully sooner. (That's before 3.11, if you are curious to the selection of the max date ;) ).

@rwgk
Copy link
Collaborator

rwgk commented Oct 7, 2022

I think this PR is giving me trouble when updating the smart_holder branch (#4227). See below.

@ax3l did you try to add enable_if to the workaround? It looks like the current version is too generic. Now that I look at it more carefully, I'm actually surprised that this didn't bite on master.

https://github.com/pybind/pybind11/actions/runs/3207229735/jobs/5241897361

/__w/pybind11/pybind11/tests/test_class_sh_factory_constructors.cpp(94): error: more than one instance of overloaded function "pybind11::class_<type_, options...>::def [with type_=pybind11_tests::class_sh_factory_constructors::atyp_valu, options=<pybindit::memory::smart_holder>]" matches the argument list:
            function template "pybind11::class_<pybind11_tests::class_sh_factory_constructors::atyp_valu, pybindit::memory::smart_holder> &pybind11::class_<type_, options...>::def(const char *, Func &&, const Extra &...) [with type_=pybind11_tests::class_sh_factory_constructors::atyp_valu, options=<pybindit::memory::smart_holder>]"
/__w/pybind11/pybind11/include/pybind11/pybind11.h(1787): here
            function template "pybind11::class_<pybind11_tests::class_sh_factory_constructors::atyp_valu, pybindit::memory::smart_holder> &pybind11::class_<type_, options...>::def(const T &, const Extra &...) [with type_=pybind11_tests::class_sh_factory_constructors::atyp_valu, options=<pybindit::memory::smart_holder>]"
/__w/pybind11/pybind11/include/pybind11/pybind11.h(1816): here
            argument types are: (const char [9], <unknown-type>)
            object type is: pybind11::class_<pybind11_tests::class_sh_factory_constructors::atyp_valu, pybindit::memory::smart_holder>
  • test_class_sh_factory_constructors.cpp(94):

.def("get_mtxt", get_mtxt<atyp_valu>);

  • pybind11.h(1787):
    template <typename Func, typename... Extra>
    class_ &def(const char *name_, Func &&f, const Extra &...extra) {                     <<<<<<<< 1787
        cpp_function cf(method_adaptor<type>(std::forward<Func>(f)),
                        name(name_),
                        is_method(*this),
                        sibling(getattr(*this, name_, none())),
                        extra...);
        add_class_method(*this, name_, cf);
        return *this;
    }
  • pybind11.h(1816):
// Nvidia's NVCC is broken between 11.4.0 and 11.8.0
//   https://github.com/pybind/pybind11/issues/4193
#if defined(__CUDACC__) && (__CUDACC_VER_MAJOR__ == 11) && (__CUDACC_VER_MINOR__ >= 4)            \
    && (__CUDACC_VER_MINOR__ <= 8)
    template <typename T, typename... Extra>
    class_ &def(const T &op, const Extra &...extra) {                     <<<<<<<< 1816
        op.execute(*this, extra...);
        return *this;
    }

@rwgk
Copy link
Collaborator

rwgk commented Oct 7, 2022

I made a simple reproducer for master: PR #4228

Evidently this workaround only trades one error for another.

I recommend rolling back this PR as soon as possible. (I'll do that on the smart_holder branch now, to unblock the update.)

My test is pretty small but can probably be reduced further.

rwgk pushed a commit to rwgk/pybind11 that referenced this pull request Oct 7, 2022
henryiii added a commit that referenced this pull request Oct 8, 2022
rwgk pushed a commit to rwgk/pybind11 that referenced this pull request Oct 8, 2022
rwgk pushed a commit to rwgk/pybind11 that referenced this pull request Oct 8, 2022
@ax3l
Copy link
Collaborator Author

ax3l commented Oct 9, 2022

Continued in #4228

@ax3l ax3l deleted the fix-nvcc-11.4-11.8 branch October 9, 2022 20:57
@ax3l ax3l restored the fix-nvcc-11.4-11.8 branch October 9, 2022 20:57
@henryiii henryiii removed the needs changelog Possibly needs a changelog entry label Oct 20, 2022
@henryiii
Copy link
Collaborator

Thanks! I'd like to target a 2.10.1 release in the next (max) 2.5 weeks, hopefully sooner. (That's before 3.11, if you are curious to the selection of the max date ;) ).

Missed by a week, but it's out now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]: Build Error with CUDA 11.4-11.8.0 & Operators
4 participants