MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / check_gpu_privileges

Function check_gpu_privileges

crates/openshell-driver-vm/src/driver.rs:3126–3135  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3124
3125#[cfg(target_os = "linux")]
3126fn check_gpu_privileges() -> Result<(), String> {
3127 if !rustix::process::geteuid().is_root() {
3128 return Err(
3129 "GPU support requires root privileges for VFIO bind/unbind and TAP networking. \
3130 Run with sudo or ensure CAP_SYS_ADMIN + CAP_NET_ADMIN capabilities are set."
3131 .to_string(),
3132 );
3133 }
3134 Ok(())
3135}
3136
3137// `tonic::Status` is ~176 bytes; it's the standard error type across the
3138// gRPC API surface, so boxing here would diverge from every other handler.

Callers 1

new_with_extensionsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected