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

MSVC 14.29.30037 with CUDA 11.2 occurs error expected a "(" #3485

Closed
1 of 7 tasks
yhmtsai opened this issue May 31, 2021 · 12 comments
Closed
1 of 7 tasks

MSVC 14.29.30037 with CUDA 11.2 occurs error expected a "(" #3485

yhmtsai opened this issue May 31, 2021 · 12 comments

Comments

@yhmtsai
Copy link

yhmtsai commented May 31, 2021

Description
After Github Action updates MSVC, the compilation with CUDA 11.2 (11.2.2.46133) occurs error

Area for Triage:
C/C++
Packages

Question, Bug, or Feature?:
Question

Virtual environments affected

  • Ubuntu 16.04
  • Ubuntu 18.04
  • Ubuntu 20.04
  • macOS 10.15
  • macOS 11
  • Windows Server 2016 R2
  • Windows Server 2019

Image version
20210525.0

Expected behavior
It should still be able compile the code with CUDA after updating

Actual behavior
It gives several error expected a "(" in several place.

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30037\include\xutility(1309): error : expected a "(" [D:\a\msvc_cuda_error\msvc_cuda_error\build\hello.vcxproj]
            detected during instantiation of "void std::_Adl_verify_range(const _Iter &, const _Sentinel &) [with _Iter=const char *, _Sentinel=const char *]" 
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30037\include\xlocale(1990): here
  
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30037\include\xutility(1310): error : identifier "_Verify_range" is undefined [D:\a\msvc_cuda_error\msvc_cuda_error\build\hello.vcxproj]
            detected during instantiation of "void std::_Adl_verify_range(const _Iter &, const _Sentinel &) [with _Iter=const char *, _Sentinel=const char *]" 
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30037\include\xlocale(1990): here
  ....
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30037\include\atomic(368): error : expected a "(" [D:\a\msvc_cuda_error\msvc_cuda_error\build\hello.vcxproj]
            detected during:
              instantiation of "_Integral std::_Atomic_reinterpret_as<_Integral,_Ty>(const _Ty &) [with _Integral=int, _Ty=std::remove_reference_t<long>]" 
  (987): here
              instantiation of "void std::_Atomic_storage<_Ty, 4ULL>::store(std::_Atomic_storage<_Ty, 4ULL>::_TVal, std::memory_order) [with _Ty=long]" 
  (2944): here
  ...

the more detail error can be seen https://github.com/yhmtsai/msvc_cuda_error/runs/2711687900?check_suite_focus=true

Repro steps
I put the hello world example in https://github.com/yhmtsai/msvc_cuda_error
it does not include any actual cuda code.

  1. download latest cuda from choco
  2. use the cmake to compile the code (in CUDA)
    Compiling it with cuda will gives the error

Note
the previous one works with github action ver 20210516.0 (MSVC 19.28.29915), which can be seen in https://github.com/ginkgo-project/ginkgo/runs/2698442047.
After updating, https://github.com/ginkgo-project/ginkgo/runs/2710943630, which does not change cuda related code, gives the same error as the above

@maxim-lobanov
Copy link
Contributor

Hello @yhmtsai , have you tried to upgrade VS to latest version (16.10) on your local machine? Does this issue reproduce for you locally?

@yhmtsai
Copy link
Author

yhmtsai commented May 31, 2021

Hi, @maxim-lobanov
I take some time to rebuild the msvc from installer not from choco with cuda 11.2 in docker.
I tried the latest version in windows docker, whose compiler is also ver 19.29.30037, and it gives the same error from the hello world example.

@martinrotter
Copy link

We have runtime crashes in our app compiled from github actions, problems seem to be caused by new runtime version.

martinrotter/rssguard#428

14.29.30037 is problematic.

@maxim-lobanov
Copy link
Contributor

Thank you for confirmation. Looks like the issue is caused by Visual Studio 2019 update from 16.9.31229.75 to 16.10.31321.278.
We should report this issue to Visual Studio team

@LeonidLapshin LeonidLapshin added Area: C/C++ investigate Collect additional information, like space on disk, other tool incompatibilities etc. OS: Windows and removed needs triage labels Jun 1, 2021
@LeonidLapshin LeonidLapshin self-assigned this Jun 1, 2021
@LeonidLapshin LeonidLapshin added external and removed investigate Collect additional information, like space on disk, other tool incompatibilities etc. labels Jun 1, 2021
@LeonidLapshin
Copy link
Contributor

Hey @yhmtsai!
As I can see this problem reproduces in latest docker image and it is not related to image, just to Visual Studio. Could you please report this issue to VS team? I'll keep this ticket open until we'll get the new VS version on image.
Thank you!

@yhmtsai
Copy link
Author

yhmtsai commented Jun 1, 2021

Sure, I have reported it in https://developercommunity.visualstudio.com/t/MSVC-C142930037-with-CUDA-112-occur/1437930

(out-of-topic question)
How can I make the author profile show name not the email in Microsoft Developer Community?

@snnn
Copy link

snnn commented Jun 2, 2021

I hit it too.

@snnn
Copy link

snnn commented Jun 2, 2021

To the maintainers of this repo:

You can't always update VS to the latest. Otherwise you will often get such issues. CUDA's nvcc highly depends on VC++ compiler. When Visual Studio does a release sometimes it not only contains bug fixes, it could also have new features and breaking changes.

So, you need to follow VS team's Servicing Baseline releases lifecycle, create an image for each baseline release. So you will have

  • windows2019-vs2019-16.10
  • windows2019-vs2019-16.9
  • windows2019-vs2019-16.4
  • ...

Otherwise such things will continue to happen and the user experience sucks.

@snnn
Copy link

snnn commented Jun 2, 2021

@yhmtsai as a quick fix to your issue, please change your C++ standard to something else other than 14. For example: microsoft/onnxruntime#7883

@yhmtsai
Copy link
Author

yhmtsai commented Jun 4, 2021

@snnn thanks for your advice. I also try c++17 and it indeed works on my local system.
Unfortunately, our library may want to keep C++14 at this point.
I also try https://github.com/ilammy/msvc-dev-cmd to set the prior toolset from 16.9.
However, it can not find the toolset version (14.28).
Maybe the image is built from scratch not update, so the image does not contain the prior toolset
related issue: ilammy/msvc-dev-cmd#43

@yhmtsai
Copy link
Author

yhmtsai commented Jun 4, 2021

another workaround is to use -T version=14.25 via cmake, which will use 14.25 toolset.
It's found in #1076.
Github action already installed 14.25, so we can directly use it.
There is also installation step in that issue to install additional toolset.
helloworld example uses CXX 19.25.28614.0 with this workaround https://github.com/yhmtsai/msvc_cuda_error/runs/2747425424

Because it is not the default toolset, need to be careful to handle the external cmake project to avoid different toolset usage.
(if there is no cuda code, it may not be an issue)
search "The CXX compiler identification" in https://github.com/ginkgo-project/ginkgo/runs/2747534899?check_suite_focus=true
there are not always same if do not set the toolset for everything.

Note. msvc-dev-cmd can use toolset: 14.25 but cmake can not use it as the default toolset. (ref: https://github.com/yhmtsai/msvc_cuda_error/runs/2747263105)

@LeonidLapshin
Copy link
Contributor

Hey, @yhmtsai !
I suggest you to use the workaround until the VS team will fix this issue on VS side. I'll close this ticket, but please feel free to reopen it if you have any suggestions.
Thank you!

liu-kan added a commit to liu-kan/gSMFRETda that referenced this issue Nov 23, 2021
liu-kan added a commit to liu-kan/gSMFRETda that referenced this issue Nov 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants