From 96c62f2db25631ee85244e2cbb47d948cb77b6b2 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 5 Nov 2025 00:57:58 +0100 Subject: [PATCH] Set CUDA_DISABLE_PERF_BOOST to workaround p2 power level issue. Required nvidia driver >= 580.105.08 --- src/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index b8dede5..51411ce 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3102,6 +3102,10 @@ int main(int argc, char **argv) { set_display_server_environment_variables(); + // Linux nvidia driver 580.105.08 added the environment variable CUDA_DISABLE_PERF_BOOST to disable the p2 power level issue, + // where running cuda (which includes nvenc) causes the gpu to be forcefully set to p2 power level which on many nvidia gpus + // decreases gpu performance in games. On my GTX 1080 it decreased game performance by 10% for absolutely no reason. + setenv("CUDA_DISABLE_PERF_BOOST", "1", true); // Stop nvidia driver from buffering frames setenv("__GL_MaxFramesAllowed", "1", true); // If this is set to 1 then cuGraphicsGLRegisterImage will fail for egl context with error: invalid OpenGL or DirectX context,