-
Notifications
You must be signed in to change notification settings - Fork 187
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
CUDA 10.2 incompatible with GCC 9.3 and Clang 9.0 #3654
Comments
You can try patching out that check. We did that on our desktop machines with Ubuntu 16.04 and 18.04 to get the default system compiler to work with CUDA and it was always fine. We will most likely have to do that again once we upgrade them to Ubuntu 20.04. This is what we use to make CUDA 9.1 work with GCC 7 on our desktop machines: --- /usr/include/crt/host_config.h 2017-12-02 00:36:56.000000000 +0100
+++ /usr/include/crt/host_config.h 2018-08-31 14:43:16.744783062 +0200
@@ -116,11 +116,11 @@
#if defined(__GNUC__)
-#if __GNUC__ > 6
+#if __GNUC__ > 7
-#error -- unsupported GNU version! gcc versions later than 6 are not supported!
+#error -- unsupported GNU version! gcc versions later than 7 are not supported!
-#endif /* __GNUC__ > 6 */
+#endif /* __GNUC__ > 7 */
#if defined(__APPLE__) && defined(__MACH__) && !defined(__clang__)
#error -- clang and clang++ are the only supported host compilers on Mac OS X! |
I've just applied that patch to enable GCC 9.3, but all LB GPU files give the same compiler error:
|
That's annoying. You might be able to replace |
The patch so far: --- /usr/include/crt/host_config.h 2020-04-10 14:53:37.947817611 +0000
+++ /usr/include/crt/host_config.h 2020-04-10 14:54:08.204086102 +0000
@@ -133,11 +133,11 @@
#if defined(__GNUC__)
-#if __GNUC__ > 8
+#if __GNUC__ > 9
-#error -- unsupported GNU version! gcc versions later than 8 are not supported!
+#error -- unsupported GNU version! gcc versions later than 9 are not supported!
-#endif /* __GNUC__ > 8 */
+#endif /* __GNUC__ > 9 */
#if defined(__clang__) && !defined(__ibmxl_vrm__) && !defined(__ICC) && !defined(__HORIZON__) && !defined(__APPLE__)
--- /usr/include/c++/9/bits/stl_function.h 2020-04-10 14:54:36.920340490 +0000
+++ /usr/include/c++/9/bits/stl_function.h 2020-04-10 14:59:58.739168200 +0000
@@ -434,7 +434,12 @@
{
#if __cplusplus >= 201402L
#ifdef _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED
- if (__builtin_is_constant_evaluated())
+#ifdef __NVCC__
+#include <type_traits>
+ if (std::is_constant_evaluated())
+#else
+ if (__builtin_is_constant_evaluated())
+#endif
#else
if (__builtin_constant_p(__x < __y))
#endif CMake fails:
Compiler error:
The issue is that |
Okay, the error comes from https://github.com/gcc-mirror/gcc/blob/releases/gcc-9.3.0/libstdc++-v3/include/bits/stl_function.h#L437. This means you should be able to conditionally undef Let me know if that works. Otherwise, I'll need to have a look before we upgrade the desktop computers. |
Let's discuss this in the Espresso meeting as well. |
@mkuron The file in question isn't shipped with the header library. It's not even included in another file ( --- /usr/include/crt/host_config.h 2020-04-10 14:53:37.947817611 +0000
+++ /usr/include/crt/host_config.h 2020-04-10 14:54:08.204086102 +0000
@@ -133,11 +133,11 @@
#if defined(__GNUC__)
-#if __GNUC__ > 8
+#if __GNUC__ > 9
-#error -- unsupported GNU version! gcc versions later than 8 are not supported!
+#error -- unsupported GNU version! gcc versions later than 9 are not supported!
-#endif /* __GNUC__ > 8 */
+#endif /* __GNUC__ > 9 */
#if defined(__clang__) && !defined(__ibmxl_vrm__) && !defined(__ICC) && !defined(__HORIZON__) && !defined(__APPLE__)
--- /usr/include/c++/9/bits/stl_function.h 2020-04-10 18:39:20.692976417 +0000
+++ /usr/include/c++/9/bits/stl_function.h 2020-04-10 18:37:56.744398062 +0000
@@ -414,7 +414,7 @@
operator()(_Tp* __x, _Tp* __y) const _GLIBCXX_NOTHROW
{
#if __cplusplus >= 201402L
-#ifdef _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED
+#if defined(_GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED) && !defined(__CUDACC__)
if (__builtin_is_constant_evaluated())
#else
if (__builtin_constant_p(__x > __y))
@@ -433,7 +433,7 @@
operator()(_Tp* __x, _Tp* __y) const _GLIBCXX_NOTHROW
{
#if __cplusplus >= 201402L
-#ifdef _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED
+#if defined(_GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED) && !defined(__CUDACC__)
if (__builtin_is_constant_evaluated())
#else
if (__builtin_constant_p(__x < __y))
@@ -452,7 +452,7 @@
operator()(_Tp* __x, _Tp* __y) const _GLIBCXX_NOTHROW
{
#if __cplusplus >= 201402L
-#ifdef _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED
+#if defined(_GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED) && !defined(__CUDACC__)
if (__builtin_is_constant_evaluated())
#else
if (__builtin_constant_p(__x >= __y))
@@ -471,7 +471,7 @@
operator()(_Tp* __x, _Tp* __y) const _GLIBCXX_NOTHROW
{
#if __cplusplus >= 201402L
-#ifdef _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED
+#if defined(_GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED) && !defined(__CUDACC__)
if (__builtin_is_constant_evaluated())
#else
if (__builtin_constant_p(__x <= __y)) |
Glad that worked! Using GCC 8 would have been messier because we would probably have needed to recompile Boost. Their C++ ABI is not downwards-compatible (or compatible at all). |
Why do they exclude those compiler versions by default if it actually works? |
Nvidia just excludes all compilers that were released after the CUDA version. That is, they are not officially supported but work fine. |
Description of changes: - reduce number of CI images for CUDA jobs (partial fix for #3611) - test CUDA 9.1 and 10.1 using compatible compilers without patches (fixes #3654) - drop support for Ubuntu 16.04 - bump minimal Boost version to 1.65 (partial fix for #3093) - bump Python packages to the versions available in Ubuntu 18.04 (partial fix for #3421) - add missing lxml package (fixes #3686) - fix issues in docs revealed by the new Doxygen and Sphinx versions
Anyone reading this may be interested in a simple version that worked:
Still testing this setup, but so far it seems to work |
Thanks @NilsRethmeier, worked just perfect |
You can simply use --override to override this check. |
According to the CUDA 10.2 System Requirements, Table 1, the nvcc compiler in CUDA 10 doesn't support the latest versions of GCC and Clang. At the time of writing, Ubuntu 20.04 doesn't appear in that list, but I can confirm nvcc supports the older GCC 8.4 and Clang 8.0 but not the default GCC 9.3 and Clang 9.0.
On Ubuntu 20.04,
nvidia-cuda-toolkit
(CUDA 10.1) is incompatible with the packaged GCC version 9.3 (default frombuild-essential
). MWE:Fortunately,
nvidia-cuda-toolkit
automatically installs GCC 8.4 as a dependency if Clang 8.0 isn't already present, so this compiler error is not an obstacle to our work in #3611.Solution for the
ubuntu-20.04
docker image:Solution for end users:
The text was updated successfully, but these errors were encountered: