Linking problems with Nvidia`s OpenCL-Library in VS 2009


I want to include some OpenCL-functionalty into an existing project (running under Windows 7 in VS 2009). This project includes a bunch of external libraries that are all compiled with /MD (resp. /MDd), whereas Nvidia`s current OpenCL implementation seems to use /MT (and MTd). This results in lnk2005 errors.
Maybe someone already had a similar problem and knows a workaround (possibly without recompiling all my existing libraries)?

Best regards,

Hi renew,

I had some problems with early NVIDIA SDK as well, and at the time I solved it by dynamically loading the OpenCL.dll in other programming language outside MSVS. As a base I used official Khronos headers, and it works good so far.

To see how to dynamically load DLL, have a look at LoadLibrary at MSDN.

Hope it helps,

I recently bought an acer aspire 4750G with an Nvidia Geforce GT 540M. The problem is, When I check the display advance settings, the graphics card that is display there is intel HD graphics card.

Should this go in its own thread?

Anyway, the Optimus technology is a dynamic switching technology that goes between the integrated graphics (Intel HD graphics card) and the NVidia graphics card, for rendering, not display:

“Using NVIDIA’s Optimus technology, when the discrete GPU is handling all the rendering duties, the final image output to the display is still handled by the Intel integrated graphics processor (IGP).”

Thus, all the rendering can be done on the GPU, and the results given to the IGP for display purposes.

Now if you’re asking if this will affect your use of OpenCL, the answer is: “maybe.”
If the NVIDIA driver sees that you have an OpenCL device, then you should not have an issue (Optimus loads the GPU into an idle state, so the device is ‘there’ and can be switched to quickly, so this should be okay). However, others on the NVIDIA forums have been having some difficulty with CUDA, Drivers, and Optimus, so I can’t guarantee that this will work.