Binding & Releasing Orchestrator Script Switcher
β οΈ WARNING - EXPERT LEVEL TOOLπ¨ THIS SCRIPT CAN BREAK YOUR SYSTEM π¨
If you don't understand VFIO, IOMMU, PCI bind/unbind, STOP IMMEDIATELY.
This tool is designed for systems ALREADY CONFIGURED for GPU passthrough on Linux.REAL RISKS:
- Permanent black screen requiring forced reboot
- Crashed graphical session
- Inaccessible GPU requiring technical intervention
- Data loss from forced reboots
MANDATORY PREREQUISITES:
- IOMMU enabled and functional
- iGPU configured and tested for display
- VFIO already configured and tested
- Complete system backup
- Advanced Linux administration knowledge
You have been warned. π₯
β οΈ ALWAYS TEST ON A TEST MACHINE FIRSTβ οΈ
π¬ In a world where enthusiasts want everything: play Steam games,
train AI models, run powerful VMs and maintain a stable OS...
One question arises:
What if I could hot-swap my GPU like a pro?
Welcome to B.R.O.S.Switcher.
A professional tool designed for VERY advanced users who juggle between Linux host and Windows VMs,
without reboots, without pain, and with style.
- π Hot-release GPU for VM passthrough (bind to
vfio-pci) - π Hot-reclaim GPU for host (bind to
nvidia) - π§ͺ Real-time status display of current driver
- π Smart binding prevents errors if GPU already bound to VFIO or NVIDIA
- ποΈ Interactive console menu for easy operation
- β Automatic configuration validation
- π‘οΈ Safety checks before dangerous operations
π₯ CRITICAL - You MUST already have:
- IOMMU enabled in BIOS AND kernel
- VFIO working (
vfio-pci, etc.) and TESTED - Stable graphical session on iGPU (not NVIDIA GPU)
- Display manager:
lightdm,gdmorsddm - NVIDIA modules installed:
nvidia-driveron Debian or equivalent - Complete system backup
- Test machine for validation before production
π¨ IF YOU DON'T HAVE ALL OF THESE, DON'T USE THIS SCRIPT! π¨
You MUST customize these values in the script before any use:
GPU_BUSID="0000:01:00.0"
AUDIO_BUSID="0000:01:00.1"
GPU_VENDOR="10de"
GPU_DEVICE="2484"
AUDIO_VENDOR="10de"
AUDIO_DEVICE="228b"lspci | grep -i nvidiaExample output:
01:00.0 VGA compatible controller: NVIDIA ...
01:00.1 Audio device: NVIDIA ...
β‘οΈ Format BusID as follows:
GPU_BUSID="0000:01:00.0"
AUDIO_BUSID="0000:01:00.1"lspci -nn | grep -i nvidiaExample output:
01:00.0 VGA compatible controller [0300]: NVIDIA [10de:2484]
01:00.1 Audio device [0403]: NVIDIA [10de:228b]
β‘οΈ Which gives:
GPU_VENDOR="10de"
GPU_DEVICE="2484"
AUDIO_VENDOR="10de"
AUDIO_DEVICE="228b"π₯ WRONG CONFIG = BROKEN SYSTEM π₯
You can automate the setup with the bros-setup.sh script:
chmod +x bros-setup.sh
./bros-setup.shIt will install useful dependencies (pciutils, lsof, etc.) and configure your system for optimal GPU switching.
./bros-vfio.shFollow the interactive menu:
=== B.R.O.S.Switcher VFIO Menu ===
1) Release GPU for VM (bind vfio-pci)
2) Reclaim GPU for host (bind nvidia)
3) Show GPU driver status
q) Quit
π¨ IN CASE OF BLACK SCREEN: Ctrl+Alt+F2 to access emergency TTY π¨
- Ctrl+Alt+F2 to switch to TTY
- Login with your credentials
- Execute:
sudo systemctl restart lightdm(orgdm/sddm) - If it doesn't work:
sudo reboot
# Force return to NVIDIA driver
sudo modprobe nvidia
echo "0000:01:00.0" | sudo tee /sys/bus/pci/drivers/vfio-pci/unbind
echo "0000:01:00.0" | sudo tee /sys/bus/pci/drivers/nvidia/bind
sudo systemctl restart lightdm# GPU status
lspci -nnk -s 0000:01:00.0
# GPU processes
lsof | grep nvidia
# Check IOMMU
dmesg | grep -i iommu"IOMMU not enabled"?
- Enable IOMMU in BIOS (Intel VT-d / AMD-Vi)
- Add
intel_iommu=onoramd_iommu=onto kernel parameters - Reboot
"GPU not found"?
Check your BusID with:
lspci | grep -i nvidia
lspci -nn | grep -i nvidia"Bind failed"?
GPU might be used by a process:
sudo fuser -v /dev/nvidia*
sudo pkill -f nvidia- Tested primarily on Debian 12 (Bookworm) - other distros may need adaptation
- Requires functional iGPU for display output
- GPU processes must be closed before switching
- Some proprietary drivers may resist unbinding
- No AMD GPU support yet (contributions welcome)
- May require multiple attempts depending on system load
- Display manager restart required for some operations
If your system becomes unusable:
- Boot in rescue/recovery mode
- Disable the script:
rm /usr/local/bin/bros-vfio.sh - Remove X11 config:
sudo rm /etc/X11/xorg.conf.d/20-intel.conf - Force NVIDIA driver:
sudo modprobe nvidia && sudo systemctl restart lightdm
Contributions are welcome! Here's how to help:
- Issues: Bug reports, feature requests
- Pull Requests: Fixes, improvements, support for other distros
- Documentation: Guides for other GPUs (AMD, Intel Arc)
- Testing: Validation on different configurations
- AMD GPU support
- GTK/Qt graphical interface
- Automatic BusID configuration
- Fedora/Arch/Ubuntu support
- Automatic recovery mode
- Detailed operation logging
- Multi-GPU configurations
- Container integration (Docker/Podman)
Successfully tested configurations:
- Debian 12 + RTX 3080 + Intel iGPU
- Windows 11 VM + Ubuntu host
- Gaming VM + AI/ML on host
- Dual-boot replacement setup
Share your config! Open an issue to document your success and help others.
Created by a passionate developer focused on VM technology, gaming, and advanced graphics manipulation on Linux.
Want to contribute, share your configurations, or add new features?
Open an issue, submit a PR, or reach out directly. We're building a professional community here.
B.R.O.S.Switcher is developed voluntarily in my free time. If this tool helps with your VFIO/gaming projects, you can support its development:
β Buy me a coffee
Your support helps:
- π§ͺ Buy hardware for testing (AMD GPUs, different configs)
- β° Dedicate more time to development
- π Add new features and improvements
- π Improve documentation and guides
- π Maintain project infrastructure
Thank you to everyone supporting the project! π
MIT License
Do what you want with it. Just manage your VFIO responsibly.
You're playing with the kernel, not with toys.
π¨ LEGAL DISCLAIMER π¨
This software is provided "as is", without warranty of any kind.
Users assume all risks associated with its use.
Made with β€οΈ (and lots of β) by B.R.O.S.Switcher Team
Version 2.0.0 - Professional Release
Binding & Releasing Orchestrator Script Switcher