Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
178779c
refactor(cardwired): correct gpu types
luytan Sep 8, 2026
f510572
feat(cardwired): working vulkan
luytan Sep 13, 2026
151dab7
feat: bind systemd service to graphical
luytan Sep 13, 2026
bc95f91
refactor(cardwired): re-organise folder structure for gpu
luytan Sep 13, 2026
9f20798
feat(cardwired): working amd and intel detection
luytan Sep 13, 2026
acbf25a
refactor(cardwired): move amdgpu into a struct, caching the query
luytan Sep 13, 2026
f2f5c9c
feat(cardwired): also check the driver and act corresponding to it
luytan Sep 13, 2026
630c64f
feat(cardwired): handle specific drivers during enum and logs errors
luytan Sep 13, 2026
a03f23f
feat(cardwired): clean Vulkan device name
luytan Sep 13, 2026
e6567d4
feat(cardwired): empty nova file
luytan Sep 13, 2026
1b6315a
feat(cardwired): nvidia detection
luytan Sep 13, 2026
4c77e26
chore(cardwired): run clippy
luytan Sep 13, 2026
b26acce
refactor(cardwired): add catch-all for env
luytan Sep 13, 2026
47d1226
refactor(cardwired): use pci_id
luytan Sep 13, 2026
a19a093
feat(cardwired): add logs to drm loop
luytan Sep 13, 2026
df401df
feat(cardwired): initial support for virtio
luytan Sep 13, 2026
65ab693
chore(cardwired): deprecated amggpu.ids
luytan Sep 13, 2026
d34fc38
chore(cardwired): add repr for GpuType and remove CPU type
luytan Sep 13, 2026
9d100e9
feat(cardwire-cli): implement new DBUS to cli
luytan Sep 13, 2026
f1cc6ce
chore(cardwired): wildcard pattern cover Other too
luytan Sep 14, 2026
9570b2a
fix(cardwired): correct Virtio vendor
luytan Sep 14, 2026
5525292
fix(cardwired): manual gpu typing for ci
luytan Sep 14, 2026
1e7efa7
refactor(cardwired): simplify drm error handling in gpu building
luytan Sep 15, 2026
e55b905
fix(cardwired): use gpu type for systemtype check, and todo
luytan Sep 15, 2026
d5136d4
feat(cardwired): bump drm retry
luytan Sep 15, 2026
53745ff
docs(cardwired): add todo for xe ioctl in the future, if intel fails
luytan Sep 15, 2026
59347b5
fix(cardwired): actually return none if drm devices couldn't be read
luytan Sep 16, 2026
2c06979
fix(cardwired): skip vulkan drm if it fails
luytan Sep 16, 2026
c6bec0b
fix(cardwired): remove unwrap in amd.rs
luytan Sep 16, 2026
a01b5c8
fix(cardwired): prevent un-available gpu inodes from getting searched
luytan Sep 16, 2026
7893ceb
refactor(cardwired): replace match with if let in vulkan drm nodes
luytan Sep 16, 2026
6b0edc5
fix(cardwired): typo in geforce and add GTX
luytan Sep 16, 2026
a10738e
ci: fix bpf-linker to 0.11.0
luytan Sep 16, 2026
b32a3cd
feat: update nix systemd service
luytan Sep 19, 2026
066f2d0
fix: load before multi-user
luytan Sep 19, 2026
c1093b0
feat(cardwired): add debug logs to nvml
luytan Sep 20, 2026
0aaa1e6
feat(cardwired): add external Gpu Type
luytan Sep 20, 2026
f1fd2c3
feat(cardwired): add External type to the systemtype impl, remove Des…
luytan Sep 20, 2026
75c2d27
refactor(cardwired): simplify vulkan compatible with a one liner
luytan Sep 20, 2026
980e990
feat(cardwire-gui): update for the new Gpu API
luytan Sep 20, 2026
9093ef7
feat(packaging): add libdrm
luytan Sep 20, 2026
857a932
feat(packaging): align nix with nixpkgs upstream, and add libdrm to t…
luytan Sep 20, 2026
0ab7982
feat(cardwired): update mode error message
luytan Sep 20, 2026
5d99197
feat(packaging): add libdrm-amdgpu1 to debian
luytan Sep 20, 2026
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
2 changes: 1 addition & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
with:
version: "1.21.1"
- name: Install bpf-linker
run: cargo binstall bpf-linker
run: cargo binstall --version 0.11.0 --locked --no-confirm bpf-linker
Comment thread
luytan marked this conversation as resolved.
- name: Clippy Workspace
uses: auguwu/clippy-action@9817d076b82df0194935be9db6154c56ac07b317 # 1.5.0
with:
Expand Down
104 changes: 99 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ anyhow = "1.0.102"
env_logger = "0.11"
toml = "1.0.3"
vulkano = "0.35.2"
khronos-egl = { version= "6.0.0", features = ["dynamic", "1_5"] }
khronos-egl = { version = "6.0.0", features = ["dynamic", "1_5"] }
rusqlite = { version = "0.40.1", features = ["bundled"] }
libdrm_amdgpu_sys = { version = "0.9.0", default-features = false, features = ["dynamic_loading"]}
nvml-wrapper = "0.13.0"

# EBPF
aya = "0.14.0"
Expand Down
6 changes: 5 additions & 1 deletion assets/cardwired.service
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
[Unit]
Description=Cardwire Daemon
After=dbus.service
Before=graphical.target display-manager.service
# drm-module-load.target is from cachyos
# <https://github.com/CachyOS/CachyOS-PKGBUILDS/pull/1695>
After=drm-module-load.target
Wants=drm-module-load.target


[Service]
Expand Down
20 changes: 15 additions & 5 deletions crates/cardwire-cli/src/dbus.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::collections::BTreeMap;

use zbus::{Proxy, connection::Connection};
use zbus::{Proxy, connection::Connection, zvariant};

use crate::display::PciDevice;

Expand All @@ -12,14 +12,24 @@ pub struct DbusGpuDevice {
pub render: u32,
pub card: u32,
pub default: bool,
pub discrete: bool,
pub virtual_gpu: bool,
pub available: bool,
pub device_type: GpuType,
pub vendor: String,
pub driver: String,
pub nvidia: bool,
pub nvidia_minor: String,
}
#[derive(
Clone, Debug, serde::Serialize, serde::Deserialize, Default, PartialEq, zvariant::Type,
)]
#[repr(u32)]
pub enum GpuType {
Integrated = 0,
Discrete = 1,
Virtual = 2,
Other = 3,
Unavailable = 4,
#[default]
Unknown = 5,
}

pub struct DaemonClient<'a> {
proxy: Proxy<'a>,
Expand Down
38 changes: 15 additions & 23 deletions crates/cardwire-cli/src/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
use std::collections::BTreeMap;

use anyhow::{Ok, Result};

use crate::dbus::GpuType;
// Define the struct here instead of importing from cardwire_core,
// I want cardwire-cli to be independent of the rest of cardwire
// This allow other dev to make their own client for cardwire
Expand All @@ -16,14 +18,11 @@ pub struct GpuDevice {
pub render: u32,
pub card: u32,
pub default: bool,
pub discrete: bool,
pub virtual_gpu: bool,
pub available: bool,
pub device_type: GpuType,
pub vendor: String,
pub driver: String,
pub blocked: bool,
pub launchable: bool,
pub nvidia: bool,
pub nvidia_minor: String,
}
#[derive(serde::Deserialize, serde::Serialize, zbus::zvariant::Type)]
Expand Down Expand Up @@ -119,7 +118,11 @@ fn pretty_print_gpu(gpu_list: BTreeMap<usize, GpuDevice>) {
render_full,
card_full,
if gpu.default { "(*)" } else { "( )" },
if gpu.discrete { "(*)" } else { "( )" },
if gpu.device_type == GpuType::Discrete {
"(*)"
} else {
"( )"
},
gpu.blocked,
id_w = id_w,
name_w = name_w,
Expand All @@ -144,9 +147,7 @@ mod tests {
name: &str,
pci: &str,
default: bool,
discrete: bool,
virtual_gpu: bool,
available: bool,
device_type: GpuType,
vendor: &str,
driver: &str,
blocked: bool,
Expand All @@ -158,14 +159,11 @@ mod tests {
render: 128,
card: 0,
default,
discrete,
virtual_gpu,
available,
device_type: device_type.clone(),
vendor: vendor.to_string(),
driver: driver.to_string(),
blocked,
launchable: !blocked && available,
nvidia: false,
launchable: !blocked && device_type != GpuType::Unavailable,
nvidia_minor: String::new(),
}
}
Expand All @@ -180,9 +178,7 @@ mod tests {
"Intel UHD",
"0000:00:02.0",
true,
false,
false,
true,
GpuType::Integrated,
"Intel",
"xe",
false,
Expand All @@ -195,9 +191,7 @@ mod tests {
"RTX 4060",
"0000:01:00.0",
false,
true,
false,
true,
GpuType::Discrete,
"Nvidia",
"nouveau",
true,
Expand Down Expand Up @@ -226,9 +220,7 @@ mod tests {
"RX 7900 XTX",
"0000:03:00.0",
false,
true,
false,
true,
GpuType::Discrete,
"AMD",
"amdgpu",
false,
Expand All @@ -242,6 +234,6 @@ mod tests {
assert_eq!(parsed.card, 0);
assert!(!parsed.default);
assert!(!parsed.blocked);
assert!(!parsed.nvidia);
assert!(parsed.vendor != "Nvidia");
}
}
Loading
Loading