Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question How do I make sure users on a laptop always use the faster GPU if there is one?

Discussion in 'Windows' started by soleron, Jan 29, 2021.

  1. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    546
    More and more people depend on laptops for their computing experience.
    However as it is many applications starting on a laptop use the intel integrated graphics by default.

    How can I make it that every time the app starts it uses the beefier graphics chip?
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,628
    soleron likes this.
  3. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    546
    Is this something I can copy paste on a script?
    I have no idea where and how I should use it.
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,628
    You need to put that piece of code in one of the source files (I'd do it in Main.cpp, just above wWinMain) in the generated VS project:

    Code (csharp):
    1. extern "C"
    2. {
    3.     __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
    4.     __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
    5. }
     
    soleron likes this.