Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/unreleased/2026-11-28-linux-powervr-mesa-icd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Linux/Wayland: Vulkan direct-driver ICD discovery now matches Mesa's `powervr_mesa_icd` manifest prefix alongside `powervr_icd` when the compositor uses the `powervr` kernel driver.
2 changes: 1 addition & 1 deletion crates/rune/src/render/vulkan_icd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pub(crate) fn icd_prefixes(kernel_driver: &str) -> Option<&'static [&'static str
"panfrost" | "panthor" => Some(&["panfrost_icd"]),
"v3d" => Some(&["broadcom_icd"]),
"asahi" => Some(&["asahi_icd"]),
"powervr" => Some(&["powervr_icd"]),
"powervr" => Some(&["powervr_mesa_icd", "powervr_icd"]),
"virtio_gpu" => Some(&["virtio_icd"]),
_ => None,
}
Expand Down
32 changes: 31 additions & 1 deletion crates/rune/src/render/vulkan_icd_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ fn kernel_driver_table_maps_known_drivers_and_rejects_unknown() {
assert_eq!(icd_prefixes("panthor"), Some(&["panfrost_icd"][..]));
assert_eq!(icd_prefixes("v3d"), Some(&["broadcom_icd"][..]));
assert_eq!(icd_prefixes("asahi"), Some(&["asahi_icd"][..]));
assert_eq!(icd_prefixes("powervr"), Some(&["powervr_icd"][..]));
assert_eq!(icd_prefixes("powervr"), Some(&["powervr_mesa_icd", "powervr_icd"][..]));
assert_eq!(icd_prefixes("virtio_gpu"), Some(&["virtio_icd"][..]));
assert_eq!(icd_prefixes("simpledrm"), None);
assert_eq!(icd_prefixes("radeon"), None);
Expand Down Expand Up @@ -390,6 +390,36 @@ fn scan_discovers_priority_ordered_libraries_and_ignores_other_vendors() {
assert_eq!(stats.manifests_read, 4, "only matching intel_* manifests are opened");
}

#[test]
fn scan_discovers_powervr_mesa_and_generic_icd_manifests() {
let root = TempDirGuard(temp_dir("powervr"));
let icd_dir = root.0.join("icd.d");
std::fs::create_dir_all(&icd_dir).unwrap();

std::fs::write(
icd_dir.join("powervr_mesa_icd.x86_64.json"),
r#"{"ICD":{"library_path":"/usr/lib64/libvulkan_powervr_mesa.so","library_arch":"64"}}"#,
)
.unwrap();
std::fs::write(
icd_dir.join("powervr_icd.aarch64.json"),
r#"{"ICD":{"library_path":"/usr/lib/libvulkan_powervr.so","library_arch":"64"}}"#,
)
.unwrap();
std::fs::write(icd_dir.join("nvidia_icd.json"), b"UNRELATED VENDOR").unwrap();

let (libs, stats) = scan_candidate_libraries("powervr", &[icd_dir], "64")
.expect("powervr scan succeeds");
assert_eq!(
libs,
vec![
PathBuf::from("/usr/lib/libvulkan_powervr.so"),
PathBuf::from("/usr/lib64/libvulkan_powervr_mesa.so"),
]
);
assert_eq!(stats.manifests_read, 2, "only matching powervr manifests are opened");
}

#[test]
fn scan_bails_out_on_oversized_malformed_or_too_many_matching_manifests() {
let root = TempDirGuard(temp_dir("bounds"));
Expand Down
Loading