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 #78

Closed
JessubKim opened this issue Jul 13, 2019 · 10 comments
Closed

Windows Support #78

JessubKim opened this issue Jul 13, 2019 · 10 comments

Comments

@JessubKim
Copy link

JessubKim commented Jul 13, 2019

As of now, hipSyCL is the only option for building and running SyCL codes with CUDA backend.
It would be of high interest to get this working on Windows because this opens possibitilies to writing cross-platform compute kernels with something other than OpenCL which has many downsides. (Nvidia tooling is nowhere as good as CUDA, Nvidia only supports OpenCL 1.2, etc..)

This ticket proposes two things:

  • Verify and document that hipSyCL with CUDA backend successfully compiles and runs on Windows
  • If there's something preventing hipSyCL from building and running on Windows, create a PR to fix that issue.

For #2 I would like to make a PR eventually once I get this working on my machine.

@illuhad
Copy link
Collaborator

illuhad commented Jul 13, 2019

Thank you for your interest in working on this! From the top of my head there are three things to consider here:

  • The AMD ROCm backend cannot work on windows since AMD doesn't support ROCm on Windows. This would only affect support for AMD GPUs.
  • For CUDA, we rely on clang's CUDA implementation which is not so well maintained on Windows (although it seems there have been some fixes recently). Verifying that clang CUDA works will be the first important step.
  • Last but not least, since the other hipSYCL developers are all using Linux, you would have to be our Windows maintainer and make sure that everything keeps working in the future. The background is that I don't really want to advertise support for platforms if we have nobody to test it and guarantee that it works. But if you're up for that, I will happily merge any PRs that may be necessary.

@JessubKim
Copy link
Author

After trying to compile CUDA with clang, I realised it's more effort than I'm willing and able to give.

  • Have to compile LLVM and clang before building hipSyCL. Each compile run takes 30mins on my i5 laptop and it's easy to mess up compile configs. I wasted hours at this step.
  • The official release of clang, 8.0, has CUDA compile errors, at least on Windows. This was supposedly fixed in the latest development branch. But it is unclear whether there might be more issues (compile time and run-time) after that

Closing this ticket as I'm not actively working on this one. Maybe someone passionate about working on clang can make this come true instead.

@illuhad
Copy link
Collaborator

illuhad commented Jul 14, 2019

Sorry to hear that, but I understand. Thanks for having a look! Maybe we can revisit the issue once clang 9 is released. It will contain the patches from the current development branch, and who knows, if we're lucky it will work out of the box ;) Also, if clang 9 works, users won't have to compile LLVM/clang before building hipSYCL since they could just download the binary from the downloads page.

@illuhad
Copy link
Collaborator

illuhad commented Jul 15, 2019

(Also note that there seem to be Windows snapshot binaries, so it should not be necessary to compile clang/llvm yourself, even for the latest development versions)

@fodinabor
Copy link
Collaborator

(Also note that there seem to be Windows snapshot binaries, so it should not be necessary to compile clang/llvm yourself, even for the latest development versions)

Yes.. they are nice if just using clang with VS or so.. but sadly they don't support CMake's find_package, so I don't see another way than compiling LLVM manually.

@illuhad
Copy link
Collaborator

illuhad commented Aug 11, 2019

@fodinabor I didn't know that, thanks for the info! On Linux the nightly binaries work fine with find_package, so I'm a bit surprised that this isn't case on Windows.

@fodinabor
Copy link
Collaborator

I just want to note some things for future reference:
I've been trying to get hipSYCL running on Windows and got most parts to compile fine, using ninja as generator for Windows and fixing a few posix-only function calls. I also got Clang set-up to compile CUDA code.

The real issue, that I did not realize until after a while: Clang does not support plugins on Windows and probably won't do so in the near future: https://reviews.llvm.org/D16761#1441359

So to get closer to supporting hipSYCL on Windows, we'd have to either fix Clang's plugin system (😝) or build our own compiler executable, like clspv did: https://github.com/google/clspv

@oscarbg
Copy link

oscarbg commented Feb 6, 2020

Hi,
just joining the converstation..
related to:
"The AMD ROCm backend cannot work on windows since AMD doesn't support ROCm on Windows. This would only affect support for AMD GPUs."
well not exactly..
at least since last summer AMD has been shipping amdhip.dll on his drivers.. you can create a .lib from that dll and using standrad amd hip headers you can compile HIP applications..
the tricky part is to port/compile the AMD HIP clang compiler to Windows.. altough at some point last summer a compiled without a lot of effort.. anyway wasn't able to run any HIP applications that require launcking kernels as didn't accept binary format of kernel.. other HIP apps such as bandwith test, device query worked fine..
just my two cents..
thanks..

@illuhad
Copy link
Collaborator

illuhad commented Feb 6, 2020

@oscarbg Thanks for the update. So basically, we can use the runtime API, but cannot launch kernels.. Doesn't sound like "supported" to me ;)

@oscarbg
Copy link

oscarbg commented Feb 6, 2020

@illuhad you are right not supported.. just note that I wasn't able to launch kernels correctly doesn't mean they aren't working.. I had to modify some scripts to be Windows friendly in embedding the kernel binary to the exe and perhaps made some mistake or Windows driver expect some modification to kernel binary vs ROCM binary.. I think AMD shipping HIP DLL (which is a "modest" part of Windows driver (>50MB)) means something.. hope official Windows support soon..

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

4 participants