Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (803)
Games in Android Showcase (237)
games submitted by our members
Games in WIP (867)
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  
  Render on specific GPU in OpenGL  (Read 6061 times)
0 Members and 1 Guest are viewing this topic.
Offline Thomas.
« Posted 2014-02-22 14:44:43 »

I have notebook with 2 GPUs. First one is integrated Intel HD 4000 and second one is nVidia 650M. I want to select which one will be used for rendering in my application. Is it possible?
Offline Opiop
« Reply #1 - Posted 2014-02-22 14:50:09 »

notebook with 2 GPUs
First time I've ever heard of that  Clueless
Offline Thomas.
« Reply #2 - Posted 2014-02-22 15:03:25 »

The most of powerful notebooks have one GPU in Intel i7 processor and second dedicated GPU for example nVidia 650M...
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline theagentd
« Reply #3 - Posted 2014-02-22 15:29:12 »

The most of powerful notebooks have one GPU in Intel i7 processor and second dedicated GPU for example nVidia 650M...
Most powerful... A GTX 650M is hardly the top of the line of laptops. The most powerful laptops are running two GPUs in SLI or Crossfire, for example two GTX 680Ms. What you're talking about is called Nvidia Optimus.

I believe you can add games/executables to a list in the Nvidia Control Panel so that they always use the Nvidia GPU. You can also create a .exe file from your resulting .jar file, right-click on it and choose to run it with the Nvidia GPU.

Offline Gibbo3771

JGO Kernel

Medals: 128
Projects: 5
Exp: 1 year

Currently inactive on forums :(

« Reply #4 - Posted 2014-02-22 16:04:28 »

notebook with 2 GPUs
First time I've ever heard of that  Clueless

He means nVidia optimus, basically hybrid graphics configuration.

Your integrated card (HD4000) takes care of any basic graphics rendering, while your dedicated card deals with more intense things such as games.

I currently run a optimus powered laptop with an i5 and GT780M, rarely ever use the dedicate card. I actually use the integrated HD (I think it's 4600, not sure) for games such as Minecraft and Starbound, plenty of power.

"This code works flawlessly first time and exactly how I wanted it"
Said no programmer ever
Offline gouessej
« Reply #5 - Posted 2014-02-22 19:50:20 »


You can use NV GPU affinity API to choose the GPU you would like to use. Unfortunately, it isn't exposed yet in JOGL 2 (JogAmp).

Julien Gouesse | Personal blog | Website | Jogamp
Offline theagentd
« Reply #6 - Posted 2014-02-23 05:19:05 »

You can use NV GPU affinity API to choose the GPU you would like to use.
From what I know that's impossible. That extension only allows you to handle multiple Nvidia GPUs in the same machine. The choice between the Intel GPU and the Nvidia GPU is done before the application even starts. By the time the OpenGL context has been created it'll be too late. Even worse, the Intel card uses a completely different driver which does not support the Nvidia specific NV_gpu_affinity extension, so it'd be impossible to even confirm that there is an Nvidia GPU from within the program itself without resorting to scanning the file system or some other hack. The selection of the Nvidia GPU has to be done during context creation, which no Java binding supports as far as I know.

Offline jmguillemette
« Reply #7 - Posted 2014-03-07 15:50:48 »

To the original poster...

I'm guessing your on a Macbook Pro. Cause this two video card approach is exactly how they are setup.

So to answer your question and give you a hint to what your going to encounter next ..

1) you dont have to do anything .. as soon as you init your display using OpenGL it will switch to the dedicated card. There is a GLX util you can download that monitors the cards and will show you it autoswitches.

2) now the next challenge.. which version of opengl do you want to use? By default the dedicated card will be a opengl 2.2 profile. If you want the opengl 4.1 profile you will have to specifically init the opengl profile asking for ... 3.2 CORE ... (yes 3.2 CORE = 4.1 implementation.. if you ask for 4.1 you will get an error.. welcome to the nuances that is Mac gaming Smiley

-=Like a post.. give the author a medal!=-
Pages: [1]
  ignore  |  Print  

Riven (397 views)
2019-09-04 15:33:17

hadezbladez (5280 views)
2018-11-16 13:46:03

hadezbladez (2204 views)
2018-11-16 13:41:33

hadezbladez (5544 views)
2018-11-16 13:35:35

hadezbladez (1150 views)
2018-11-16 13:32:03

EgonOlsen (4584 views)
2018-06-10 19:43:48

EgonOlsen (5462 views)
2018-06-10 19:43:44

EgonOlsen (3119 views)
2018-06-10 19:43:20

DesertCoockie (4015 views)
2018-05-13 18:23:11

nelsongames (4708 views)
2018-04-24 18:15:36
A NON-ideal modular configuration for Eclipse with JavaFX
by philfrei
2019-12-19 19:35:12

Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08 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‑
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!