# How to use clCreateProgramWithBinary()  on cuda device using OpenCL ?

**URL:** <https://forums.developer.nvidia.com/t/how-to-use-clcreateprogramwithbinary-on-cuda-device-using-opencl/27938>\
**Category:** CUDA Programming and Performance\
**Created:** [January 14, 2013, 12:41pm UTC](https://forums.developer.nvidia.com/t/how-to-use-clcreateprogramwithbinary-on-cuda-device-using-opencl/27938 "2013-01-14T12:41:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![leiming](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@leiming](https://forums.developer.nvidia.com/u/leiming)\
**Post date:** [January 14, 2013, 12:41pm UTC](https://forums.developer.nvidia.com/t/how-to-use-clcreateprogramwithbinary-on-cuda-device-using-opencl/27938/1 "2013-01-14T12:41:23Z")

</div>

Hello All,  
I am currently writing some code using OpenCL on CUDA devices and came across this dilemma that generated binaries for the program using OpenCL on a cluster node with multiple T10 devices, couldn’t be used to re-create the program using clCreateProgramWithBinary(). After checking the binaries, for AMD gpus, the binaries are in ELF, while in PTX for Nvidia gpus.  
Does anyone have a suggestion/solution for such problem?  
Your advice is greatly appreciated! Thank you in advance.

Sincerely,

---

<div class="post-metadata">

**Author:** ![leiming](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@leiming](https://forums.developer.nvidia.com/u/leiming)\
**Post date:** [January 18, 2013, 3:44pm UTC](https://forums.developer.nvidia.com/t/how-to-use-clcreateprogramwithbinary-on-cuda-device-using-opencl/27938/2 "2013-01-18T15:44:35Z")

</div>

To update here, I change to the following code  
errNum = clBuildProgram(program, 1, &device, opt, NULL, NULL);  
from  
 errNum = clBuildProgram(program, 0, NULL, opt, NULL, NULL);  
after clCreateProgramWithBinary() is called.  
However, the loading speed is faster on AMD Cypress than Nvidia T10.  
Is it because OpenCL is no longer welcomed on Nvida GPUs?

Thanks.
