Skip to content

Crash when compiling DisjointSlice::len #343

Closed

Description

@George-Ogden

Description
cuda oxide crashes due to a verification issue.

Minimal reproducer

fn main() {
    println!("Hello, world!",);
}

#[cuda_host::cuda_module]
mod kernels {
    use cuda_device::{kernel, DisjointSlice};
    #[kernel]
    pub fn placeholder(out: DisjointSlice<u32>) {
        let _ = out.len();
    }
}

Expected behavior
The code should compile.

Actual behavior

error: [rustc_codegen_cuda] Device codegen failed: PTX generation failed: Verification failed for 'placeholder':
         ["src/main.rs": line: 10, column: 17] Compilation error: verification failed.
       MirExtractFieldOp operand must be tuple, slice, struct, array, or scalar (newtype)
         Failed operation:
       v6 = mir.extract_field (v5) [] [index: mir.field_index 1]: <(mir.ptr <mir.disjoint_slice <builtin.integer ui32>
,mutable:false,addrspace:0>) -> (builtin.integer ui64)> !0

Environment

  • GPU: RTX A4000
  • CUDA driver version: 595.58.03 (Cuda 13.2)
  • rustc --version --verbose:
rustc 1.96.0-nightly (55e86c996 2026-04-02)
binary: rustc
commit-hash: 55e86c996809902e8bbad512cfb4d2c18be446d9
commit-date: 2026-04-02
host: x86_64-unknown-linux-gnu
release: 1.96.0-nightly
LLVM version: 22.1.2

Additional context
Attach .ll / .ptx files if the pipeline produces them before failing.
Where are these?


Not sure if this is a bug? Ask in #help on Discord first.

Activity

  1. added
    bug
    TBD
    on Jul 4, 2026
  2. SomeB1oody commented on Jul 12, 2026

    @SomeB1oody
    Contributor

    I was unable to reproduce the issue under the default configuration, but it did occurred when MIR inline was disabled. It might be because you used a certain configuration that did not trigger the inline build in your project.

    Anyway, this is a bug. I am working on fixing it.

  3. added a commit that references this issue on Jul 20, 2026
    508a390
  4. added a commit that references this issue on Jul 22, 2026
    25c3c57
  5. added a commit that references this issue on Jul 23, 2026
    5ca9106
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    TBDbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions