Programically setting NvOptimusEnablement for Python-based OpenGL Programs

Is there a way to programmically set the NvOptimusEnablement flag for a Python-based application using OpenGL (and in particular, those using Qt) from within the Python script?

All the references I've seen so far - e.g. Programmatically selecting integrated graphics in nVidia Optimus, or https://stackoverflow.com/a/39047129/6531515 - are for C/C++, where the flag needs to be set as a global define which is compiled into the executable, but obviously that won't work in this case.

Are the only options to:

  1. Create a custom Python interpreter wrapper with this flag set (e.g. https://github.com/cprogrammer1994/optimuspy), OR
  2. Force users to explicitly tag Python / pyinstaller-created-binary as requiring the Nvidia GPU per machine they use?


from Recent Questions - Stack Overflow https://ift.tt/3i5PfIm
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

Spring Elasticsearch Operations

Network Error and Timeout on Authorize.net JS

Object oriented programming concepts (OOPs)