vosen/ZLUDA · error
Failed to open {}: {}
Error message
Failed to open {}: {} What it means
ptx build-script panic in check_lfs_file: lib/zluda_ptx_impl.bc (or the constrained variant) could not be opened. These LLVM bitcode files are shipped as Git LFS objects, so the typical cause is LFS not installed or its objects not pulled, leaving the checkout without the real binary.
Source
Thrown at ptx/build.rs:16
use std::fs::File;
use std::io::Read;
fn main() {
let bc_path = "lib/zluda_ptx_impl.bc";
let bc_constrained_path = "lib/zluda_ptx_impl_constrained.bc";
println!("cargo:rerun-if-changed={}", bc_path);
println!("cargo:rerun-if-changed={}", bc_constrained_path);
check_lfs_file(bc_path);
check_lfs_file(bc_constrained_path);
}
fn check_lfs_file(bc_path: &str) {
let mut magic = [0u8; 2];
File::open(bc_path)
.unwrap_or_else(|e| panic!("Failed to open {}: {}", bc_path, e))
.read_exact(&mut magic)
.unwrap_or_else(|e| panic!("Failed to read {}: {}", bc_path, e));
assert!(
&magic == b"BC",
"{} is a git lfs stub and not the actual file. Run `git lfs pull` to fetch it",
bc_path
);
}
View on GitHub (pinned to 9c8b43f242)
Solutions
- Run `git lfs install && git lfs pull` to fetch the bitcode files
- Verify the file under ptx/lib/ exists and is byte-identical to the LFS object, not a pointer stub
- Re-clone with LFS enabled if the objects are missing from the local store
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at ptx/build.rs:16 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of vosen/ZLUDA@9c8b43f242 (2026-09-06).
Data as JSON: /api/errors/6b55f45c026587fb.
Report an issue: GitHub.