Open ZzEeKkAa opened 10 months ago
Hi @ZzEeKkAa,
macOS is generally unsupported by the project. The compiler is buildable in there, but it is completely untested and may not be useable at all.
Not related to any problem, just wondering why isn't it working on apple silicone that is being run through the x86_64 docker
This is caused by lack of a low-level runtime on your system. SYCL is an abstraction layer on top of actual offloading mechanisms such as OpenCL, CUDA, Level Zero, etc. The flow here is that SYCL RT queries PI plugins (or Unified Runtime adapters once the transition is complete) to get a list of available devices. Those plugins/adapters in turn access low-level APIs to query list of available devices.
There is no special OS-based filtering and I would expect to see at least a CPU device discoverable if you install POCL for example. AFAIK, @alexbatashev did some experiments with trying to run some SYCL apps on macOS over POCL, but that was a while ago.
We also have native CPU device support in development, which should help us to expand to macOS (and to any system with no low-level runtimes installed, really). It theoretically should be of help, but I don't have experience with it and haven't tried it yet myself. Tagging @PietroGhg here for awareness/comments
Hello, yeah the Native CPU device should help with environments with no low-level runtimes, it is still in an experimental stage but we are actively working to improve both its performances and correctness. We would definitely like to see it working on macOS, but haven't tried that yet.
There is no special OS-based filtering and I would expect to see at least a CPU device discoverable if you install POCL for example. AFAIK, @alexbatashev did some experiments with trying to run some SYCL apps on macOS over POCL, but that was a while ago.
The compiler heavily uses Intel-only SPIR-V opcodes, which makes it virtually impossible to use any OpenCL implementation other than Intel. Many of those are actually trivial, like arbitrary precision integers, and PoCL does indeed support some of Intel extensions, like USM or Intel sub-groups, but AFAIK, that's still not enough to successfully run SYCL code. From my experiments, tests that did not require actual kernel execution, passed as-is with very small tuning to build system and the runtime. I upstreamed those changes a couple of years ago, but they might be outdated. I also tried to implement OpenCL 3.0 on top of Apple Metal framework (https://github.com/alexbatashev/librecl) but gave up due to the differences in memory and execution models that made the implementation extremely non-trivial (e.g., lack of generic address space).
Anyway, it's not like SYCL on Apple Silicon is impossible, it's just that it requires a significant investment of time and money, and the reward is probably not worth it: the adoption of SYCL is not that big, and you wouldn't use a MacBook for anything other than unit-tests for your production code.
Thank you! This was really informative! I'll go and check POCL and will wait for native CPU device support if does not work. In the current state, yes it is mostly to run unit test before running in production.
Hi @ZzEeKkAa, were the guys able to answer your question? Can we close this issue?
Hi @ZzEeKkAa, were the guys able to answer your question? Can we close this issue?
Not the original reporter, but I think that we can leave this issue open, because even though we provided the current status of macOS and Apple Silicon support that is unsupported, we haven't enabled the platform itself. I think that the issue can stay in the backlog as an indicator of the current state of things for everyone else who is wondering about this platform as well.
Is your feature request related to a problem? Please describe Not related to any problem, just wondering why isn't it working on apple silicone that is being run through the x86_64 docker
Describe the solution you would like