rocksdanister/lively

Automatically use high performance graphics card on gaming laptops.

Aperta

#24 aperta il 28 feb 2020

 (6 commenti) (0 reazioni) (0 assegnatari)C# (1285 fork)batch import
enhancementhelp wanted

Metriche repository

Star
 (18.816 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

I have a gaming laptop that has two GPUs, a low power integrated Intel GPU, and a high power NVIDIA GPU. By default any given program is run with the lower powered GPU to save power, since it's a laptop. This means that some desktops are slow. I can override the default setting in the NVIDIA control panel, but it is possible to indicate that your program should use the high powered GPU.

I found this page and this pdf which describe how to do so.

Basically, you export a global variable named NvOptimusEnablement as 1. The example code given is

extern "C" {
     __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
}

Unfortunately, as far as I can tell, you can't do this kind of export by default in C#. The only thing I found is a library: DllExport, but I'm not sure it works with variable exports.

I totally understand if you don't want to add a library to your project just for this one thing. Alternatively, you could add a section to the README, something like: "If lively is slow on your laptop, check to see if it's running on the right graphics processor.

Guida contributor