3 ms·
Yes it’s that bad unfortunately. Ok, so you got you kernel working and it performs well. That’s quite an achievement, because most tooling is atrocious, and pro
by w-m 6y ago
Yes it’s that bad unfortunately. Ok, so you got you kernel working and it performs well. That’s quite an achievement, because most tooling is atrocious, and profiling tools nonexistent for many platforms.
Now you want to run this on the users machine. You are of course using an ancient OpenCL version, because very few vendors updates their OpenCL drivers. Situation has gotten so bad that the consortium had to basicallly roll back much of the newer standard because nobody sipported it.
Anyway, the users GPU has the right capabilities and should run your code fine. But it doesn’t. If you’re lucky, you get an error message. Often you don’t, either you get a cryptic error code with zero Google results, or the OpenCL compiler just crashes. That actually happens quite often.
In summary, if you want to support many different GPUs in different OSes, you’re in a world of pain, because everything is half-baked.
There was a letter by the Blender devs to Apple a couple years ago to get their shit together and fix their OpenCL driver. I don’t think they ever did, just deprecated it and told you to use Metal...
- henrikf 6y agoEven worse than error message is incorrect results. I worked on the OpenCL neural net evaluation backend used in Leela Zero and lc0 Go and chess bots. We had reports of several OpenCL drivers being so broken that they gave incorrect results while appearing to work correctly without giving any error messages. Intel integrated GPUs on Apple were the worst offender and it looks like the drivers are never going to get fixed. Some older AMD cards had similar issues. We had to add a check that GPU NN evaluation matches CPU reference to catch these broken drivers.