Skip to content

fix(backend): drop hard-coded LIBVA_DRIVER_NAME from main.rs #63

@ubugeeei

Description

@ubugeeei

Problem

`backend/src/main.rs` begins with:

```rust
unsafe {
std::env::set_var("LIBVA_DRIVER_NAME", "radeonsi");
};
```

This hard-codes the AMD radeonsi VA-API driver for every environment, including macOS, Windows, Intel iGPU, and NVIDIA. It also uses `unsafe` to mutate an env var at startup — exactly the pattern the Rust 2024 edition is trying to discourage.

Expected

  • Drop the hard-coded `set_var`.
  • Only honor the existing `LIBVA_DRIVER_NAME` from the caller (Electron / shell).
  • If a default is needed for Linux+AMD, gate it behind a `cfg(target_os = "linux")` and a runtime detection — never on macOS/Windows.

Acceptance

  • `unsafe` block removed.
  • Backend builds clean on all supported platforms.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions