|
I've got a shader that works fine on my integrated GPU but segfaults on NVIDIA. I use The shader itself is here https://github.com/tombh/total-viewsheds/blob/main/crates/kernels/vulkan-and-cpu/src/kernel.rs I feel like it could be the use of |
Replies: 5 comments 16 replies
Are you sure it is being transpiled though? Because I don't think it is unless you're running it in the browser. My understanding is that wgpu will read whatever input you give it and produce whatever output the platform supports, but it will not convert things to and then back from WGSL for no reason. If you give it SPIR-V (which rust-gpu does), then run it on Vulkan-capable GPU, then your SPIR-V will be given to the GPU as is (or close to it). |
|
I have a bit of an update, I didn't actually have the Vulkan Validation Layers installed. They're a separate package on Linux. And now I'm seeing a validation error: |
|
BTW I was getting crazy memory usage (crashed system once) and strange segfaults after installing Vulkan validation layer package on Ubuntu 24.04. Removed it and everything is fine again. Looks like that thing is buggy. |
|
I found the problem. Here's the idea... if you have code like this: #[spirv(compute(threads(8, 8, 4)))]
pub fn main(
#[spirv(global_invocation_id)] id: glam::UVec3,
#[spirv(uniform, descriptor_set = 0, binding = 0)] constants: &constants::Constants,
#[spirv(storage_buffer, descriptor_set = 0, binding = 1)] elevations: &[f32],
#[spirv(storage_buffer, descriptor_set = 0, binding = 2)] cumulative_surfaces: &mut [f32]
) {
if constants.is_accumlate_surfaces {
cumulative_surfaces[0] = 1.234;
}
}But don't define the |
|
I had a struct that kept references to buffers and owned local variables. Moving the buffers off the struct allowed the Nvidia version to run. |
I had a struct that kept references to buffers and owned local variables. Moving the buffers off the struct allowed the Nvidia version to run.