Skip to content

APiTJLillo/Anarchy-GPU-Passthrough

Repository files navigation

Anarchy GPU Passthrough

A real-time GPU-over-network solution allowing Windows applications to leverage remote NVIDIA GPUs over Thunderbolt/USB4 networking.

Overview

Anarchy GPU Passthrough enables Windows applications (running on devices like the Legion Go) to transparently use an NVIDIA RTX 4090 GPU hosted on a Linux machine over Thunderbolt/USB4 networking. This project aims to provide a low-latency, high-performance solution for GPU passthrough without requiring complex virtualization setups.

Features

  • Real-time GPU command forwarding over Thunderbolt/USB4
  • Support for Vulkan and DirectX applications
  • Hardware-accelerated frame encoding/decoding
  • Low-latency streaming (<20ms total latency)
  • Bidirectional input support
  • Adaptive quality control

Requirements

Linux Server (Host)

  • Linux distribution (Ubuntu/Debian recommended)
  • NVIDIA GPU with Vulkan support
  • Thunderbolt/USB4 port
  • CMake 3.20 or higher
  • C++20 compatible compiler
  • Vulkan SDK
  • CUDA Toolkit
  • ZeroMQ
  • OpenSSL

Windows Client

  • Windows 11
  • Thunderbolt/USB4 port
  • Visual Studio 2019 or higher (for building)
  • Vulkan SDK
  • DirectX SDK

Building from Source

Linux Server

  1. Install dependencies:
sudo apt update
sudo apt install build-essential cmake vulkan-sdk libzmq3-dev libssl-dev
  1. Clone the repository:
git clone https://github.com/APiTJLillo/Anarchy-GPU-Passthrough.git
cd Anarchy-GPU-Passthrough
  1. Build the project:
mkdir build && cd build
cmake ..
make -j$(nproc)

Windows Client

  1. Install Visual Studio 2019 or higher with C++ development tools
  2. Install Vulkan SDK and DirectX SDK
  3. Clone the repository
  4. Open the solution in Visual Studio and build

Usage

Setting up Thunderbolt Network

  1. Connect the Windows client to the Linux server via Thunderbolt/USB4 cable (recommended length: ≤0.8m)

  2. On Linux:

Option 1: Using setup script (recommended)

sudo ./scripts/setup_thunderbolt.sh

Option 2: Manual configuration

# Configure IP and bring up interface
sudo ip addr add 10.0.0.1/24 dev thunderbolt0
sudo ip link set dev thunderbolt0 up

# Set MTU to 9000 (jumbo frames)
sudo ip link set dev thunderbolt0 mtu 9000

# Optimize network settings
sudo sysctl -w net.core.rmem_max=16777216
sudo sysctl -w net.core.wmem_max=16777216
sudo sysctl -w net.ipv4.tcp_window_scaling=1
sudo sysctl -w net.ipv4.tcp_timestamps=1
sudo sysctl -w net.ipv4.tcp_rmem='4096 87380 16777216'
sudo sysctl -w net.ipv4.tcp_wmem='4096 87380 16777216'
sudo sysctl -w net.ipv4.tcp_congestion_control=bbr
sudo sysctl -w net.core.netdev_max_backlog=30000

# Set CPU governor to performance mode
echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

Note: The setup script also creates persistent sysctl settings that survive reboots.

  1. On Windows:
  • Set static IP (10.0.0.2/24) on Thunderbolt interface
    • IP address: 10.0.0.2
    • Subnet mask: 255.255.255.0
    • Default gateway: Leave empty
    • DNS servers: Leave empty
  • Set MTU to 9000 in adapter properties
  • Disable send/receive coalescing in adapter properties
  1. Verify Connection:
# Test latency (should be <1ms)
ping -c 10 10.0.0.2

# Test throughput (should achieve ~9.5 Gbps)
iperf3 -s                  # On Linux
iperf3 -c 10.0.0.1 -w 32M -l 8192 -P 8  # On Windows

Typical Performance:

  • Latency: ~0.5ms average
  • Throughput: Up to 9.55 Gbps peak
  • Zero packet loss
  • Stable connection suitable for GPU passthrough

Running the Server

./anarchy_server

Installing the Client

  1. Copy the built DLL to the Windows system directory or application directory
  2. Configure the application to use the Anarchy GPU Passthrough ICD

Development Status

This project is currently in early development. See TODO.md for the current roadmap and development status.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors