CUDA's nvcc not happy with std lib

Hello all. I’m trying to build GROMACS with GPU/CUDA support and ran into an error. After a little investigation, it looks like the problem is with CUDA and/or GCC as the error comes from within an nvcc call.

/usr/include/c++/12.1.0/bits/stl_map.h: In member function ‘std::pair<typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<std::pair<const _Key, _Tp> >::other>::iterator, bool> std::map<_Key, _Tp, _Compare, _Alloc>::emplace(_Args&& ...)’:
/usr/include/c++/12.1.0/bits/stl_map.h:593:29: error: parameter packs not expanded with ‘...’:
  593 |                 if constexpr (__usable_key<decltype(__a)>)
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                             

It looks very similar to the error report titled "CUDA 11.6.0 with gcc 11.2.1 fails to process system headers included by " (search that, the forum wont let me post the direct link), but I’m already using the version of CUDA where the problem was said to be “fixed” (at least for Ubuntu.)

Also found a similar error “error: parameter packs not expanded with ‘…’” (github nccl issue #650) from a Debian user

Another “error: parameter packs not expanded with ‘…’” error (github instant-ngp issue #119) on Ubuntu.

My system is up-to-date, here are the CUDA & GCC versions though

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Tue_Mar__8_18:18:20_PST_2022
Cuda compilation tools, release 11.6, V11.6.124
Build cuda_11.6.r11.6/compiler.31057947_0

gcc (GCC) 12.1.0
Copyright (C) 2022 Free Software Foundation, Inc.

If anyone could shed some light on why this is happening, it would be greatly appreciated

I have solved it on my Arch by forcing nvcc to use gcc11 instead of 12.
Install gcc-11 and then change symbolic link near nvcc to point to newly installed gcc and g++. nvcc is usually located at /opt/cuda/bin

relevant link : error: parameter packs not expanded with ‘...’ · Issue #119 · NVlabs/instant-ngp · GitHub

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.