ΠΠ΅ΡΠ»ΠΎΠΆΠ½ΡΠΉ ΡΠΊΡΠΈΠΏΡ Π΄Π»Ρ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Π΅ΠΉ Π½ΠΎΡΡΠ±ΡΡΠ½ΡΡ Π°Π΄Π°ΠΏΡΠ΅ΡΠΎΠ² Π΄Π»Ρ Π²Π½Π΅ΡΠ½ΠΈΡ Π²ΠΈΠ΄Π΅ΠΎΠΊΠ°ΡΡ. ΠΡΠΈΠ·Π²Π°Π½ ΡΠΏΡΠΎΡΡΠΈΡΡ Π²ΡΠ±ΠΎΡ Π²ΠΈΠ΄Π΅ΠΎΠΊΠ°ΡΡΡ ΠΏΠΎ ΡΠΌΠΎΠ»ΡΠ°Π½ΠΈΡ Π±Π΅Π· ΠΊΠΎΠ²ΡΡΡΠ½ΠΈΡ ΠΊΠΎΠ½ΡΠΈΠ³ΠΎΠ² ΡΡΠΊΠ°ΠΌΠΈ.
- ΠΠΏΠΈΡΠ°Π½ΠΈΠ΅
- Π‘ΠΊΡΠΈΠ½ΡΠΎΡ
- Π’ΡΠ΅Π±ΠΎΠ²Π°Π½ΠΈΡ
- Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ°
- ΠΠΎΠΌΠ°Π½Π΄Ρ
- ΠΡΠΎΠ±Π»Π΅ΠΌΡ
- Background Information
Π¦Π΅Π»Ρ ΡΡΠΎΠ³ΠΎ ΡΠΊΡΠΈΠΏΡΠ° - ΡΠΏΡΠΎΡΡΠΈΡΡ Π½Π°ΡΡΡΠΎΠΉΠΊΡ Π°Π΄Π°ΠΏΡΠ΅ΡΠ° eGPU Π² Π²Π°ΡΠ΅ΠΌ Π΄ΠΈΡΡΡΠΈΠ±ΡΡΠΈΠ²Π΅ Linux. Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° ΠΏΡΠΎΡ ΠΎΠ΄ΠΈΡ Π² ΠΈΠ½ΡΠ΅ΡΠ°ΠΊΡΠΈΠ²Π½ΠΎΠΌ ΡΠ΅ΠΆΠΈΠΌΠ΅ Ρ ΠΏΠΎΠ½ΡΡΠ½ΡΠΌΠΈ ΠΏΠΎΡΡΠ½Π΅Π½ΠΈΡΠΌΠΈ.
ΠΠΎΡΡΠΈΠΆΠ΅Π½ΠΈΠ΅ ΡΡΠ½ΠΊΡΠΈΠΎΠ½Π°Π»Π° ΠΊΠ°ΠΊ Π² Windows ΠΏΠΎΠΊΠ° Π½Π΅ ΠΏΡΠ΅Π΄ΡΡΠ°Π²Π»ΡΠ΅ΡΡΡ Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΡΠΌ.
Π‘ΠΊΠΎΡΠ΅Π΅ Π²ΡΠ΅Π³ΠΎ ΠΏΠΎΡΠ»Π΅ ΠΏΡΠΈΠΌΠ΅Π½Π΅Π½ΠΈΡ ΡΠΊΡΠΈΠΏΡΠ° Π½Π΅ΠΎΠ±Ρ
ΠΎΠ΄ΠΈΠΌΠΎ ΠΏΠ΅ΡΠ΅Π·Π°Π³ΡΡΠ·ΠΈΡΡ ΠΊΠΎΠΌΠΏΡΡΡΠ΅Ρ Π΄Π»Ρ ΠΏΠΎΠ»Π½ΠΎΠ³ΠΎ ΡΡΠ½ΠΊΡΠΈΠΎΠ½Π°Π»Π° eGPU..
- Π‘ΠΈΡΡΠ΅ΠΌΠ° ΡΠ°Π±ΠΎΡΠ°Π΅Ρ Π½Π° X-Server.
- Π£ΡΡΠ°Π½ΠΎΠ²Π»Π΅Π½Π° pciutils 3.3.x ΠΈΠ»ΠΈ Π²ΡΡΠ΅ installed (ΠΏΡΠΎΠ²Π΅ΡΠΈΡΡ ΠΊΠΎΠΌΠ°Π½Π΄ΠΎΠΉ
lspci --version
). - ΠΠΈΠ½ΠΈΠΌΡΠΌ Bash 4.x ΠΈΠ»ΠΈ Π²ΡΡΠ΅.
- ΠΠ°ΡΡΡΠΎΠ΅Π½Π½ΡΠΉ ΡΠΈΠ·ΠΈΡΠ΅ΡΠΊΠΈ ΠΈ ΠΏΠΎΠ΄ΠΊΠ»ΡΡΠ΅Π½ΡΠΉ ΡΠΈΠ·ΠΈΡΠ΅ΡΠΊΠΈ ΠΊ Π½ΠΎΡΡΠ±ΡΠΊΡ Π°Π΄Π°ΠΏΡΠ΅Ρ eGPU.
- ΠΠΎΠ»Π½ΠΎΡΡΡΡ ΡΡΡΠ°Π½ΠΎΠ²Π»Π΅Π½Π½ΡΠΉ Π΄ΡΠ°ΠΉΠ²Π΅Ρ Π½Π° ΠΏΠΎΠ΄ΠΊΠ»ΡΡΠ΅Π½Π½ΡΡ ΡΠ΅ΡΠ΅Π· eGPU Π²ΠΈΠ΄Π΅ΠΎΠΊΠ°ΡΡΡ.
Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° ΠΈ Π½Π°ΡΡΡΠΎΠΉΠΊΠ°:
$ sudo add-apt-repository ppa:hertg/egpu-switcher
$ sudo apt update
$ sudo apt install egpu-switcher
$ sudo egpu-switcher setup
Π£Π΄Π°Π»Π΅Π½ΠΈΠ΅:
$ apt remove egpu-switcher
Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° ΠΈ Π½Π°ΡΡΡΠΎΠΉΠΊΠ°:
$ git clone [email protected]:hertg/egpu-switcher.git
$ cd egpu-switcher
$ make install
$ sudo egpu-switcher setup
Π£Π΄Π°Π»Π΅Π½ΠΈΠ΅:
ΠΠ½ΠΈΠΌΠ°Π½ΠΈΠ΅!: ΠΠ΅ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠΉΡΠ΅ Π΄Π°Π½Π½ΡΠΉ ΠΌΠ΅ΡΠΎΠ΄ Π½Π° Π²Π΅ΡΡΠΈΡΡ Π½ΠΈΠΆΠ΅
0.10.2
!
ΠΡΠ»Π° ΠΊΡΠΈΡΠΈΡΠ΅ΡΠΊΠ°Ρ ΠΎΡΠΈΠ±ΠΊΠ° Π² Makefile, ΠΊΠΎΡΠΎΡΠ°Ρ ΡΠ΄Π°Π»ΡΠ΅Ρ ΠΏΠ°ΠΏΠΊΡ/usr/bin
. ΠΡΡΡΠ΅ Π²ΡΡΡΠ½ΡΡ ΡΠ΄Π°Π»ΠΈΡΡ ΠΏΠ°ΠΏΠΊΡegpu-switcher
Π² ΠΊΠ°ΡΠ°Π»ΠΎΠ³Π°Ρ/usr/bin/
ΠΈ/usr/share/
.
$ sudo egpu-switcher cleanup
$ make uninstall
egpu-switcher setup [--override] [--noprompt] This will generate the "xorg.conf.egpu" and "xorg.conf.internal" files and symlink the "xorg.conf" file to one of them. It will also create the systemd service, that runs the "switch" command on each bootup. This will NOT delete any already existing files. If an "xorg.conf" file already exists, it will be backed up to "xorg.conf.backup.{datetime}". This can later be reverted by executing the "cleanup" command. --override If an AMD GPU or open-source NVIDIA drivers are used, the "switch" command will prevent from switching to the eGPU if there are no displays directly attached to it. This flag will make sure to switch to the EGPU even if there are no displays attached. --noprompt Prevent the setup from prompting for user interaction if there is no existing configuration file found. (Is currently only used by the "postinst" script)
egpu-switcher switch auto|egpu|internal [--override] Switches to the specified GPU. if the auto parameter is used, the script will check if the eGPU is attached and switch accordingly. The computer (or display-manager) needs to be restarted for this to take effect. --override If an AMD GPU or open-source NVIDIA drivers are used, the "switch" command will prevent from switching to the eGPU if there are no displays directly attached to it. This flag will make sure to switch to the EGPU even if there are no displays attached.
egpu-switcher cleanup [--hard] Remove all files egpu-switcher has created previously and restore the backup of previous "xorg.conf" files. --hard Remove configuration files too.
egpu-switcher config Prompts the user to specify their external/internal GPU and saves their answer to the configuration file.
egpu-switcher remove Allows the user to remove their eGPU without a complete reboot. This method will still restart the display-manager, and therefore terminate all its child-processes.
If you run into problems, please have a look at TROUBLESHOOT.md before reporting any issues.
A backup of your current
xorg.conf
will be created, nothing gets deleted. If the script doesn't work for you, you can revert the changes by executingegpu-switcher cleanup
or just completely uninstall the script withapt remove egpu-switcher
. This will remove all files it has created and also restore your previousxorg.conf
file.
This script will create two configuration files in your X-Server folder /etc/X11
.
The file xorg.conf.egpu
holds the settings for your EGPU and the file xorg.conf.internal
holds the settings for your internal graphics.
Then a symlink xorg.conf
will be generated which points to the corresponding config file, depending on wheter your egpu is connected or not.
Additionally a custom systemd
service with the following content will be created.
/etc/systemd/system/egpu.service
[Unit]
Description=EGPU Service
Before=display-manager.service
After=bolt.service
[Service]
Type=oneshot
ExecStart=/usr/bin/egpu-switcher switch auto
[Install]
WantedBy=graphical.target
This will enable the automatic detection wheter your egpu is connected or not on startup.