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
Improve Vulkan queue allocator #685
Comments
Good to know, this will definitely hit us soon. It shouldn't be too hard to ifdef some stuff and act differently with MoltenVK.
|
@ehntoo I think this should be as simple as making the queue allocators always return 0 (i.e. every VkQueue points to the same "hardware queue") on MoltenVK. Can you try this and see if the unit tests work then? |
A more optimal long term fix would divide the four Metal queues up among compute worker threads etc. But the workaround i mentioned above should suffice to at least make things run. |
Overriding the queue allocators to always return 0 definitely gets closer, I'll try and get my changes cleaned up enough to push to a fork before end-of-day in case they're of any interest. |
Made some changes to replace references to
|
The changes I've got so far are up in https://github.com/ehntoo/scopehal/tree/macos-moltenvk and https://github.com/ehntoo/scopehal-apps/tree/macos-moltenvk. |
Yeah we use procfs by default on POSIX platforms to find data files. If I had to guess, the SIGILL is in JIT code generated by FFTS since both of the tests involving FFTs - and only those - are failing. What happens if you comment out the code in the test case that sets g_gpuFilterEnabled false? Now you'll be using vkFFT only. This means you no longer have a second FFT implementation to cross-check your results against, but if it doesn't crash then that's a good sign. The spectrogram filter (which does not yet have a unit test) currently uses FFTS and does not have a vkFFT backend, so that is likely to crash too. But fixing that is on my to-do list. |
You can also ignore the unit test failures for the purposes of ngscopeclient, because while ngscopeclient can connect to an instrument it doesn't yet display waveform data or let you configure filter blocks. So there's no way to actually reach the crashing code path. What I'm more interested in at this point is making ngscopeclient run, render a GUI, and allow basic interaction. If that works, at this stage, I'm happy. |
with ehntoo/scopehal-apps@e70659b, I've made... progress? Three issues are immediately clear:
Should I move this thread of discussion to another issue for macOS bring-up? |
Remaining basic issues running ngscopeclient on macOS fixed in ehntoo@d19c507. I'll tidy up a bit and submit some PRs. |
Per discussion in dev chat, this issue is now specifically for the problem of "we try to allocate a lot of queues of the first type that fits, and run out". Please file new issues for any other OSX or MoltenVK portability issues. |
Currently working on this. Also, for reference the ngscopeclient output from my M1 MacBook Pro is below.
|
Fixed ages ago and we forgot to close the ticket. |
I started experimenting with compiling the
ngscopeclient
app on my MacBook. I almost have things building, and I ran into an architectural limitation that may have a larger impact on the scopehal codebase for eventual macOS / Apple Silicon support.Under MoltenVK, each hardware queue type only has a single queue associated with it: https://github.com/KhronosGroup/MoltenVK/blob/master/MoltenVK/MoltenVK/API/vk_mvk_moltenvk.h#L378-L384
On my M1 Max MacBook Pro, that results in this output from
VulkanInit()
:The segmentation fault occurs at the end of
VulkanInit()
while attempting to allocate a "Compute" queue forg_vkFFTQueue
and accessing a nonexistentqueueIndex
of1
for queue type 0.I know "proper" macOS/Apple Silicon support is still a future item, but thought this might be a useful thing to be aware of in advance.
The text was updated successfully, but these errors were encountered: