Re: [osg-users] Laptop switchable graphics and OSG / OpenGL apps?

2011-09-12 Thread Jean-Sébastien Guay

Hi guys,

Just a progress report, some encouraging news.

I've been discussing with nvidia dev support on these issues since 
Friday. They have really been responsive and quick, and they are 
thorough in their investigations too (I guess I was lucky because the 
guy replying had the same model laptop on his desk for an unrelated 
issue, so he could test exactly the same drivers on the same hardware).



The white paper on nvidia's site
http://www.nvidia.com/object/optimus_technology.html says these three
automatically power on the GPU:

DX Calls: Any 3D game engine or DirectX application will trigger these
calls
DXVA Calls: Video playback will trigger these calls (DXVA = DirectX
Video Acceleration)
CUDA Calls: CUDA applications will trigger these calls



Hmm, interesting. Why didn't they include OpenGL calls in the list?
Seems like a glaring oversight.


They are looking into it, but the nvidia developer I'm talking to things 
this part of the whitepaper is not totally accurate, and in fact the 
switching is 100% profile-based.


However, if after his investigation he finds out that indeed, Optimus 
switches when it sees DirectX calls, then he says OpenGL calls should 
indeed lead to the same behavior, and they will modify it to do so in a 
later version. But it really hinges on whether that's the intended 
behavior or not.



The lack of working profiles and API seems pretty problematic. One
could always run some CUDA code at startup, but it doesn't say how
shutdown is determined, and this really reeks of a kludge.


About profiles, I guess the fact they don't persist must be a bug that
might have been fixed in a later driver version. It would be nice to at
least be able to programmatically add profiles, so users don't have to
manually create them.


I've retested doing a clean install of the 280.26 driver from nvidia's 
site, and profiles work for us now. So that's at least encouraging.


The other part of the discussion is that I suggested they add some way 
for an app to send a hint to the driver that this app requires the 
dedicated graphics. I would really prefer some way that didn't require 
linking to an nvidia-provided library (something as simple as the app 
using putenv() to push a specific env var into its active environment 
might work IMHO). But any way really would be better than requiring 
users to create a profile for your app. I think it'll probably end up 
being in nvapi (http://developer.nvidia.com/nvapi). Since Optimus is 
currently Windows-only anyways I think that's the path they'll choose.


Anyways, the discussion is still ongoing, I'll update again when I get 
some more info.


J-S
--
__
Jean-Sébastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.dyndns-web.com/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Laptop switchable graphics and OSG / OpenGL apps?

2011-09-12 Thread Martins Innus

J-S,
Thanks for the update.

 Since Optimus is currently Windows-only anyways I think that's the 
path they'll choose.




Just as an extra point, Ironhide lets you use Optimus under Linux.  I 
haven't done any performance testing, but I was able to to manually 
activate the Nvidia card under linux and run OpenGL apps on it.


http://www.martin-juhl.dk/2011/08/ironhide-reporting-for-duty/

Martins
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Laptop switchable graphics and OSG / OpenGL apps?

2011-09-12 Thread Jean-Sébastien Guay

Hi Martins,


Since Optimus is currently Windows-only anyways I think that's the
path they'll choose.



Just as an extra point, Ironhide lets you use Optimus under Linux. I
haven't done any performance testing, but I was able to to manually
activate the Nvidia card under linux and run OpenGL apps on it.

http://www.martin-juhl.dk/2011/08/ironhide-reporting-for-duty/


Yes, I've seen lots about Optimus and its Linux supporters Prime, 
Bumblebee and Ironhide. Transformers FTW :-)


What I meant was that nvidia supports Optimus on Windows only. If they 
change that at any point I'd expect them to provide an equivalent to 
nvapi and Optimus switching on Linux too, but for now they seem to have 
no plans for that.


And from what I've seen, Bumblebee and Ironhide are not automatic 
anyways, you need to run your app in a wrapper like this:


  optirun yourApp

and it will switch to dedicated graphics for the runtime of your app. So 
it's kind of like profiles, not automatic. If nvidia adds an API in 
nvapi to allow an app to hint that it should run on dedicated graphics, 
then I guess it would be pretty easy for Ironhide to do it too.


J-S
--
__
Jean-Sébastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.dyndns-web.com/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Laptop switchable graphics and OSG / OpenGL apps?

2011-09-09 Thread Jean-Sébastien Guay

Hi all,

We have recently bought a few good laptops (Lenovo W520) to be able to 
work at customers' sites, and these come equipped with Intel graphics 
AND an nVidia Quadro 2000M discrete card. They are supposed to use 
(buzzword alert) nVidia's Optimus technology to automatically switch 
between the two based on the app that's currently running.


This seems to work well for games I've tried (all based on DirectX). The 
games clearly don't use the integrated graphics, they run well on high 
settings (the same I use on my desktop that has a GTX470).


However, our own OSG-based apps seem to not be recognized as needing 
the discrete graphics, and even adding a profile for our app's 
executable in nVidia Control Panel, telling it to force using the 
discrete graphics for that app, doesn't work. Our app crashes when 
loading textures, somewhere in the Intel driver.


I haven't tested other OpenGL apps. I will soon.

As I see it I have 2 options:

1. Switch to discrete graphics only in the BIOS. I've tried this and it 
works, but I'd either have to accept the higher battery usage when I'm 
not using a graphics app, or have to reboot and switch back manually 
depending on the situation. So it's inconvenient.


2. Write to nVidia to see if they have any hints about how to make 
Optimus see that our app needs the discrete graphics. Maybe there's a 
call we can make at the start of our main() that would be a hint to the 
OpenGL driver? Actually I would have thought that any time OpenGL is 
used at all (context created, etc.) it would switch to discrete, so this 
may be a bug in the driver if it's not the case.


Has anyone had any experience with this technology? I think it's a good 
idea, if it worked well it would really be the best of both worlds - low 
battery usage when no 3D apps are running, and speed when you need it. 
But as it stands it's a bit inconvenient.


Thanks in advance,

J-S
--
__
Jean-Sébastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.dyndns-web.com/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Laptop switchable graphics and OSG / OpenGL apps?

2011-09-09 Thread Chris 'Xenon' Hanson
On 9/9/2011 10:29 AM, Jean-Sébastien Guay wrote:
 We have recently bought a few good laptops (Lenovo W520) to be able to work 
 at customers'
 sites, and these come equipped with Intel graphics AND an nVidia Quadro 2000M 
 discrete
 card. They are supposed to use (buzzword alert) nVidia's Optimus technology to
 automatically switch between the two based on the app that's currently 
 running.

  I just received one of these (not my laptop, but my wife's). I can try to 
poke at it
here as well.

-- 
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com 
http://www.alphapixel.com/
  Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. 
Contracting.
There is no Truth. There is only Perception. To Perceive is to Exist. - 
Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Laptop switchable graphics and OSG / OpenGL apps?

2011-09-09 Thread Jean-Sébastien Guay

Replying to myself,


I haven't tested other OpenGL apps. I will soon.


I just tried Lightsmark 2008 [http://dee.cz/lightsmark/] and it wouldn't 
start, saying in its log file that Graphics card driver doesn't support 
OpenGL 2.0. So I guess that's the same result as our OSG app I tried 
before.


I got the same result (error saying my GPU doesn't support OpenGL 2.0) 
from FurMark [http://www.ozone3d.net/benchmarks/fur/].


I think I'll write to nVidia to see what they have to say.

J-S
--
__
Jean-Sébastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.dyndns-web.com/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Laptop switchable graphics and OSG / OpenGL apps?

2011-09-09 Thread Martins Innus

J-S,

On 9/9/11 12:29 PM, Jean-Sébastien Guay wrote:


However, our own OSG-based apps seem to not be recognized as needing 
the discrete graphics, and even adding a profile for our app's 
executable in nVidia Control Panel, telling it to force using the 
discrete graphics for that app, doesn't work. Our app crashes when 
loading textures, somewhere in the Intel driver.


Just this morning I started testing on one of these laptops (Dell 
XPS17).  By adding a profile for the specific .exe I wanted to run, I 
got the Nvidia graphics to kick in for our OSG application.  I have not 
yet found a way for that card to start automatically with OpenGL apps.


Martins
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Laptop switchable graphics and OSG / OpenGL apps?

2011-09-09 Thread Jean-Sébastien Guay

Hi Martins,


Just this morning I started testing on one of these laptops (Dell
XPS17). By adding a profile for the specific .exe I wanted to run, I got
the Nvidia graphics to kick in for our OSG application. I have not yet
found a way for that card to start automatically with OpenGL apps.


Which version of the drivers are you using?

I'm using 280.26 from nVidia's site, and even creating a profile and 
setting that profile to run on High-performance NVIDIA Processor 
didn't work for me. Even if I tried to force it to the discrete graphics 
globally (in the Global Settings instead of Program Settings where 
you create a profile) didn't work either. The only thing that worked for 
me was forcing it in the BIOS.


That's something that should work, and I guess it might be a bug in my 
version of the nVidia control panel. Still, if we could just have the 
app tell the driver that it needs discrete graphics, instead of having 
to make a profile for *each* app, on *each* laptop, that would be better.


I've written to nVidia to see if they have some more info about this.

Thanks,

J-S
--
__
Jean-Sébastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.dyndns-web.com/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Laptop switchable graphics and OSG / OpenGL apps?

2011-09-09 Thread Martins Innus

J-S,

Which version of the drivers are you using?



I'm using 268.30, the most recent as provided by Dell specifically for 
my laptop. I have not tried any of the drivers on Nvidia's site.


I'm using 280.26 from nVidia's site, and even creating a profile and 
setting that profile to run on High-performance NVIDIA Processor 
didn't work for me. Even if I tried to force it to the discrete 
graphics globally (in the Global Settings instead of Program 
Settings where you create a profile) didn't work either. The only 
thing that worked for me was forcing it in the BIOS.




My only option is to create a profile for each application as you 
described above, as Dell doesn't provide any option to force it from the 
Bios.  If I could, I would just disable it that way.


That's something that should work, and I guess it might be a bug in my 
version of the nVidia control panel. Still, if we could just have the 
app tell the driver that it needs discrete graphics, instead of having 
to make a profile for *each* app, on *each* laptop, that would be better.


I hope a better solution becomes available.  This could be a support 
nightmare when distributing applications.


Martins
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Laptop switchable graphics and OSG / OpenGL apps?

2011-09-09 Thread Jean-Sébastien Guay

Hi Martins,


I'm using 268.30, the most recent as provided by Dell specifically for
my laptop. I have not tried any of the drivers on Nvidia's site.


Well, I just reverted to the 268.71 version that is provided by Lenovo. 
On this version, selecting the discrete graphics in the Global Settings 
tab works, but profiles I add don't seem to be saved (I close and 
re-open the nVidia control panel and the profiles I added are gone).


So I guess I have a workaround to enable the nVidia graphics chip when I 
need it without rebooting and doing it in the BIOS, but I hope nVidia 
reply to my message and fix profiles, and possibly have a way for apps 
to tell it where to run. That would be the best.



I hope a better solution becomes available. This could be a support
nightmare when distributing applications.


Indeed.

J-S
--
__
Jean-Sébastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.dyndns-web.com/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Laptop switchable graphics and OSG / OpenGL apps?

2011-09-09 Thread Chris 'Xenon' Hanson
On 9/9/2011 1:01 PM, Martins Innus wrote:
 I'm using 268.30, the most recent as provided by Dell specifically for my 
 laptop.

  Reason number 1 why I have quit buying Dell.

-- 
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com 
http://www.alphapixel.com/
  Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. 
Contracting.
There is no Truth. There is only Perception. To Perceive is to Exist. - 
Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Laptop switchable graphics and OSG / OpenGL apps?

2011-09-09 Thread Ryan Pavlik
The white paper on nvidia's site
http://www.nvidia.com/object/optimus_technology.html says these three
automatically power on the GPU:

DX Calls: Any 3D game engine or DirectX application will trigger these
calls
DXVA Calls: Video playback will trigger these calls (DXVA = DirectX
Video Acceleration)
CUDA Calls: CUDA applications will trigger these calls


The lack of working profiles and API seems pretty problematic.  One could
always run some CUDA code at startup, but it doesn't say how shutdown is
determined, and this really reeks of a kludge.

Ryan

On Fri, Sep 9, 2011 at 2:26 PM, Jean-Sébastien Guay 
jean-sebastien.g...@cm-labs.com wrote:

 Hi Martins,


  I'm using 268.30, the most recent as provided by Dell specifically for
 my laptop. I have not tried any of the drivers on Nvidia's site.


 Well, I just reverted to the 268.71 version that is provided by Lenovo. On
 this version, selecting the discrete graphics in the Global Settings tab
 works, but profiles I add don't seem to be saved (I close and re-open the
 nVidia control panel and the profiles I added are gone).

 So I guess I have a workaround to enable the nVidia graphics chip when I
 need it without rebooting and doing it in the BIOS, but I hope nVidia reply
 to my message and fix profiles, and possibly have a way for apps to tell it
 where to run. That would be the best.


  I hope a better solution becomes available. This could be a support
 nightmare when distributing applications.


 Indeed.


 J-S
 --
 __**
 Jean-Sébastien Guay
 jean-sebastien.guay@cm-labs.**comjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/

 http://whitestar02.dyndns-web.**com/http://whitestar02.dyndns-web.com/
 __**_
 osg-users mailing list
 osg-users@lists.**openscenegraph.org osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.**org/listinfo.cgi/osg-users-**
 openscenegraph.orghttp://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




-- 
Ryan Pavlik
HCI Graduate Student
Virtual Reality Applications Center
Iowa State University

rpav...@iastate.edu
http://academic.cleardefinition.com
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Laptop switchable graphics and OSG / OpenGL apps?

2011-09-09 Thread Jean-Sébastien Guay

Hi Ryan,


The white paper on nvidia's site
http://www.nvidia.com/object/optimus_technology.html says these three
automatically power on the GPU:

DX Calls: Any 3D game engine or DirectX application will trigger these
calls
DXVA Calls: Video playback will trigger these calls (DXVA = DirectX
Video Acceleration)
CUDA Calls: CUDA applications will trigger these calls



Hmm, interesting. Why didn't they include OpenGL calls in the list? 
Seems like a glaring oversight.



The lack of working profiles and API seems pretty problematic.  One
could always run some CUDA code at startup, but it doesn't say how
shutdown is determined, and this really reeks of a kludge.


I guess the switch persists until the running application ends...

About profiles, I guess the fact they don't persist must be a bug that 
might have been fixed in a later driver version. It would be nice to at 
least be able to programmatically add profiles, so users don't have to 
manually create them.


J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.dyndns-web.com/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org