Environment: $ sw_vers ProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G1108 GPU: GeForce GTX 680 CUDA Driver Version: 8.0.51 GPU Driver Version: 10.11.14 (346.03.15f04) Steps to reproduce: 1) compose a test kernel taking a texture argument $ cat test.clkern kernel void tst(image2d_t img) { (void)img; } 2) compile to SPIR $ /System/Library/Frameworks/OpenCL.framework/Libraries/openclc -c -x cl -arch gpu_64 -emit-llvm test.clkern -o test.spir 3) attempt to load and build output from command above with clCreateProgramWithBinary and clBuildProgram $ ./loadbin Using: GeForce GTX 680 [CL_DEVICE_NOT_AVAILABLE] : OpenCL Error : Error: Build Program driver returned (10007) Break on OpenCLErrorBreak to debug. OpenCL Warning : clBuildProgram failed: could not build program for 0x1022700 (GeForce GTX 680) (err:-2) Break on OpenCLWarningBreak to debug. [CL_BUILD_ERROR] : OpenCL Build Error : Compiler build log: ptxas application ptx input, line 18; error : Variable 'tst_param_0' cannot be allocated in .param state space ptxas application ptx input, line 18; error : Texture/surface variable must be at module or entry parameter scope ptxas fatal : Ptx assembly aborted due to errors Break on OpenCLErrorBreak to debug. Binary build log: ptxas application ptx input, line 18; error : Variable 'tst_param_0' cannot be allocated in .param state space ptxas application ptx input, line 18; error : Texture/surface variable must be at module or entry parameter scope ptxas fatal : Ptx assembly aborted due to errors