{"id":13612983,"url":"https://github.com/hertg/egpu-switcher","last_synced_at":"2025-04-07T15:05:25.721Z","repository":{"id":43512326,"uuid":"169926735","full_name":"hertg/egpu-switcher","owner":"hertg","description":"🖥🐧 Setup script for eGPUs in Linux (X.Org)","archived":false,"fork":false,"pushed_at":"2024-10-01T13:02:27.000Z","size":23604,"stargazers_count":580,"open_issues_count":18,"forks_count":56,"subscribers_count":15,"default_branch":"main","last_synced_at":"2024-10-16T13:11:12.470Z","etag":null,"topics":["egpu","hacktoberfest","linux","x11","xorg","xorg-config","xserver"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hertg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":"FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["hertg"]}},"created_at":"2019-02-09T23:57:29.000Z","updated_at":"2024-10-15T20:18:35.000Z","dependencies_parsed_at":"2024-10-25T19:13:55.199Z","dependency_job_id":"5e82acae-d740-4b16-843e-a47d8bf51767","html_url":"https://github.com/hertg/egpu-switcher","commit_stats":null,"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hertg%2Fegpu-switcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hertg%2Fegpu-switcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hertg%2Fegpu-switcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hertg%2Fegpu-switcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hertg","download_url":"https://codeload.github.com/hertg/egpu-switcher/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247675597,"owners_count":20977376,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["egpu","hacktoberfest","linux","x11","xorg","xorg-config","xserver"],"created_at":"2024-08-01T20:00:37.599Z","updated_at":"2025-04-07T15:05:25.701Z","avatar_url":"https://github.com/hertg.png","language":"Go","funding_links":["https://github.com/sponsors/hertg"],"categories":["Go"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003e\u003cstrong\u003eegpu-switcher\u003c/strong\u003e\u003c/h1\u003e\n  \u003cp\u003e\n\t\t\u003cstrong\u003eDistribution agnostic eGPU script that works with NVIDIA and AMD cards.\u003c/strong\u003e\n  \u003c/p\u003e\n  \u003cp\u003e\n    \u003c!--\u003ca href=\"https://goreportcard.com/report/github.com/hertg/egpu-switcher\"\u003e\n      \u003cimg alt=\"Go Report Card\" src=\"https://goreportcard.com/badge/github.com/hertg/egpu-switcher\" /\u003e\n    \u003c/a\u003e--\u003e\n    \u003ca href=\"#\"\u003e\n\t\t\t\u003cimg alt=\"License Information\" src=\"https://img.shields.io/github/license/hertg/egpu-switcher\"\u003e\n    \u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n## Description\n\nThe goal of this CLI is to lower the barrier for Linux users to\nuse their eGPU on the Linux Desktop. With the `egpu-switcher config`\ncommand the user can choose their external GPU.\nOn every bootup the service will check if the eGPU is connected\nand if so, make X.Org prefer it.\n\n\u003e [!NOTE]\n\u003e No hotplugging is possible. Users still need to reboot their computer to connect / disconnect the eGPU.\n\n## Requirements\n\n- Running X.Org\n- Thunderbolt connection to eGPU is authorized\n- Necessary graphics drivers for eGPU are installed\n\n## Installation\n\n### Ubuntu (apt)\n\n*The PPA is no longer maintained for now (see [#90](https://github.com/hertg/egpu-switcher/issues/90))*\n\n### Arch (aur)\n\n```bash\nparu -S egpu-switcher\n```\n\n\u003e [!TIP]\n\u003e :deciduous_tree::zap: Save time and energy by using the pre-compiled `egpu-switcher-bin` package\n\n\n### Manual\n\n#### Installation and setup\n\nDownload binary from [latest release](https://github.com/hertg/egpu-switcher/releases)\n\nCopy binary to `/opt`, apply proper permissions, and link it in `/usr/bin`\n\n```bash\nsudo cp \u003cdownloaded-binary\u003e /opt/egpu-switcher\nsudo chmod 755 /opt/egpu-switcher\nsudo ln -s /opt/egpu-switcher /usr/bin/egpu-switcher\nsudo egpu-switcher enable\n```\n\n#### Uninstall\n\n```bash\nsudo egpu-switcher disable --hard\nsudo rm /usr/bin/egpu-switcher\nsudo rm /opt/egpu-switcher\n```\n\n### Build\n\n#### Prerequisites\n\nInstall the [go toolchain](https://go.dev/doc/install)\n\n#### Installation and setup\n\n```bash\ngit clone git@github.com:hertg/egpu-switcher.git\ncd egpu-switcher\nmake build -s\nsudo make install -s\nsudo egpu-switcher enable\n```\n\n#### Uninstall\n\n```bash\nsudo egpu-switcher disable --hard\nsudo make uninstall -s\n```\n\n\n## Commands\n\n```txt\nUsage:\n  egpu-switcher [command]\n\nAvailable Commands:\n  config      Choose your external GPU\n  disable     Disable egpu-switcher from running at startup\n  enable      Enable egpu-switcher to run at startup\n  help        Help about any command\n  switch      Check if eGPU is present and configure X.org accordingly\n  version     Print version information\n\nFlags:\n  -h, --help      help for egpu-switcher\n  -v, --verbose   verbose output\n\nUse \"egpu-switcher [command] --help\" for more information about a command.\n\n\n```\n\n\n## Configuration\n\nThe config file is created automatically and can be found at `/etc/egpu-switcher/config.yaml`.\nBelow you can see an example of a configuration file, annotated with additional information.\n\n```yaml\negpu:\n    # the 'driver' and 'id' configs are generated by 'egpu-switcher config'.\n    # you probably shouldn't change this manually unless you understand why.\n    driver: amdgpu\n    id: 1153611719250962689\n    \n    # OPTIONAL: do not load 'modesetting' in the egpu config\n    nomodesetting: false\n\n# OPTIONAL: how many times 'egpu-switcher switch auto' should retry finding the egpu.\n# this can be helpful if the egpu takes some time to connect on your machine,\n# the following values are the default.\ndetection:\n  retries: 6\n  interval: 500 # milliseconds\n\n# OPTIONAL: if you want to execute a script after switching to egpu/internal.\n# the values must be absolute paths to a shell script, this script will\n# then be run with '/bin/sh $script'.\n# \n# it is required that the script is owned by root (uid 0) \n# and has a permission of -rwx------ (0700).\nhooks:\n  internal: /home/michael/tmp/internal.sh\n  egpu: /home/michael/tmp/egpu.sh\n```\n\n### Custom X11 config\n\nSince version `0.20.0`, a custom x11 config template can be configured by creating a file at `/usr/share/egpu-switcher/x11-template.conf`. The default template is shown below, you can use it as a starting point.\n\n```\n# autogenerated by egpu-switcher\n{{if .Modesetting}}\nSection \"Module\"\n    Load           \"modesetting\"\nEndSection\n{{end}}\n\nSection \"Device\"\n    Identifier     \"{{.Id}}\"\n    Driver         \"{{.Driver}}\"\n    BusID          \"{{.Bus}}\"\n    Option         \"AllowEmptyInitialConfiguration\"\n    Option         \"AllowExternalGpus\" \"True\"\nEndSection\n```\n\n\u003e [!TIP]\n\u003e For safety, and to stop egpu-switcher from printing warnings, the file should be owned by `root:root` and have a mode of `644`.\n\n---\n\n## Troubleshooting\n\nIf you run into problems, please have a look at\n[TROUBLESHOOT.md](https://github.com/hertg/egpu-switcher/blob/master/TROUBLESHOOT.md)\nbefore reporting any issues.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhertg%2Fegpu-switcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhertg%2Fegpu-switcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhertg%2Fegpu-switcher/lists"}