<div dir="ltr">Hi Chiang,<div>I also found this video, but my BIOS does look different. Apparently my laptop has a hybrid graphics with a dynamic switching model (<a href="https://wiki.archlinux.org/index.php/Hybrid_graphics">https://wiki.archlinux.org/index.php/Hybrid_graphics</a>), meaning it is impossible to disable the IGP, since the IGP's framebuffer provides the only interface to the screen. The discrete GPU, when in use, will write its output to the IGP's framebuffer.</div><div>In the coming days I'll try writing a "pure" OpenGL win32 application (i.e. a program that uses the window manager of the OS, unlike a console application), and try out the solutions nvidia gives in the OptimusRenderingPolicies. </div><div><br></div><div>I suspect the real problem is that I'm starting all the rendering stuff from a console application (i.e. not a win32 application, that explicitly uses the window manager of the OS). *Maybe* the optimus driver always assigns the IGP to console applications, since in windows you would usually create a win32 application if you wanted to do rendering. To test this I'll do the following:</div><div>- create a win32 application with simple OpenGL code (e.g. draw a sphere) => play with nvidia settings until it uses the discrete GPU. This should work, I hope</div><div>- create a console application, that links to a dll with OpenGL code, that draws a sphere => this is basically analogous to what VTK is doing in my application right now. I get the feeling, this will always default to the IGP</div><div>- create a win32 application, that links to the same OpenGL dll => if I get this to work with the discrete GPU, this is the solution!</div><div><br></div><div>I'm no OpenGL expert though; maybe what I'm planning here is not possible. Guess I'll find out =D</div><div><br></div><div>Cheers,</div><div>Paulo</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 2 January 2016 at 03:54, WangQ <span dir="ltr"><<a href="mailto:wangq1979@outlook.com" target="_blank">wangq1979@outlook.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div><div dir="ltr">Hi Paulo,<div><br></div><div>Not sure about alienware, but my m4700 is able to disable IGP through bios setting. I always switch it off since I need CUDA, and my opengl code works well when the IGP is switched off. But i did not try the suggestion in WP. </div><div><br></div><div>I just googled it and found this <a href="https://www.youtube.com/watch?v=HuqyR-496Sw" target="_blank">https://www.youtube.com/watch?v=HuqyR-496Sw</a> </div><div><br></div><div>Check it to see if you are luck.</div><div><br></div><div>Cheers,</div><div><br></div><div>Chiang<br><br><div><hr>Date: Sat, 2 Jan 2016 00:02:01 +0100<br>Subject: Re: [vtkusers] VTK with NVidia Optimus<br>From: <a href="mailto:paulo.waelkens@gmail.com" target="_blank">paulo.waelkens@gmail.com</a><br>To: <a href="mailto:wangq1979@outlook.com" target="_blank">wangq1979@outlook.com</a><br>CC: <a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a><div><div class="h5"><br><br><div dir="ltr">Dear Chiang,<div>thank you for your suggestion. It is not possible to disable the IGP in the BIOS of my laptop (Alienware17 r3), even after getting the newest BIOS from dell. I *guess* this means the laptop does not have a hardware multiplexer(?), whilst your M4700 has one(?). So this approach won't work, I think. </div><div>Did you perhaps try the programmatic solutions suggested by nvidia (e.g. NvOptimusEnablement export thing) when doing your OpenGL programming?<br></div><div>Thanks! Regards,</div><div>Paulo</div></div><div><br><div>On 1 January 2016 at 19:54, WangQ <span dir="ltr"><<a href="mailto:wangq1979@outlook.com" target="_blank">wangq1979@outlook.com</a>></span> wrote:<br><blockquote style="border-left:1px #ccc solid;padding-left:1ex">


<div><div dir="ltr"><span><br><span style="color:rgb(68,68,68);font-family:微软雅黑;line-height:22.72px;background-color:rgb(255,255,255)">Hi,</span><div style="line-height:22.72px;color:rgb(68,68,68);font-family:微软雅黑;background-color:rgb(255,255,255)"><br style="line-height:22.72px"></div><div style="line-height:22.72px;color:rgb(68,68,68);font-family:微软雅黑;background-color:rgb(255,255,255)">You may try disabling optimus in bios setting to see if works. At least this works with my DELL M4700 and direct opengl programming. Not 100% sure whether for VTK.</div><div style="line-height:22.72px;color:rgb(68,68,68);font-family:微软雅黑;background-color:rgb(255,255,255)"><br style="line-height:22.72px"></div><div style="line-height:22.72px;color:rgb(68,68,68);font-family:微软雅黑;background-color:rgb(255,255,255)">Cheers,</div><div style="line-height:22.72px;color:rgb(68,68,68);font-family:微软雅黑;background-color:rgb(255,255,255)"><br style="line-height:22.72px"></div><div style="line-height:22.72px;color:rgb(68,68,68);font-family:微软雅黑;background-color:rgb(255,255,255)">Chiang</div></span><div><span><hr>Date: Fri, 1 Jan 2016 18:42:17 +0100<br>From: <a href="mailto:paulo.waelkens@gmail.com" target="_blank">paulo.waelkens@gmail.com</a><br>To: <a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a><br>Subject: [vtkusers] VTK with NVidia Optimus<br><br></span><div><div><div dir="ltr">Dear all,<div><br></div><div>I'm trying to get my VTK 6.3 application to use the NVidia GPU on my laptop. The laptop (Dell Alienware) combines an intel HD530 with an Nvidia GTX970m using the NVidia Optimus technology. At the moment, my application always uses the integrated GPU, which is slow and horrible. Did any of you figure out how to make the NVidia Optimus driver choose the discrete GPU instead??? The laptop uses the discrete GPU for games, so it's not a hardware problem, I'd say. </div><div><br></div><div>NOTE: I have both the latest intel and nvidia GPU drivers, and installed the intel driver first (as suggested somewhere). I've built VTK 6.3 with shared libraries and using the OpenGL2 flag.</div><div><br></div><div>I've followed the solutions described by nvidia, without success:</div><div><a href="http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf" target="_blank">http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf</a></div><div>- set the discrete GPU as the "Preferred graphics processor" => no effect</div><div>- adding this line to my main.cpp</div><div>extern "C" {
 _declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
} //=>no effect<br></div><div><br></div><div>To check if the discrete GPU is being used, I use the GPU activity icon of the nvidia control panel (<a href="http://acer--uk.custhelp.com/app/answers/detail/a_id/9075/~/determining-which-graphics-card-is-used-with-nvidia-optimus" target="_blank">http://acer--uk.custhelp.com/app/answers/detail/a_id/9075/~/determining-which-graphics-card-is-used-with-nvidia-optimus</a>). The icon does work correctly, since it shows activity when games are running (e.g. Starcraft 2). </div><div><br></div><div>I figured maybe I need to add the <b>extern "C" { _declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; }</b> line in the VTK source code somewhere. This is a bit of a wild guess, but maybe, since I'm linking to VTK dynamically, all the OpenGL stuff is done withing the VTK dll boundaries, so NVidia Optimus needs a hint from VTK, not from my (console) application that uses VTK.<br></div><div><br></div><div>I'm really running out of tricks here, and was wondering if one of you knows how to proceed.</div><div>Thanks!</div></div>
<br></div></div><span>_______________________________________________
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a>

Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a>

Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a>

Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" target="_blank">http://markmail.org/search/?q=vtkusers</a>

Follow this link to subscribe/unsubscribe:
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a></span></div>                                    </div></div>
</blockquote></div><br></div></div></div></div></div>                                     </div></div>
</blockquote></div><br></div>