惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

腾讯CDC
aimingoo的专栏
aimingoo的专栏
S
SegmentFault 最新的问题
A
About on SuperTechFans
Engineering at Meta
Engineering at Meta
宝玉的分享
宝玉的分享
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 叶小钗
WordPress大学
WordPress大学
N
Netflix TechBlog - Medium
MyScale Blog
MyScale Blog
Stack Overflow Blog
Stack Overflow Blog
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 聂微东
M
MIT News - Artificial intelligence
F
Fortinet All Blogs
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Blog — PlanetScale
Blog — PlanetScale
T
Tailwind CSS Blog
Recent Announcements
Recent Announcements
Jina AI
Jina AI
大猫的无限游戏
大猫的无限游戏
Apple Machine Learning Research
Apple Machine Learning Research
J
Java Code Geeks

Show HN

GitHub - astefanutti/shaderbang: Shebang for Shaders Show HN: Generate Claude Code Workflows using Spec Driven Development approach Show HN: AI agents for UK GDAD PCF roles and their skills The Two Pillars: Mixer Mode and Meta-Software in the Reorganization of Software Work After AI GitHub - JaiCode08/teleport-env What 1,000+ Harness Experiments Taught Me About Self-Improving Agents Show HN: Liiists, a Markdown-first, iOS and CLI list app SwiperTab – Get this Extension for 🦊 Firefox (en-US) GitHub - kouhxp/fftext: Summarize, explain, fact-check, or translate any text, URL, or file. No GPU. No cloud. One command GitHub - sweetpad-dev/sweetpad: Develop Swift/iOS projects using VSCode GitHub - dogmaticdev/IRON: IRON a.k.a. Intermediate Representation Object Notation is a Interpreter/Database that is used to create Programming Languages. GitHub - sjhalani7/vaen: Package your AI coding harness into a portable .agent file, and share it across repos, teams, & the community without ever having to copy-paste instructions, skills, MCP config, or secrets. Show HN: Gandalf the Grader Show HN: Citadeld – replay any CI failure locally from a single file GitHub - tdortman/cuSBF: High-Performance GPU Super Bloom Filter coral-ai/claude-code-token-xray at main · Coral-Bricks-AI/coral-ai GitHub - ulyssestenn/funes: Funes is a Git-based framework for LLM-managed knowledge work: an AI Librarian ingests raw sources, builds an interlinked Markdown knowledge base, and uses it to produce cited reports, analyses, and other outputs. GitHub - ThatXliner/gah: Git Add Hunk, built for agents to use GitHub - harmont-dev/harmont-cli: Command-line client for the Harmont CI platform GitHub - brooksmcmillin/mcp-authflow: OAuth 2.0 Authorization Server framework for MCP servers GitHub - javaid-codes/audit-supply-chain-agents GitHub - amorey/gochan: A small library of common channel architectures for Go, inspired by Rust GitHub - arifozgun/OpenGem: Free, Open-Source AI API Gateway with Gemini, OpenAI & Anthropic Compatibility in 1 file GitHub - Pranesh950/BioPetals: 🌸 Run BIOxAI models at home, BitTorrent-style. Fine-tuning and inference up to 10x faster than offloading GitHub - cnguyen14/bounty-doctor: Diagnose a GitHub bounty issue before you waste hours: detects honeypot scam repos, AI-bot attempt swarms, and stale contests. Show HN: CoreMCP – MCP Server for On-Prem DBs Show HN: KittyHTML – Render HTML/CSS as an inline image in your terminal GitHub - bingud/filemat: Web-based file manager Show HN: TruthLens – Free multi-signal deepfake image detector GitHub - apexlocal-jz/claude-usage-tray: Windows system-tray app showing your Claude Code rate-limit usage at a glance. Zero deps, ~300 lines of PowerShell. Cross-IDE (works regardless of VS Code, Cursor, plain terminal).
GitHub - LuMarans30/switcheroo-control-rs: A Rust port of...
LuMarans30 · 2026-06-14 · via Show HN

A Rust port of the original switcheroo-control daemon and CLI tool by Bastien Nocera.

From a switcheroo-control man page:

switcherooctl is the command-line interface for switcheroo-control, a daemon that manages hybrid graphics on Linux laptops with multiple GPUs. It provides a simple way to list available graphics adapters and launch applications on a specific GPU.

On hybrid graphics systems with both integrated (power-efficient) and discrete (high-performance) GPUs, applications default to the integrated GPU. Using switcherooctl, you can run specific applications on the discrete GPU for better graphics performance.

This port uses the udev crate for GPU monitoring, combined with the nix crate for low-level ioctl driver queries (amdgpu, i915, nouveau, and xe drivers) to determine whether a card is discrete or integrated.

It reimplements the standard net.hadess.SwitcherooControl interface using the zbus crate.

switcherooctl provides a user-friendly CLI via the clap crate, including implicit subcommands which are also present in the original project. The daemon likewise uses clap for its own --replace flag.

Also, just like the original project, it includes a regex-based cleanup module to prettify GPU information before it is published over D-Bus

Workspace Members

Crate Description
switcheroo-daemon Background system service that monitors hardware and exposes it over D-Bus
switcherooctl CLI utility used to list GPUs and launch binaries using a specific GPU
switcheroo-common Shared types, serialization/deserialization logic and D-Bus definitions

Architecture

flowchart TB
    User((User))

    subgraph Userspace [Userspace Context]
        CLI(switcherooctl)
        Daemon(switcheroo-daemon)
        DBus{{D-Bus System Bus}}
        TargetApp[[Target Application]]
    end

    subgraph OS_Kernel [OS & Kernel Interface]
        subgraph UdevSub [udev Subsystem]
            Udev[udev crate]
            LibUdev[libudev C FFI]
        end

        subgraph IOCTL_Sub [DRM Subsystem]
            DRM_Nodes[(/dev/dri/render*)]
            Drivers[\amdgpu, i915, xe, nouveau, nvidia/]
        end
    end

    User -->|Runs| CLI
    
    CLI -->|Queries GPUs| DBus
    DBus <-->|net.hadess.SwitcherooControl| Daemon
    DBus -->|GPU info & env| CLI
    
    CLI -.->|Spawns with env vars| TargetApp
    
    Daemon -->|Queries GPUs & watch events| Udev
    Udev -->|GPUs info & events| Daemon
    
    Daemon -->|switcheroo-discrete-gpu tag check| LibUdev
    LibUdev -->|is_discrete| Daemon
    
    Daemon -->|IOCTL probe| DRM_Nodes
    DRM_Nodes -->|VRAM / LMEM status| Daemon
    
    DRM_Nodes --- Drivers
    TargetApp -.->|Render offload| Drivers
Loading

Usage

Ensure you have the libudev library installed where it can be found by pkg-config.

Example:

sudo apt-get install libudev-dev    # Debian-based Linux distributions
sudo zypper install systemd-devel   # openSUSE/SLE

Compile a release build using Cargo:

To test the daemon locally, stop the existing system service first to avoid D-Bus conflicts:

sudo systemctl stop switcheroo-control
sudo ./target/release/switcheroo-daemon

Tip

The daemon supports a --replace flag to replace an already running instance. Without it, the daemon will exit immediately if another instance holds the bus name.

You can now use the CLI tool:

./target/release/switcherooctl help
Usage: switcherooctl [OPTIONS] [COMMAND]

Commands:
  list    List the known GPUs
  launch  Launch a command on a specific GPU
  help    Print this message or the help of the given subcommand(s)

Options:
  -g, --gpu <GPU>
  -h, --help       Print help

Example

Launch the glmark2's refract benchmark on a discrete GPU:

./target/release/switcherooctl launch --gpu 1 glmark2 -b refract

For simplicity, you can also omit subcommands:

./target/release/switcherooctl            # "switcherooctl list"
./target/release/switcherooctl <program>  # "switcherooctl launch <program>" 

License

The project is licensed under GPL-3.0-or-later to match upstream.