Skip to content

PTX generation failed; Intrinsic has incorrect argument type!; ptr @llvm.lifetime.start.p0 #150

Closed

Description

@mutantbob

While troubleshooting another issue I encountered an inscrutable error. I was able to strip the code down to the following kernel which fails to build

use cuda_device::cuda_module;

#[cuda_module]
mod kernels {
    use cuda_device::{DisjointSlice, gpu_printf, kernel, thread};

    #[kernel]
    pub fn misbehave(mut dst: DisjointSlice<i32>) {
        let idx = thread::index_1d();
        if let Some(_) = dst.get_mut(idx) {
            check3();
        }
    }

    fn check3() {
        {
            let (r, borrow) = 0x4bf9_0000u32.overflowing_sub(0xf329_0000);
            gpu_printf!("{:x}, {}\n", r, borrow);
            // let (c, d) = r.overflowing_sub(0);
            // gpu_printf!("{:x}, {}; {}\n", c, d, borrow || d);
        }
    }
}

cargo oxide build fails with

error: [rustc_codegen_cuda] Device codegen failed: PTX generation failed: PTX generation failed: CUDA_OXIDE_LLC=/usr/lib/llvm/21/bin/llc failed:
       Intrinsic has incorrect argument type!
       ptr @llvm.lifetime.start.p0
       Intrinsic has incorrect argument type!
       ptr @llvm.lifetime.start.p0
       Intrinsic has incorrect argument type!
       ptr @llvm.lifetime.end.p0
       Intrinsic has incorrect argument type!
       ptr @llvm.lifetime.end.p0
       llc: error: '/home/thoth/src/cuda-oxide-experiments/codegen_explosion_9.opt.ll': input module cannot be verified

Activity

  1. added
    bug
    codegen
    build-related
    on Jun 10, 2026
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

    bugbuild-relatedcodegen

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions