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

Windows Support #1533

Closed
crtrott opened this issue Apr 4, 2018 · 17 comments
Closed

Windows Support #1533

crtrott opened this issue Apr 4, 2018 · 17 comments
Assignees
Labels
Feature Request Create new capability; will potentially require voting

Comments

@crtrott
Copy link
Member

crtrott commented Apr 4, 2018

We have now Sandia internal customers in addition to external folks who want to run Kokkos based apps on Windows including GPU support. To make this work we need to do a couple things starting with buying a Windows Server with a GPU (preferably a TitanV).

One big advantage is that this will remove an obstacle for commercial customers to use Kokkos.

@ibaned ibaned added this to the 2018 June milestone Apr 4, 2018
@j8asic
Copy link
Contributor

j8asic commented Apr 16, 2018

Does this mean compiling with Clang on Windows without Cygwin?

@ibaned
Copy link
Contributor

ibaned commented Apr 16, 2018

@j8asic I'm not sure about Clang on Windows. Our initial target was MSVC 2017. If you can point us to a Clang workflow we may look into that as well.

@j8asic
Copy link
Contributor

j8asic commented Apr 17, 2018

If you're going with MSVC, probably no need for a specific Clang workflow -- seems that clang-cl has matured, and is mostly compatible with MSVC's cl.exe. Good luck with adapting GNU makefiles.

@ibaned
Copy link
Contributor

ibaned commented Apr 17, 2018

@j8asic yes, the build system will be tricky. I'm thinking of focusing on our CMake build system, although even that makes some use of the Makefile system...

@mhoemmen
Copy link
Contributor

mhoemmen commented Apr 17, 2018

CMake is supposed to be able to dump MS project files. That was the whole justification for Trilinos adopting it circa 2009. CMake dumps Ninja just fine (yay!) so I'm a bit hopeful perhaps?

Oh wait I forgot Kokkos drives everything through Makefiles....

@ibaned
Copy link
Contributor

ibaned commented Apr 17, 2018

@mhoemmen yes, I think CMake support for outputting MSVC project files is widely used and robust. We just have to make a few minor tweaks in the Kokkos CMake files to make sure we only use pure CMake logic on Windows (and don't go calling Linux-specific external things from CMake). This shouldn't be too bad.

@ibaned
Copy link
Contributor

ibaned commented Apr 17, 2018

In particular, on Windows we'll just avoid calling our Makefile system to determine things like compiler flags, and instead just determine things like compilers flags with some pure-CMake logic that only covers the Windows case.

@crtrott
Copy link
Member Author

crtrott commented Apr 18, 2018

We discussed this shortly today. The vast majority of all our Makefile logic is compiler and architecture detection and the combinatorial issues with all possible combinations.

It looks to me like the non-cygwin (i.e. non-gnu-make compatible) ecosystem on Windows should be quite bit simpler. We don't have to deal necessarily with gcc, clang, pgi, cray, XL and intel, and we don't have to support ARM, Power, BGQ, Xeon Phi etc.

We probably can get away initially with some simple logic and just assume we have an AVX compatible CPU and are using MSVC.

@mhoemmen
Copy link
Contributor

Windows 10 runs on ARM: https://www.theverge.com/2017/12/5/16737288/microsoft-windows-10-qualcomm-arm-laptops-launch

Target for that looks like low-power laptops, though, so it might not be so urgent to support it.

@ibaned ibaned modified the milestones: 2018 July, 2018 September Aug 1, 2018
@ibaned ibaned modified the milestones: 2018 September, 2018 December Nov 14, 2018
@ndellingwood ndellingwood modified the milestones: 2018 December, 2019 April Feb 6, 2019
@crtrott crtrott modified the milestones: 2019 April, Tentative 3.1 Release Aug 21, 2019
@crtrott crtrott added this to To do in Developer: CRTROTT Aug 21, 2019
@crtrott crtrott moved this from To do to In progress in Developer: CRTROTT Aug 22, 2019
@crtrott crtrott moved this from In progress to To do in Developer: CRTROTT Sep 2, 2019
@ndellingwood
Copy link
Contributor

Here is a helpful comment posted on Trilinos github.io site

trilinos/trilinos.github.io#24 (comment)

@alessiocacciatori this is a good place for discussion regarding the fixes you've worked on for MSVC, thanks for posting!

Thanks @william76 for helping direct the comment this way!

@crtrott
Copy link
Member Author

crtrott commented Mar 9, 2020

Here we go: we got Windows support with MSVC in develop! For now only the Serial backend is supported. CUDA comes next. Not sure yet about OpenMP since MSVC only promises OpenMP 2.0.

@crtrott crtrott added Feature Request Create new capability; will potentially require voting InDevelop labels Mar 9, 2020
@alessiocacciatori
Copy link

Wonderful! Eager to try it! Thank you!

@crtrott crtrott moved this from To do to Done in Developer: CRTROTT Mar 12, 2020
@j8asic
Copy link
Contributor

j8asic commented Mar 15, 2020

I've tried to test compile with Clang 9, i.e. clang-cl, from VS and it almost goes through :)

1st problem is that Kokkos_Macros.hpp defines STACKTRACE and CXXABI, which I guess, are not available on Windows:

#if defined(KOKKOS_COMPILER_GNU) || defined(KOKKOS_COMPILER_CLANG) || \
    defined(KOKKOS_COMPILER_INTEL) || defined(KOKKOS_COMPILER_PGI)
#define KOKKOS_IMPL_ENABLE_STACKTRACE
#define KOKKOS_IMPL_ENABLE_CXXABI
#endif
impl\Kokkos_Stacktrace.cpp(6): fatal error : 'execinfo.h' file not found
impl\Kokkos_Stacktrace.cpp(9): fatal error : 'cxxabi.h' file not found

2nd problem arises in atomic_compare_exchange in Kokkos_Atomic_Windows.hpp:

impl/Kokkos_Atomic_Windows.hpp(149): error : '_InterlockedCompareExchange128' needs target feature cx16

The solution was to add -mcx16 compiler option to C++ command line options in the VS project properties.

@hph73
Copy link

hph73 commented Jan 13, 2023

Any progress on building Kokkos on windows? Is it available now?

@masterleinad
Copy link
Contributor

Any progress on building Kokkos on windows? Is it available now?

We have CI for Windows. Which backends are you interested in, though?

@hph73
Copy link

hph73 commented Feb 28, 2023

Hi, I am especially interested in GPU acceleration with Nvidia.

@masterleinad
Copy link
Contributor

Hi, I am especially interested in GPU acceleration with Nvidia.

This should in general work. Have a look at #3062, #3018, and #3345.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Create new capability; will potentially require voting
Projects
Development

No branches or pull requests

8 participants