Code Monkey home page Code Monkey logo

egpu-switcher's Introduction

egpu-switcher

Distribution agnostic eGPU script that works with NVIDIA and AMD cards.

License Information

Description

The goal of this CLI is to lower the barrier for Linux users to use their eGPU on the Linux Desktop. With the egpu-switcher config command the user can choose their external GPU. On every bootup the service will check if the eGPU is connected and if so, make X.Org prefer it.


Limitations

  • No hotplugging is possible. Users still need to reboot their computer to connect / disconnect the eGPU.

Requirements

  • Running X.Org
  • Thunderbolt connection to eGPU is authorized
  • Necessary graphics drivers for eGPU are installed

Installation

Ubuntu (apt)

The PPA is no longer maintained for now (see #90)

Arch (aur)

paru -S egpu-switcher

Note: paru is an AUR helper written in Rust ๐Ÿฆ€

Manual

Installation and setup:

git clone [email protected]:hertg/egpu-switcher.git
cd egpu-switcher
make build -s
sudo make install -s
sudo egpu-switcher enable

Uninstall:

sudo egpu-switcher disable
sudo make uninstall -s

Commands

Usage:
  egpu-switcher [command]

Available Commands:
  config      Choose your external GPU
  disable     Disable egpu-switcher from running at startup
  enable      Enable egpu-switcher to run at startup
  help        Help about any command
  switch      Check if eGPU is present and configure X.org accordingly
  version     Print version information

Flags:
  -h, --help      help for egpu-switcher
  -v, --verbose   verbose output

Use "egpu-switcher [command] --help" for more information about a command.


Configuration

The config file is created automatically and can be found at /etc/egpu-switcher/config.yaml. Below you can see an example of a configuration file, annotated with some notes.

# the 'egpu' config is generated by 'egpu-switcher config'.
# you probably shouldn't change this manually.
egpu:
    driver: amdgpu
    id: 1153611719250962689

# OPTIONAL: how many times 'egpu-switcher switch auto' should retry finding the egpu.
# this can be helpful if the egpu takes some time to connect on your machine,
# the following values are the default, if this config is omitted.
detection:
  retries: 6
  interval: 500 # milliseconds

# OPTIONAL: if you want to execute a script after switching to egpu/internal.
# the values must be absolute paths to a shell script, this script will
# then be run with '/bin/sh $script'.
# 
# it is required that the script is owned by root (uid 0) 
# and has a permission of -rwx------ (0700), in order to
# prevent potential privilege escalation.
hooks:
  internal: /home/michael/tmp/internal.sh
  egpu: /home/michael/tmp/egpu.sh

Troubleshooting

If you run into problems, please have a look at TROUBLESHOOT.md before reporting any issues.

egpu-switcher's People

Contributors

hertg avatar ewagner12 avatar fennifith avatar maddocker avatar toumorokoshi avatar xabolcs avatar tbabej avatar marcolaux avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.