Closed JeremyBYU closed 4 years ago
Thank you for considering VUDA.
As it is right now, I can see why it is a bit confusing. Let me try to clear it up.
The .cu files are only meant for compilation with CUDA and for comparison. They are redundant, since I recently introduced the CUDA wrapper “vuda_runtime.hpp” which should allow cross-compilation. I just have not got around to update the samples and remove the .cu files.
VUDA is not at a stage yet where it provides any support for compiling CUDA C kernels directly into SPIR-V. On the other hand, VUDA only takes source code in the SPIR-V format. It does not care how that code was created. Most samples are based on GLSL -> SPIR-V using the glslangValidator on the “.comp” files (for a compute shader), e.g.
glslangValidator.exe -V shader.comp.glsl -o shader.spv
Recently, support for hlsl compute into spir-v was also made possible:
glslangValidator.exe -V shader.comp.hlsl -o shader.spv
Alternatively, you can write your kernels in OpenCL and try https://github.com/google/clspv. I should add the compilation step to the make files.
Thank you for responding. Thanks for clearing up what the .comp files are. I guess it's terminology for computer shaders. So I guess I have a few options, which is ways nice.
Coming from cuda c++ though I'm not sure which one would be best. I'll look at each one and the syntax and ease of integration with tooling to make a choice that works well for me. It seems you went with glsl so I might bias towards that.
Hi I was just wondering what language/api you are using to write your non cuda device kernels. I notice that in your samples you sometimes have .cu files (cuda’s api c++) and then .spv files ( I think these are compiled spir or spri-v kernels?) I also see an accompanying file with the extension .comp which I’m not sure what the language but I believe from context it compiles to the .spv files. However I didn’t see this compilation step in the makefiles.
Basically I’m only familiar with Cuda but want to write some GPU accelerated programs that will work on intel igpu and nvidia ( vulkan drivers working on these two devices, these will be 2 separate systems ). It seems that Vuda provides the cross device and api ability for device setup, memory allocation, and kernel launch. But the kernels themselves seem to need to be split up. I’m wondering how to go about writing these kernels for spir.
Thank you for your help and time into this library.