rocksdanister/lively

Automatically use high performance graphics card on gaming laptops.

Open

#24 opened on Feb 28, 2020

View on GitHub
 (6 comments) (0 reactions) (0 assignees)C# (1,285 forks)batch import
enhancementhelp wanted

Repository metrics

Stars
 (18,816 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

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.

Contributor guide