Khanattila / KNLMeansCL

An optimized OpenCL implementation of the Non-local means de-noising algorithm
GNU General Public License v3.0
107 stars 22 forks source link

OpenCL compiler failure on Mac #11

Closed invisiblearts closed 9 years ago

invisiblearts commented 9 years ago

Configure script worked well, but running it doesn't... Log-KNLMeansCL.txt

(By the way, CPU mode is also not working.) Log-KNLMeansCL.txt

Khanattila commented 9 years ago

What is your configuration CPU/GPU? In any case it is not a problem specific to OS X, this problem is relative to OpenCL compiler.

invisiblearts commented 9 years ago

I think it may relate to clang? AFAIK OpenCL compiler calls the system default compiler. Broadwell i5 with iris pro 6100

Khanattila commented 9 years ago

Yes, the system compiler does strange things from what I see. At the hardware level your system is fully compatible.

Anyway, from Apple "OpenCL compiler uses the clang and LLVM technologies to compile the kernels written in OpenCL and translate those instructions into optimized machine code targeted for the hardware on the host machine".

You have tried to update Clang & co? I do not know how it works on OS X.

invisiblearts commented 9 years ago

My clang is the latest version available (Apple clang 7.0) I also installed gcc & community version of clang but I don't know how to use them. Anyway as I know barely anything about OpenCL, the only way to make it work is to roll back to an older version.

Khanattila commented 9 years ago

Can you try the last commit?

invisiblearts commented 9 years ago

Building with clang failed.

./KNLMeansCL/KNLMeansCL.cpp:1351:102: error: invalid suffix on literal; C++11
      requires a space between literal and identifier
      [-Wreserved-user-defined-literal]
  ...no compatible opencl platforms available! (OpenCL "OCL_MIN_VERSION" API)");
                                                        ^
./KNLMeansCL/KNLMeansCL.cpp:1399:103: error: invalid suffix on literal; C++11
      requires a space between literal and identifier
      [-Wreserved-user-defined-literal]
  ...no compatible opencl platforms available! (OpenCL "OCL_MIN_VERSION" API)");
                                                        ^

gcc on the other hand gives a warning about the same thing.

However running still failed. GPU Log CPU Log

Khanattila commented 9 years ago

I made other changes. I hope they are sufficient.

invisiblearts commented 9 years ago

-O3 is invalid build option. After removing it build passed, but setKernelArg failed with return CL_INVALID_MEM_OBJECT.

Khanattila commented 9 years ago

Added more controls. Try again, and reports the error.

invisiblearts commented 9 years ago

Now I get this error(both CPU and GPU mode): vapoursynth.Error: knlm.KNLMeansCL: fatal error! (clCreateImage(d.mem_in[0]): CL_IMAGE_FORMAT_NOT_SUPPORTED)

Khanattila commented 9 years ago

clCreateImage return CL_IMAGE_FORMAT_NOT_SUPPORTED if the 'image_format' is not supported. But 'image_format' depending on the input-clip. It's possible that Apple has not supported all formats in OpenCL 1.2.

Try different input-clip: [P8], [P9-P10-P16], [PH] and [PS]. Example: YUV420P8, YUV420P16, YUV444PH and YUV444PS.

Khanattila commented 9 years ago

Also 'cmode' affect image_format. It's easier to stay with the v0.6.