NVCC 11.4 segfaults with ASIO library

Hi, I encountered the segfault when compiling the source code with NVCC 11.4 after I’ve upgraded CUDA runtime. The source code includes ASIO, the async network library.

In detail, when you’re trying to do #include <asio.hpp>, the compiler itself ends up with segmentation fault.

How to reproduce:

$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Wed_Jun__2_19:15:15_PDT_2021
Cuda compilation tools, release 11.4, V11.4.48
Build cuda_11.4.r11.4/compiler.30033411_0

$  git clone https://github.com/chriskohlhoff/asio.git
$ echo "#include <asio.hpp>" >> a.cu
$ nvcc -I./asio/include a.cu
Segmentation fault (core dumped)

Currently, My workaround is compiling the problematic source codes with g++ and link them with nvcc-generated objects and g+±generated objects together.

Please report a bug to us Getting Help with CUDA NVCC Compiler