Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (475)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (530)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Blogpost about NVIDIA Optimus and a .exe launcher  (Read 891 times)
0 Members and 1 Guest are viewing this topic.
Offline tduindam

Senior Newbie





« Posted 2014-02-25 14:03:13 »

Hi,

Recently I have spent quite some time trying to get the NVIDIA Optimus driver to select the high-performance card by default for my Java game.

I turns out that (as far as I know) the only way to do that is to launch your java game from C++.

Since it took me some time to figure it out, I wrote a bit about how I did it.

Hopefully it will save someone some time!

BTW, this thread helped quite a bit.

Cheers!
Offline Cero
« Reply #1 - Posted 2014-02-25 18:22:09 »

you could have just used batch to exe
make a batch file, convert it to an exe and rename your java.exe to whatever you want

Offline tduindam

Senior Newbie





« Reply #2 - Posted 2014-02-25 20:15:21 »

But that way I couldn't have set the global variable NvOptimusEnablement that I needed to get the Optimus driver to select the high performance GPU for my game, instead of the integrated GPU.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Cero
« Reply #3 - Posted 2014-02-27 16:51:02 »

Not an expert but I think you can do this with batch as well.
Might be easier for most people than dusting off their C++ ide.
Of course it sucks that you have to set that variable to begin with

Offline tduindam

Senior Newbie





« Reply #4 - Posted 2014-02-28 10:18:00 »

For this trick to work you need to export the variable in such a manner that the driver can find it by looking at the compiled .exe. It probably uses something like __declspec(dllimport) to find it.

It looked at the documentation of batch to exe, but I couldn't find a way to do this. Did I miss something?
Offline Cero
« Reply #5 - Posted 2014-02-28 15:29:56 »

For this trick to work you need to export the variable in such a manner that the driver can find it by looking at the compiled .exe. It probably uses something like __declspec(dllimport) to find it.

It looked at the documentation of batch to exe, but I couldn't find a way to do this. Did I miss something?

Probably not no, this is awfully specific =/

Offline tduindam

Senior Newbie





« Reply #6 - Posted 2014-03-02 17:08:16 »

Yeah, that's mostly why I posted. Maybe it will save the next guy some trouble...
Pages: [1]
  ignore  |  Print  
 
 

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

ctomni231 (34 views)
2014-07-18 06:55:21

Zero Volt (30 views)
2014-07-17 23:47:54

danieldean (25 views)
2014-07-17 23:41:23

MustardPeter (27 views)
2014-07-16 23:30:00

Cero (42 views)
2014-07-16 00:42:17

Riven (44 views)
2014-07-14 18:02:53

OpenGLShaders (32 views)
2014-07-14 16:23:47

Riven (34 views)
2014-07-14 11:51:35

quew8 (30 views)
2014-07-13 13:57:52

SHC (66 views)
2014-07-12 17:50:04
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!