tensorflow unusual CUDA related error - python-2.7

I've been using tensorflow for nearly two years and have never seen this one. On a new Ubuntu box, I have a fresh install of tensorflow in a virtualenv. When I ran a sample code, i got a Invalid Device error. It occurred when tf.Session() is called.
WARNING:tensorflow:From full_code.py:27: initialize_all_variables (from tensorflow.python.ops.variables) is deprecated and will be removed after 2017-03-02.
Instructions for updating:
Use `tf.global_variables_initializer` instead.
2017-06-05 11:01:55.853842: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-06-05 11:01:55.853867: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-06-05 11:01:55.853876: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-06-05 11:01:55.853886: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2017-06-05 11:01:55.853893: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
2017-06-05 11:01:55.937978: I tensorflow/core/common_runtime/gpu/gpu_device.cc:887] Found device 0 with properties:
name: GeForce GTX 660 Ti
major: 3 minor: 0 memoryClockRate (GHz) 1.0455
pciBusID 0000:04:00.0
Total memory: 2.95GiB
Free memory: 2.91GiB
2017-06-05 11:01:55.938063: W tensorflow/stream_executor/cuda/cuda_driver.cc:485] creating context when one is currently active; existing: 0x19e5370
2017-06-05 11:01:56.014220: E tensorflow/core/common_runtime/direct_session.cc:137] Internal: failed initializing StreamExecutor for CUDA device ordinal 1: Internal: failed call to cuDevicePrimaryCtxRetain: CUDA_ERROR_INVALID_DEVICE
Here is the full spec.
Ubuntu 14.04
CUDA 8.0
GeForce GTX 660 Ti
python 3.4.3

Thanks to someone from google, i figured out what went wrong. In this Dell box, there are two Nvidia graphic cards. First one comes with the manufacturer and is a NVS 310 card. As far as I know, this one does not have any compute capability and I never intend to use much of it.
I then added a second card, a GTX 660 Ti and I intended to use this one for all computations.
When Tensorflow is invoked, it defaults to Device 0, which is the NVS 310. And of course it throws an invalid error.
When I do this,
CUDA_VISIBLE_DEVICES=1 python myscript.py
it works.

Related

Switched OS version, vulkan program stopped working

A program I was developing stopped working when I upgraded from Ubuntu 20.04 to 21.04
What I suspect is happening is, I am using conan to install dependencies, including what would be inside the sdk (the loader, the headers, the validation layers).
vkcube and vulkaninfo run, so vulkan itself is fine.
The conan package versions (whose versioning matches that of the official github repos for each project) are:
"vulkan-headers/1.2.184",
"vulkan-loader/1.2.182",
"vulkan-validationlayers/1.2.182"
I get the following from vulkaninfo:
vulkaninfo | grep Instance
WARNING: lavapipe is not a conformant vulkan implementation, testing use only.
Vulkan Instance Version: 1.2.182
Instance Extensions: count = 18
WARNING: lavapipe is not a conformant vulkan implementation, testing use only.
maxMultiviewInstanceIndex = 2147483647
maxMultiviewInstanceIndex = 2147483647
drawIndirectFirstInstance = true
vertexAttributeInstanceRateDivisor = true
vertexAttributeInstanceRateZeroDivisor = true
drawIndirectFirstInstance = true
vertexAttributeInstanceRateDivisor = true
vertexAttributeInstanceRateZeroDivisor = false
I have also tried downloading the latest sdk and running the setu-env.sh script to see if that fixes it but it doesn't seem to do anything.
The exact problem I get is, a segmentation fault when calling:
physical_device.getQueueFamilyProperties(); (I am using the .hpp header)
I am not entirely sure why things stopped working, I suspect I might have a mismatch between, for example my vulkan.hpp header and my vulkan library but I don't know how to check. And I am not sure it is actually the problem.
I get this as well when running vulkaninfo | grep GPU:
WARNING: lavapipe is not a conformant vulkan implementation, testing use only.
GPU id = 0 (AMD RADV RAVEN2 (ACO))
GPU id = 1 (llvmpipe (LLVM 12.0.0, 256 bits))
GPU id = 0 (AMD RADV RAVEN2 (ACO))
GPU id = 1 (llvmpipe (LLVM 12.0.0, 256 bits))
GPU id : 0 (AMD RADV RAVEN2 (ACO)):
GPU id : 1 (llvmpipe (LLVM 12.0.0, 256 bits)):
WARNING: lavapipe is not a conformant vulkan implementation, testing use only.
GPU0:
deviceType = PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU
GPU1:
This reddit comment seems to have been the solution:
https://www.reddit.com/r/Fedora/comments/krz20h/vulkan_swrast_lavapipe_is_getting_used_instead_of/
specifically:
After reading through Archwiki, I've discovered that lavapipe is indeed being used instead of radeon.
exporting VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.x86_64.json fixes the issue.

GCC compilation times slower on Debian Stretch/Buster than Wheezy/Jessie

in my compagny we are building programs for different versions of Debian. We are using a Jenkins build chains with Virtual Machine on ESXI.
The programs compils with GCC. Based on some test we found that the compilation time on Stretch/Buster is 50% slower than on Wheezy/Jessie.
For example, a simple Hello World program :
jessie
------
real 0m0.099s
user 0m0.076s
sys 0m0.012s
buster
------
real 0m0,201s
user 0m0,168s
sys 0m0,032s
For small programs, it's not really important but for bigger projects, time difference is really visible (even with -O3 falgs) :
jessie
------
real 0m29.996s
user 0m26.636s
sys 0m1.688s
buster
------
real 0m59,051s
user 0m53,226s
sys 0m5,164s
Our biggest project takes 25 min on Jessie to compile against 45 min on Stretch.
Note this is done on two different virtual machine but on the same physical machine. The CPU models is : Intel(R) Core(TM) i7-4770 CPU # 3.40GHz.
I think that one reason might be the meldown and spectre patch that is applied to the kernel. But i don't know if this patch is enabled on stretch.
Do you have any idea about the possible reasons of this performance difference? How i can check it? And how to fix it if possible.
Regards.

OpenGL program with tensorflow C++ gives failed call to cuInit : CUDA_ERROR_OUT_OF_MEMORY

I have trained a model with no issues using tensorflow on python. I am now trying to integrate inference for this model into a pre-existing OpenGL enabled software. However, I get a CUDA_ERROR_OUT_OF_MEMORY during cuInit (that is, even earlier than loading the model, just at session creation). It does seem, that OpenGL has taken some MiBs of memory (around 300 MB), as shown by gpustat or nvidia-smi.
Is it possible there is a clash as both TF and OpenGL are trying to access/allocate the GPU memory? Has anyone encountered this problem before? Most references I found googling around are at model loading time, not at session/CUDA initialization. Is this completely unrelated to OpenGL and I am just barking up the wrong tree? A simple TF C++ inference example works. Any help is appreciated.
Here is the tensorflow logging output, for completeness:
2018-01-08 12:11:38.321136: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
2018-01-08 12:11:38.379100: E tensorflow/stream_executor/cuda/cuda_driver.cc:406] failed call to cuInit: CUDA_ERROR_OUT_OF_MEMORY
2018-01-08 12:11:38.379388: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:158] retrieving CUDA diagnostic information for host: rosenblatt
2018-01-08 12:11:38.379413: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:165] hostname: rosenblatt
2018-01-08 12:11:38.379508: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:189] libcuda reported version is: 384.98.0
2018-01-08 12:11:38.380425: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:369] driver version file contents: """NVRM version: NVIDIA UNIX x86_64 Kernel Module 384.98 Thu Oct 26 15:16:01 PDT 2017 GCC version: gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5)"""
2018-01-08 12:11:38.380481: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:193] kernel reported version is: 384.98.0
2018-01-08 12:11:38.380497: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:300] kernel version seems to match DSO: 384.98.0
EDIT: Removing all references to OpenGL resulted in the same problem, so it has nothing to do with a clash between the libraries.
Ok, the problem was the use of the sanitizer in the debug version of the binary. The release version, or the debug version with no sanitizer work as expected.

OpenCL / OpenGL and osx crashes

I've been working on an opencl octree ray caster which is written in openframeworks. It takes point clouds of 5-10m points, builds an octree, passes the octree to the kernel and then runs about 200k raycasts to find point interceptions.
The code is working well enough, with results being rendered through vbo objects. See here and here for a couple of clips (still perfecting the intersection checks).
The problem is, I have been having a whole series of mac black screen moments lately. (I'm on a late 2013 mac pro with a recent el-cap update) I'm pretty sure that the black screens are some form of kernel crash or overload (?). They happen both occasionally when the app is running and also even when OF has been shut down and I've moved on to other work afterwards. Regularly enough to make working a nightmare...
I'm fairly green with opencl and the like but I think that my basic kernel code is sound. I am also including cleanup functions in the c++ on exit. Are there any other simple issues/safeguards that I may be unaware of that I need to be sure to include/I could try in my app?
It may be I need to include more information, happy to update in response to questions.
In hope
S
update:
here's a system report from the latest shut down; happened after a restart after a crash after running the app. I have totally zero clue:
Anonymous UUID: 1B68061F-68FC-BED2-559B-C8457A01380E
Sun Apr 24 16:03:12 2016
*** Panic Report ***
panic(cpu 6 caller 0xffffff7f92b72bd5): "GPU Panic: [<None>] 3 0 a0 d9 9 8 0 3 : NVRM[0/1:0:0]: Read Error 0x00000100: CFG 0xffffffff 0xffffffff 0xffffffff, BAR0 0x103e00000 0xffffff92013c9000 0x0e7150a2, D0, P3/4\n"#/Library/Caches/com.apple.xbs/Sources/AppleGraphicsControl/AppleGraphicsControl-3.12.6/src/AppleMuxControl/kext/GPUPanic.cpp:127
Backtrace (CPU 6), Frame : Return Address
0xffffff91fd61ae30 : 0xffffff800fadab12
0xffffff91fd61aeb0 : 0xffffff7f92b72bd5
0xffffff91fd61af90 : 0xffffff7f908241e0
0xffffff91fd61b050 : 0xffffff7f908f1ef4
0xffffff91fd61b090 : 0xffffff7f908f1f5f
0xffffff91fd61b110 : 0xffffff7f90b297a8
0xffffff91fd61b1b0 : 0xffffff7f90b413d2
0xffffff91fd61b1f0 : 0xffffff7f9096943a
0xffffff91fd61b220 : 0xffffff7f909693c5
0xffffff91fd61b250 : 0xffffff7f90a770c9
0xffffff91fd61b280 : 0xffffff7f90a78ea4
0xffffff91fd61b310 : 0xffffff7f90a79306
0xffffff91fd61b370 : 0xffffff7f90839636
0xffffff91fd61b3c0 : 0xffffff7f90a7d828
0xffffff91fd61b530 : 0xffffff7f90a7dc3a
0xffffff91fd61b5c0 : 0xffffff7f90928186
0xffffff91fd61b720 : 0xffffff7f90926ddf
0xffffff91fd61b760 : 0xffffff7f90936ffa
0xffffff91fd61b7c0 : 0xffffff7f90931337
0xffffff91fd61b7e0 : 0xffffff7f908eed6e
0xffffff91fd61b820 : 0xffffff7f908ede6f
0xffffff91fd61b890 : 0xffffff7f90827441
0xffffff91fd61b8b0 : 0xffffff7f90827ddb
0xffffff91fd61baa0 : 0xffffff7f9082815a
0xffffff91fd61bb40 : 0xffffff7f907d45c0
0xffffff91fd61bbc0 : 0xffffff7f907d3df2
0xffffff91fd61bc20 : 0xffffff7f907d574e
0xffffff91fd61bc60 : 0xffffff7f907864f5
0xffffff91fd61bcf0 : 0xffffff7f9077e10b
0xffffff91fd61bd20 : 0xffffff80100946b1
0xffffff91fd61bd70 : 0xffffff80100de2f9
0xffffff91fd61bde0 : 0xffffff800fb977a1
0xffffff91fd61be30 : 0xffffff800fadf283
0xffffff91fd61be60 : 0xffffff800fac28b8
0xffffff91fd61bea0 : 0xffffff800fad2665
0xffffff91fd61bf10 : 0xffffff800fbb8bda
0xffffff91fd61bfb0 : 0xffffff800fbeca96
Kernel Extensions in backtrace:
com.apple.iokit.IOGraphicsFamily(2.4.1)[172C2960-EDF5-382D-80A5-C13E97D74880]#0xffffff7f90774000->0xffffff7f907aefff
dependency: com.apple.iokit.IOPCIFamily(2.9)[4FE41F9B-2849-322A-BBF8-A94816C003D6]#0xffffff7f9032c000
com.apple.driver.AppleMuxControl(3.12.6)[44D361A1-4938-3AA5-9F73-9C909B66214B]#0xffffff7f92b64000->0xffffff7f92b77fff
dependency: com.apple.driver.AppleGraphicsControl(3.12.6)[1654475C-9A4B-386C-AFA8-0A530194A2F9]#0xffffff7f92b5c000
dependency: com.apple.iokit.IOACPIFamily(1.4)[5D7574C3-8E90-3873-BAEB-D979FC215A7D]#0xffffff7f90f7f000
dependency: com.apple.iokit.IOPCIFamily(2.9)[4FE41F9B-2849-322A-BBF8-A94816C003D6]#0xffffff7f9032c000
dependency: com.apple.iokit.IOGraphicsFamily(2.4.1)[172C2960-EDF5-382D-80A5-C13E97D74880]#0xffffff7f90774000
dependency: com.apple.driver.AppleBacklightExpert(1.1.0)[C49819CE-729A-36B2-9AC1-744A43DC236F]#0xffffff7f92b5f000
com.apple.nvidia.driver.NVDAResman(10.1)[8649777A-3EED-3F2F-8B12-FBC5517F62E6]#0xffffff7f907d2000->0xffffff7f90a4bfff
dependency: com.apple.iokit.IOPCIFamily(2.9)[4FE41F9B-2849-322A-BBF8-A94816C003D6]#0xffffff7f9032c000
dependency: com.apple.iokit.IONDRVSupport(2.4.1)[1114B99F-E439-329E-876D-1FEC4CF45DF6]#0xffffff7f907bb000
dependency: com.apple.iokit.IOGraphicsFamily(2.4.1)[172C2960-EDF5-382D-80A5-C13E97D74880]#0xffffff7f90774000
dependency: com.apple.AppleGraphicsDeviceControl(3.12.6)[F211EB28-182A-34BB-A610-87667618F925]#0xffffff7f907cb000
com.apple.nvidia.driver.NVDAGK100Hal(10.1)[EB8A5980-AB59-368A-8244-60A00C7A933C]#0xffffff7f90a57000->0xffffff7f90c05fff
dependency: com.apple.nvidia.driver.NVDAResman(10.1.0)[8649777A-3EED-3F2F-8B12-FBC5517F62E6]#0xffffff7f907d2000
dependency: com.apple.iokit.IOPCIFamily(2.9)[4FE41F9B-2849-322A-BBF8-A94816C003D6]#0xffffff7f9032c000
BSD process name corresponding to current thread: WindowServer
Mac OS version:
15E65
Kernel version:
Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64
Kernel UUID: 4E7B4496-0B81-34E9-97AF-F316103B0839
Kernel slide: 0x000000000f800000
Kernel text base: 0xffffff800fa00000
__HIB text base: 0xffffff800f900000
System model name: MacBookPro10,1 (Mac-C3EC7CD22292981F)
System uptime in nanoseconds: 8583589115
last loaded kext at 7720294530: com.apple.driver.AGPM 110.21.18 (addr 0xffffff7f92b3c000, size 122880)
loaded kexts:
net.telestream.driver.TelestreamAudio 1.0.5
com.logmein.driver.LogMeInSoundDriver 4.1.63f33
com.apple.driver.AGPM 110.21.18
com.apple.driver.ApplePlatformEnabler 2.6.0d0
com.apple.driver.X86PlatformShim 1.0.0
com.apple.driver.AppleMikeyHIDDriver 124
com.apple.driver.AppleOSXWatchdog 1
com.apple.driver.AppleMikeyDriver 274.7
com.apple.driver.AudioAUUC 1.70
com.apple.driver.AppleHDAHardwareConfigDriver 274.7
com.apple.driver.pmtelemetry 1
com.apple.iokit.IOUserEthernet 1.0.1
com.apple.driver.AppleHDA 274.7
com.apple.iokit.IOBluetoothSerialManager 4.4.4f4
com.apple.driver.AppleUpstreamUserClient 3.6.1
com.apple.Dont_Steal_Mac_OS_X 7.0.0
com.apple.GeForce 10.1.0
com.apple.driver.AppleIntelHD4000Graphics 10.1.4
com.apple.driver.AppleSMCLMU 208
com.apple.driver.ACPI_SMC_PlatformPlugin 1.0.0
com.apple.driver.AppleHV 1
com.apple.driver.AppleFIVRDriver 4.1.0
com.apple.driver.AppleBacklight 170.8.9
com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport 4.4.4f4
com.apple.driver.AppleSMCPDRC 1.0.0
com.apple.driver.AppleLPC 3.1
com.apple.driver.AppleThunderboltIP 3.0.8
com.apple.driver.AppleMuxControl 3.12.6
com.apple.driver.AppleIntelSlowAdaptiveClocking 4.0.0
com.apple.driver.AppleMCCSControl 1.2.13
com.apple.driver.AppleIntelFramebufferCapri 10.1.4
com.apple.nvidia.NVDAStartup 10.1.0
com.apple.driver.AppleUSBTCButtons 245.4
com.apple.iokit.IOBluetoothUSBDFU 4.4.4f4
com.apple.driver.AppleUSBTCKeyEventDriver 245.4
com.apple.driver.AppleUSBTCKeyboard 245.4
com.apple.driver.CoreStorageFsck 517.20.1
com.apple.driver.AppleFileSystemDriver 3.0.1
com.apple.AppleFSCompression.AppleFSCompressionTypeDataless 1.0.0d1
com.apple.AppleFSCompression.AppleFSCompressionTypeZlib 1.0.0
com.apple.BootCache 38
com.apple.driver.AirPort.Brcm4331 800.20.24
com.apple.driver.AppleSDXC 1.7.0
com.apple.iokit.AppleBCM5701Ethernet 10.2.0
com.apple.iokit.IOAHCIBlockStorage 2.8.5
com.apple.driver.AirPort.Brcm4360 1040.1.1a6
com.apple.driver.usb.AppleUSBEHCIPCI 1.0.1
com.apple.driver.AppleAHCIPort 3.1.8
com.apple.driver.AppleSmartBatteryManager 161.0.0
com.apple.driver.AppleACPIButtons 4.0
com.apple.driver.AppleRTC 2.0
com.apple.driver.AppleHPET 1.8
com.apple.driver.AppleSMBIOS 2.1
com.apple.driver.AppleACPIEC 4.0
com.apple.driver.AppleAPIC 1.7
com.apple.driver.AppleIntelCPUPowerManagementClient 218.0.0
com.apple.nke.applicationfirewall 163
com.apple.security.quarantine 3
com.apple.security.TMSafetyNet 8
com.apple.driver.AppleIntelCPUPowerManagement 218.0.0
com.apple.driver.DspFuncLib 274.7
com.apple.kext.OSvKernDSPLib 525
com.apple.iokit.IOSerialFamily 11
com.apple.driver.CoreCaptureResponder 1
com.apple.nvidia.driver.NVDAGK100Hal 10.1.0
com.apple.nvidia.driver.NVDAResman 10.1.0
com.apple.iokit.IOSurface 108.2.1
com.apple.driver.IOPlatformPluginLegacy 1.0.0
com.apple.iokit.IOBluetoothHostControllerUSBTransport 4.4.4f4
com.apple.iokit.IOBluetoothFamily 4.4.4f4
com.apple.driver.AppleHDAController 274.7
com.apple.iokit.IOHDAFamily 274.7
com.apple.iokit.IOAudioFamily 204.3
com.apple.vecLib.kext 1.2.0
com.apple.driver.AppleSMBusPCI 1.0.14d1
com.apple.driver.AppleThunderboltEDMSink 4.1.1
com.apple.driver.AppleThunderboltDPOutAdapter 4.1.3
com.apple.driver.AppleBacklightExpert 1.1.0
com.apple.driver.AppleGraphicsControl 3.12.6
com.apple.driver.X86PlatformPlugin 1.0.0
com.apple.driver.IOPlatformPluginFamily 6.0.0d7
com.apple.iokit.IOSlowAdaptiveClockingFamily 1.0.0
com.apple.iokit.IONDRVSupport 2.4.1
com.apple.driver.AppleSMC 3.1.9
com.apple.driver.AppleSMBusController 1.0.14d1
com.apple.iokit.IOAcceleratorFamily2 205.3
com.apple.AppleGraphicsDeviceControl 3.12.6
com.apple.iokit.IOGraphicsFamily 2.4.1
com.apple.iokit.IOSCSIArchitectureModelFamily 3.7.7
com.apple.driver.usb.IOUSBHostHIDDevice 1.0.1
com.apple.driver.AppleUSBMultitouch 250.5
com.apple.iokit.IOUSBHIDDriver 900.4.1
com.apple.driver.usb.cdc 5.0.0
com.apple.driver.usb.networking 5.0.0
com.apple.driver.usb.AppleUSBHostCompositeDevice 1.0.1
com.apple.driver.usb.AppleUSBHub 1.0.1
com.apple.driver.CoreStorage 517.20.1
com.apple.driver.AppleThunderboltDPInAdapter 4.1.3
com.apple.driver.AppleThunderboltDPAdapterFamily 4.1.3
com.apple.driver.AppleThunderboltPCIDownAdapter 2.0.2
com.apple.driver.AppleXsanScheme 3
com.apple.driver.AppleThunderboltNHI 4.0.4
com.apple.iokit.IOThunderboltFamily 6.0.2
com.apple.iokit.IOEthernetAVBController 1.0.3b3
com.apple.iokit.IO80211Family 1110.26
com.apple.driver.mDNSOffloadUserClient 1.0.1b8
com.apple.iokit.IONetworkingFamily 3.2
com.apple.driver.corecapture 1.0.4
com.apple.driver.AppleUSBMergeNub 900.4.1
com.apple.driver.usb.AppleUSBEHCI 1.0.1
com.apple.iokit.IOAHCIFamily 2.8.1
com.apple.driver.usb.AppleUSBXHCIPCI 1.0.1
com.apple.driver.usb.AppleUSBXHCI 1.0.1
com.apple.iokit.IOUSBFamily 900.4.1
com.apple.iokit.IOUSBHostFamily 1.0.1
com.apple.driver.AppleUSBHostMergeProperties 1.0.1
com.apple.driver.AppleEFINVRAM 2.0
com.apple.driver.AppleEFIRuntime 2.0
com.apple.iokit.IOHIDFamily 2.0.0
com.apple.iokit.IOSMBusFamily 1.1
com.apple.security.sandbox 300.0
com.apple.kext.AppleMatch 1.0.0d1
com.apple.driver.AppleKeyStore 2
com.apple.driver.AppleMobileFileIntegrity 1.0.5
com.apple.driver.AppleCredentialManager 1.0
com.apple.driver.DiskImages 417.2
com.apple.iokit.IOStorageFamily 2.1
com.apple.iokit.IOReportFamily 31
com.apple.driver.AppleFDEKeyStore 28.30
com.apple.driver.AppleACPIPlatform 4.0
com.apple.iokit.IOPCIFamily 2.9
com.apple.iokit.IOACPIFamily 1.4
com.apple.kec.pthread 1
com.apple.kec.corecrypto 1.0
com.apple.kec.Libm 1
Model: MacBookPro10,1, BootROM MBP101.00EE.B0A, 4 processors, Intel Core i7, 2.7 GHz, 16 GB, SMC 2.3f36
Graphics: Intel HD Graphics 4000, Intel HD Graphics 4000, Built-In
Graphics: NVIDIA GeForce GT 650M, NVIDIA GeForce GT 650M, PCIe, 1024 MB
Memory Module: BANK 0/DIMM0, 8 GB, DDR3, 1600 MHz, 0x80AD, 0x484D5434314753364D465238432D50422020
Memory Module: BANK 1/DIMM0, 8 GB, DDR3, 1600 MHz, 0x80AD, 0x484D5434314753364D465238432D50422020
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0xEF), Broadcom BCM43xx 1.0 (7.21.95.175.1a6)
Bluetooth: Version 4.4.4f4 17685, 3 services, 27 devices, 1 incoming serial ports
Network Service: AirPort, AirPort, en0
Serial ATA Device: APPLE SSD SD512E, 500.28 GB
USB Device: USB 2.0 Bus
USB Device: Hub
USB Device: FaceTime HD Camera (Built-in)
USB Device: USB 2.0 Bus
USB Device: Hub
USB Device: Hub
USB Device: Apple Internal Keyboard / Trackpad
USB Device: BRCM20702 Hub
USB Device: Bluetooth USB Host Controller
USB Device: USB 3.0 Bus
Thunderbolt Bus: MacBook Pro, Apple Inc., 23.4
So after much checking, there isn't anything wrong with my opencl code.
The issue appears to be that the GPU has some kind of heat throttling going on; if it hits 55 degrees Celsius it shuts down, boom. Go Apple.
By downloading smcFanControl and gfxCardStatus, turning the fans to full and keeping an eye on the temperature I've got the panics down to a bearable/manageable occurance.
Not great but maybe I need a better laptop.

Error while using Tesseract with OpenCL option enabled

I am using Tesseract with OpenCL option enabled in my project. While executing the GetUTF8Text() method, I am getting the following error:
DS] Profile read from file (tesseract_opencl_profile_devices.dat).
[DS] Device[1] 1:Intel(R) Core(TM) i5-4250U CPU # 1.30GHz score is 14049349632.000000
[DS] Device[2] 1:HD Graphics 5000 score is 14049349632.000000
[DS] Device[3] 0:(null) score is 21474836480.000000
[DS] Selected Device[1]: "Intel(R) Core(TM) i5-4250U CPU # 1.30GHz" (OpenCL)
OpenCL error code is -54 at when clEnqueueNDRangeKernel kernel_HistogramRectAllChannels .
OpenCL error code is -54 at when clEnqueueNDRangeKernel kernel_HistogramRectAllChannelsReduction .
OpenCL error code is -54 at when clEnqueueNDRangeKernel kernel_ThresholdRectToPix .
OpenCL error code is -54 at when clEnqueueNDRangeKernel kernel_HistogramRectAllChannels .
OpenCL error code is -54 at when clEnqueueNDRangeKernel kernel_HistogramRectAllChannelsReduction .
Version of libraries used:
tesseract 3.04.00
leptonica-1.71
zlib 1.2.5
OpenCL info:
Found 1 platforms.
Platform name: Apple.
Version: OpenCL 1.2 (Dec 14 2014 22:29:47).
Found 2 devices.
Device 1 name: Intel(R) Core(TM) i5-4250U CPU # 1.30GHz.
Device 2 name: HD Graphics 5000.
Has anyone faced this issue before?
It looks like Tessaract enqueues kernels with a work-group size of 16x16, which is a fairly typical tile-size for image processing on GPUs. However, Apple's OpenCL implementation for CPUs has a limitation that work-group sizes can only be one-dimensional (i.e. the second dimension must be 1), and therefore this work-group size will be invalid. The error code you are getting (-54) corresponds to CL_INVALID_WORK_GROUP_SIZE.
If you can get Tesseract to run on the GPU instead (HD Graphics 5000), you should be OK.