Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (483)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (550)
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 1070 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 opiop65

JGO Kernel


Medals: 154
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #1 - Posted 2014-02-22 14:50:09 »

Quote
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
Online 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.

Myomyomyo.
Offline Gibbo3771
« Reply #4 - Posted 2014-02-22 16:04:28 »

Quote
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 »

Hi

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).

Online 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.

Myomyomyo.
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  
 
 

 

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

The first screenshot will be displayed as a thumbnail.

CopyableCougar4 (17 views)
2014-08-22 19:31:30

atombrot (28 views)
2014-08-19 09:29:53

Tekkerue (25 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (15 views)
2014-08-16 06:20:21

Tekkerue (22 views)
2014-08-16 06:12:11

Rayexar (61 views)
2014-08-11 02:49:23

BurntPizza (39 views)
2014-08-09 21:09:32

BurntPizza (31 views)
2014-08-08 02:01:56

Norakomi (38 views)
2014-08-06 19:49:38
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!