linux-surface / surface-hotplug

Hotplug and D3cold support for the discrete GPU on Microsoft Surface Book 2 and 3 devices.
GNU General Public License v2.0
5 stars 0 forks source link

D3Cold in hybrid graphics mode (Wayland) #6

Closed avra-m3 closed 1 year ago

avra-m3 commented 2 years ago

You can completely shut off the gpu when not in use by preventing Wayland from knowing nvidia exists (you need to remove/rename /usr/share/glvnd/egl_vendor.d/10_nvidia.json) and unloading the nvidia drivers, we should incorporate this into the Runtime power mangement docs.

sudo mv /usr/share/glvnd/egl_vendor.d/10_nvidia.json /usr/share/glvnd/egl_vendor.d/10_nvidia.json.backup

Unsure if X-Server has something similarly usable.

This is also something we may be able to incorporate into the detach process eventually.

avra-m3 commented 2 years ago

Edited page feel free to spruce it up

qzed commented 2 years ago

Thanks!

spfanning commented 1 year ago

I don't think moving the file is ideal, I have the following environment variables set to achieve the same thing (some may not be necessary):

__EGL_VENDOR_LIBRARY_FILENAMES="/usr/share/glvnd/egl_vendor.d/50_mesa.json"
VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/intel_icd.x86_64.json:/usr/share/vulkan/icd.d/intel_icd.i686.json
DXVK_FILTER_DEVICE_NAME="Intel"
VKD3D_FILTER_DEVICE_NAME="Intel"
__GLX_VENDOR_LIBRARY_NAME="mesa"
VDPAU_DRIVER=va_gl

To run a program on the nvidia gpu you just set the variables to the nvidia version. The prime-run wrapper does this.

qzed commented 1 year ago

Oh neat. I agree that this is probably a better idea than changing system files. Would you mind adding that to the wiki?

spfanning commented 1 year ago

Done.

qzed commented 1 year ago

Thanks!