Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use 2 OpenCL runtimes

Tags:

opencl

I want to use 2 OpenCL runtimes in one system together (in my case AMD and Nvidia, but the question is pretty generic).

I know that I can compile my program with any SDK. But when running the program, I need to provide libOpenCL.so. How can I provide the libs of both runtimes so that I see 3 devices (AMD CPU, AMD GPU, Nvidia GPU) in my OpenCL program?

I know that it must be possible somehow, but I didn't find a description on how to do it for linux, yet.

Thanks a lot, Tomas

like image 624
Tomas Avatar asked Feb 12 '13 14:02

Tomas


1 Answers

You're not thinking of it right. SDK's are not provided by the application, and are not needed for running a compiled program. OpenCL runtimes are provided by the client system, and that's what's giving your program platforms and devices to use in clGetPlatformIDs and clGetDeviceIDs.

If the user does not have an Nvidia graphics card, you are simply not going to be able to use an Nvidia platform and device on his system, because he doesn't have the Nvidia OpenCL runtime or hardware.

All different OpenCL SDK's provide you are vendor-specific extensions, which are then understood by the vendor runtime.

like image 70
Thomas Avatar answered Dec 08 '22 01:12

Thomas