Skip to content

Commit b16dccb

Browse files
committed
fix(mmserver): make missing hardware encode support a hard error
1 parent c51f747 commit b16dccb

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

mm-server/src/main.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,12 +212,6 @@ fn preflight_checks(cfg: &config::Config, vk: &vulkan::VkContext) -> anyhow::Res
212212
cfg.data_home.display(),
213213
))?;
214214

215-
if !vk.device_info.supports_h264 || !vk.device_info.supports_h265 {
216-
warn!(
217-
"no/partial support for hardware encoding! performance may be significantly decreased"
218-
);
219-
}
220-
221215
// Check for Ubuntu's restrictions on rootless containers.
222216
if sysctl("apparmor_restrict_unprivileged_unconfined")
223217
|| sysctl("apparmor_restrict_unprivileged_userns")

mm-server/src/vulkan.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ impl VkDeviceInfo {
234234

235235
for ext in selected_extensions.iter() {
236236
if !contains_extension(&available_extensions, ext) {
237-
return Err(anyhow::anyhow!("extension {:?} not available", ext));
237+
bail!("extension {:?} not available", ext);
238238
}
239239
}
240240

@@ -273,6 +273,10 @@ impl VkDeviceInfo {
273273
}
274274
}
275275

276+
if !supports_av1 && !supports_h265 && !supports_h264 {
277+
bail!("hardware encode extensions not available");
278+
}
279+
276280
// We want HOST_CACHED | HOST_COHERENT, but we can make do with just
277281
// HOST_VISIBLE.
278282
let memory_props = unsafe { instance.get_physical_device_memory_properties(device) };

0 commit comments

Comments
 (0)