Jan200101 / switcheroo-control

Fork of https://gitlab.freedesktop.org/hadess/switcheroo-control
GNU General Public License v3.0
0 stars 0 forks source link

Expose if GPU is discrete or not #1

Open Jan200101 opened 1 year ago

Jan200101 commented 1 year ago

Original issue https://gitlab.freedesktop.org/hadess/switcheroo-control/-/issues/39


To allow consumers to make a more educated decision about what GPU to choose Switcheroo-control could expose if a GPU is discrete or not. There are multiple ways to achieve this, the best would be checking if the GPU has dedicated vram (this is how Vulkan does it), but it appears that there is no sysfs interface for getting the memory. Applications like nvtop have different code paths for different GPUs, with the Nvidia code path dynamically loading the NVML library. Alternatively the PCI interface could be parsed since, statistically speaking, the iGPU tends to be on Bus 0. Other heuristics like always considering Nvidia GPUs to be discrete, since Nvidia does not produce any integrated GPUs, could also be added.

Jan200101 commented 1 year ago

This has since been partially implemented for AMD and the Nvidia GPUs on the PR/discrete-key branch.

Support for Intel discrete GPUs is possible, but the drivers for it are still in development, so its best to wait until things settle down.

Nvidia GPUs using the open source driver get probed and the proprietary driver gets always marked as discrete.