-
Notifications
You must be signed in to change notification settings - Fork 250
Support headless testing on CI #136
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
Comments
(This was discussed on Discord. Putting it here as a matter of record) Another option would be SwiftShader: https://github.com/google/swiftshader. It is conformant implementation of the Vulkan Spec (at least on 64-bit Linux) as described here: https://www.khronos.org/conformance/adopters/conformant-products#submission_403 I'll try to compile the latest commit and run the current examples against it. |
SwiftShader doesn't seem to an ideal candidate for running headlessCI tests right now. The following capabilities are currently unsupported:
/home/nipun/swiftshader/src/Pipeline/SpirvShader.cpp:388 WARNING: UNSUPPORTED: Unsupported capability 5345
/home/nipun/swiftshader/src/Pipeline/SpirvShader.cpp:388 WARNING: UNSUPPORTED: Unsupported capability 4442
/home/nipun/swiftshader/src/Pipeline/SpirvShader.cpp:720 WARNING: UNSUPPORTED: SPIR-V Extension: SPV_KHR_vulkan_memory_model
/home/nipun/swiftshader/src/Pipeline/SpirvShader.cpp:467 WARNING: UNREACHABLE: FunctionParameter should have already been lowered.
/home/nipun/swiftshader/src/Pipeline/SpirvShader.cpp:725 WARNING: UNSUPPORTED: ReturnValue
/home/nipun/swiftshader/src/Pipeline/SpirvShader.cpp:467 WARNING: UNREACHABLE: FunctionParameter should have already been lowered.
/home/nipun/swiftshader/src/Pipeline/SpirvShader.cpp:467 WARNING: UNREACHABLE: FunctionParameter should have already been lowered.
/home/nipun/swiftshader/src/Pipeline/SpirvShader.cpp:467 WARNING: UNREACHABLE: FunctionParameter should have already been lowered.
/home/nipun/swiftshader/src/Pipeline/SpirvShader.cpp:725 WARNING: UNSUPPORTED: ReturnValue
/home/nipun/swiftshader/src/Pipeline/SpirvShader.cpp:467 WARNING: UNREACHABLE: FunctionParameter should have already been lowered.
/home/nipun/swiftshader/src/Pipeline/SpirvShader.cpp:467 WARNING: UNREACHABLE: FunctionParameter should have already been lowered.
Segmentation fault (core dumped) Both the ash example and the wgpu example generates warnings about this. The ash example crashes the moment it is launched, but the wgpu example runs despite the warnings. I'll try to see if llvmpipe has similar problems. EDIT: If someone is trying to compile SwiftShader, I would recommend not using the The |
Using
(EDIT: looks like the warnings are from #247, so perhaps not related to the crash?) I was getting the same exact output with the packaged @nipunG314 Do you happen to know what exact SwiftShader and Rust-GPU revisions you used to get those warnings?
I noticed it's compiling LLVM, and I guess something goes wrong with I can get away with having Nix offload the build to the multi-user EPYC server I use for hacking on rustc, but if Rust-GPU starts using SwiftShader for testing, we should probably have some sort of CI build (unless Google has prebuilds somewhere I'm missing?), for the cases where distro builds are missing / outdated (and for non-Linux). |
With a debug build (
But I'm not sure how related it is, and this happens before those warnings, and there's no additional output presented. After building a proper unoptimized debug build, and combining that with The same assert is also in the caller (but also doesn't fire, for the same reason), and I'm guessing running the SPIRV-Tools |
As suspected, SPIRV-Tools'
Oh, I missed that one of the "warnings" is actually |
Decided to try patching it to disable validation, and it works! (the extra Both
So we can probably start using unmodified SwiftShader once #247 is addressed. |
Filed two tickets on the SwiftShader repo, one for VariablePointer support and one for VK_KHR_memory_model support (https://issuetracker.google.com/issues/176819537 and https://issuetracker.google.com/issues/176819536) |
Looks like at least the Would be so nice to be able to get in some initial headless CI testing of Rust GPU in this repo! And if it can work here for our example/test shaders, wonder what would be needed for our more advanced Ark Rust shaders |
One thing that I've noticed more recently is Mesa's Though testing both SwiftShader and Speaking of the multi-GPU setup, I didn't get to play a lot with it, but I did get it to the point where I have an Intel iGPU, and two dGPUs (both of them small low-profile cards, mostly so that I don't waste a lot of power nor need an expensive/loud PSU):
The machine has no persistent storage and boots off the network (from my main workstation), and I could easily set something up to run a test via SSH with no monitors attached - but I need to change the runners to support offscreen rendering first. |
@bjorn3 mentioned in #134 (comment) that Mesa's LLVMpipe can be a possibility for headlessCI testing.
Did some quick investigation and LLVMpipe has traditionally supported OpenGL but has recently merged in early Vulkan support ("Vallium"). It likely isn't that mature yet but it would be really interesting to try out and see it this can be an additional path for us for doing software-based testing of our graphics shaders, esp. targetting Linux CI.
Would be great if someone can simply try out just running our current Vulkan example program & shader with latest LLVMpipe and see if it works, or what issues there are with it, and report back here.
The text was updated successfully, but these errors were encountered: