openSUSE / SUSEPrime

Provide nvidia-prime like package for openSUSE
64 stars 11 forks source link

Added option AllowExternalGpus to allow eGPUs by default #20

Closed theotherJohnC closed 4 years ago

theotherJohnC commented 5 years ago

When using an eGPU, Xorg will fail with:

[    25.206] (WW) NVIDIA(GPU-0): This device is an external GPU, but external GPUs have not
[    25.206] (WW) NVIDIA(GPU-0):     been enabled with AllowExternalGpus. Disabling this device
[    25.206] (WW) NVIDIA(GPU-0):     to prevent crashes from accidental removal.
[    26.781] (EE) NVIDIA(0): Failing initialization of X screen 0
[    26.781] (II) UnloadModule: "nvidia"

Adding Option "AllowExternalGpus" will enable eGPUs to work by default after prime-select nvidia if an eGPU is indeed plugged in.

sndirsch commented 5 years ago

I'm not sure we want to add this option by default. See also NVIDIA's README ...

Option "AllowExternalGpus" "boolean"

This option allows the NVIDIA X driver to configure X screens on external
GPUs, also known as eGPUs. Note that this option is applied globally:
setting this option to true will enable the use of all eGPUs.

"AllowExternalGpus" defaults to false, to avoid putting the X server in a
situation where a GPU it is actively using can be hot-unplugged. External
GPUs are often used in short-running compute scenarios, which better
tolerate the eGPU being hot-unplugged. In such cases, a different GPU may
be used to display the X11 desktop.

In addition to eGPUs, "AllowExternalGpus" set to false may prevent the
NVIDIA X driver from configuring X screens on GPUs attached to internal
PCIe slots with surprise removal/hot-unplug support, such as in some
enterprise systems.

Default: false. The NVIDIA X driver will not configure X screens on eGPUs.
hellcp commented 5 years ago

I wonder if this kind of check couldn't be done automatically, external Nvidia GPUs should work regardless of what happens with eDP display, so setting AllowExternalGpus during boot, only if external GPU is connected could work just fine (but then obviously hotplugging in session that didn't have eGPU connected from the startup wouldn't work)

sndirsch commented 4 years ago

No risk. No fun. Let's take it. ;-)