When I try to run the "App" target of the Xcode project, I get an exception thrown on CLWCommandQueue.cpp:37, and the message "clCreateCommandQueue failed" prints before exiting.
The status
returned by clCreateCommandQueue
is -33, CL_INVALID_DEVICE
.
Here is the results of printing platform
in ConfigManager::CreateConfigs:
(lldb) print platforms
(std::__1::vector<CLWPlatform, std::__1::allocator<CLWPlatform> >) $2 = size=1 {
[0] = {
ReferenceCounter<_cl_platform_id *, int (*)(_cl_platform_id *), int (*)(_cl_platform_id *)> = (object_ = 0x000000007fff0000)
name_ = "Apple"
profile_ = "FULL_PROFILE"
version_ = "OpenCL 1.2 (Apr 26 2016 00:05:53)"
vendor_ = "Apple"
extensions_ = ""
devices_ = size=2 {
[0] = {
ReferenceCounter<_cl_device_id *, cl_int (*)(_cl_device_id *), cl_int (*)(_cl_device_id *)> = (object_ = 0x0000000001024400)
name_ = "HD Graphics 4000"
vendor_ = "Intel"
version_ = "OpenCL 1.2 "
profile_ = "FULL_PROFILE"
extensions_ = "cl_APPLE_SetMemObjectDestructor cl_APPLE_ContextLoggingFunctions cl_APPLE_clut cl_APPLE_query_kernel_names cl_APPLE_gl_sharing cl_khr_gl_event cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_image2d_from_buffer cl_khr_gl_depth_images cl_khr_depth_images cl_khr_3d_image_writes "
type_ = 4
localMemSize_ = 65536
globalMemSize_ = 1610612736
maxAllocSize_ = 402653184
localMemType_ = 1
maxWorkGroupSize_ = 512
minAlignSize_ = 128
}
[1] = {
ReferenceCounter<_cl_device_id *, cl_int (*)(_cl_device_id *), cl_int (*)(_cl_device_id *)> = (object_ = 0x0000000001022700)
name_ = "GeForce GT 650M"
vendor_ = "NVIDIA"
version_ = "OpenCL 1.2 "
profile_ = "FULL_PROFILE"
extensions_ = "cl_APPLE_SetMemObjectDestructor cl_APPLE_ContextLoggingFunctions cl_APPLE_clut cl_APPLE_query_kernel_names cl_APPLE_gl_sharing cl_khr_gl_event cl_khr_byte_addressable_store cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_APPLE_fp64_basic_ops cl_khr_fp64 cl_khr_3d_image_writes cl_khr_depth_images cl_khr_gl_depth_images cl_khr_gl_msaa_sharing cl_khr_image2d_from_buffer cl_APPLE_ycbcr_422 cl_APPLE_rgb_422 "
type_ = 4
localMemSize_ = 49152
globalMemSize_ = 1073741824
maxAllocSize_ = 268435456
localMemType_ = 1
maxWorkGroupSize_ = 1024
minAlignSize_ = 128
}
}
type_ = 4
}
}
Only device 0, "Intel HD Graphics 4000" is failing to create a command queue. If I adjust ConfigManager::CreateConfigs
to start with device 1, the nvidia card, the command queue creation succeeds.
Maybe the CLWContext::Create
calls in ConfigManager::CreateConfigs
should be done in a try {} catch {}
block so if an exception happens, the loop over devices just continues to try the next device?