Skip to content

[Migrated] How to get spir-v with OpCapability Kernel? #74

@rust-gpu-bot

Description

@rust-gpu-bot

Issue automatically imported from old repo: EmbarkStudios/rust-gpu#1094

Originally creatd by jczaja on 2023-09-22T07:57:23Z


Hi,

I have a dummy compute kernel:

#[spirv(compute(threads(768)))]
pub fn main_cs(
    #[spirv(global_invocation_id)] id: UVec3,
    #[spirv(storage_buffer, descriptor_set = 0, binding = 0)] prime_indices: &mut [u32],
) {
    let index = id.x as usize;
    prime_indices[index] = collatz(prime_indices[index]).1u32;
}

I can run it using Vulkano abd it works, but I wanted to run this spir-v kernel using Intel Level Zero and this did not work. Problem is that Intel Level zero is OpenCL like API and it require that SPIR-V is :

OpCapability Kernel
OpMemoryModel Physical64 OpenCL
..

while my dummy compute kernel as SPIR-V contains:

OpCapability Shader 
OpMemoryModel Logical Simple 
...

How can I compiler my rust compute shader so it is of SPIR-V form OpCapability Kernel ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions