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

CUDA being found can break builds with newer intel compilers #50

Open
zbeekman opened this issue Feb 7, 2019 · 7 comments
Open

CUDA being found can break builds with newer intel compilers #50

zbeekman opened this issue Feb 7, 2019 · 7 comments

Comments

@zbeekman
Copy link

zbeekman commented Feb 7, 2019

There's no obvious way to configure LLVM-openmp (TR6 with tools support for TAU) WITHOUT CUDA support if find_package(CUDA quiet) succeeds in libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake. While it's possible that it is a quirk of the HPC system I'm on, when compiling, if CUDA is found, it includes /usr/local/cuda/include/cuda_runtime.h which then proceeds to complain that my intel compiler is too new:

host_config.h(79): error: #error directive: -- unsupported ICC configuration! Only ICC 15.0 and ICC 16.0 on Linux x86_64 are supported!
  #error -- unsupported ICC configuration! Only ICC 15.0 and ICC 16.0 on Linux x86_64 are supported!

After some frustration trying to build TAU with TR6 OMPT support, we discovered the CMake variable CMAKE_DISABLE_FIND_PACKAGE_CUDA. It would be nice if either:

  1. CMAKE_DISABLE_FIND_PACKAGE_CUDA were documented in the README.rst, or
  2. A CMake cache option was provided to explicitly turn off CUDA support.

I'm happy to submit a PR if you let me know which proposed solution you prefer, which branch to submit the PR against, and any other relevant contributing guidelines.

Cheers!

@jprotze
Copy link

jprotze commented Feb 8, 2019

Does your building problem affect upstream master (llvm-mirror/openmp)? That is the preferred repository to use ompt. It also exposes the OpenMP 5.0 interface of ompt.

Which branch do you currently use?

You can always turn libomptarget off: OPENMP_ENABLE_LIBOMPTARGET=off

@zbeekman
Copy link
Author

zbeekman commented Feb 8, 2019

Sorry, but I'm not intimately familiar with the internals of OpenMP. What functionality does LIBOMPTARGET provide? I'm building this specifically to use the tools interface for profiling.

As for which branch I'm using, I'm not 100% sure. That TAU folks at U Oregon provide a tarball for TR6 OMPT support in TAU hosted on their servers. It appears to be a snapshot of master, but there's no git information included, so it's hard to tell which commit they took the snapshot at. I can inquire.

@jprotze
Copy link

jprotze commented Feb 8, 2019

libomptarget is the LLVM specific way to perform offloading of target regions to accelerators. If you compile your OpenMP application with a current Intel compiler, this library will never be used, so there is no need to build this library.

@jprotze
Copy link

jprotze commented Feb 8, 2019

@hahnjo would it make sense to turn off building libomptarget by default, when icc is used?

@hahnjo
Copy link

hahnjo commented Feb 8, 2019

I guess it would be cleaner to add a CMake check if CMAKE_CXX_COMPILER can really include cuda_runtime.h (there's a function for that, I just don't recall the name). That would fail during config time for the Intel Compiler and should transparently disable the CUDA plugin.

@zbeekman
Copy link
Author

zbeekman commented Feb 8, 2019

Yes, intro-spection is your friend! You'll need to try compiling with it.

https://cmake.org/cmake/help/v3.9/module/CheckIncludeFile.html#module:CheckIncludeFile

@jprotze
Copy link

jprotze commented Feb 8, 2019

Well, it's not that easy :)
icc does not fail to compile when cuda_runtime.h is included.

The failing command in the build uses nvcc with some weird flags and I gave up in making a try-compile command out of that flags.
Also just adding some defines for the compilation with icc is not sufficient.

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

No branches or pull requests

3 participants