rocksdanister/lively

Automatically use high performance graphics card on gaming laptops.

开放

#24 创建于 2020年2月28日

 (6 条评论) (0 个反应) (0 位负责人)C# (1,285 个派生)batch import
enhancementhelp wanted

仓库指标

星标
 (18,816 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

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.

贡献者指南