hughperkins / cltorch

An OpenCL backend for torch.
Other
289 stars 26 forks source link

Issue with OSX and Intel Iris Pro under OS X 10.10.5 (14F1605) #68

Closed samhodge closed 8 years ago

samhodge commented 8 years ago

kaos:head_shot2 sam$ lua -l cltorch -e 'cltorch.test()' running tests... after requiring cltorch.unit_storage Running 2 tests 1/2 test_get ............................................................ [WAIT] Using Apple , OpenCL platform: Apple Using OpenCL device: Iris Pro dyld: lazy symbol binding failed: Symbol not found: _lua_pcall Referenced from: /Users/sam/torch/install/lib/libEasyCL.dylib Expected in: flat namespace

dyld: Symbol not found: _lua_pcall Referenced from: /Users/sam/torch/install/lib/libEasyCL.dylib Expected in: flat namespace

Trace/BPT trap: 5 kaos:head_shot2 sam$ th -l cltorch -e 'cltorch.about()' cltorch. OpenCL backend for Torch Built from commit 7979ae8 More info, doc: https://github.com/hughperkins/cltorch Issues: https://github.com/hughperkins/cltorch/issues

kaos:head_shot2 sam$ uname -a Darwin kaos.fritz.box 14.5.0 Darwin Kernel Version 14.5.0: Tue Sep 1 21:23:09 PDT 2015; root:xnu-2782.50.1~1/RELEASE_X86_64 x86_64 kaos:head_shot2 sam$ clinfo Number of platforms 1 Platform Name Apple Platform Vendor Apple Platform Version OpenCL 1.2 (May 10 2015 19:38:45) Platform Profile FULL_PROFILE Platform Extensions cl_APPLE_SetMemObjectDestructor cl_APPLE_ContextLoggingFunctions cl_APPLE_clut cl_APPLE_query_kernel_names cl_APPLE_gl_sharing cl_khr_gl_event

Platform Name Apple Number of devices 2 Device Name Intel(R) Core(TM) i7-4750HQ CPU @ 2.00GHz Device Vendor Intel Device Vendor ID 0xffffffff Device Version OpenCL 1.2 Driver Version 1.1 Device OpenCL C Version OpenCL C 1.2 Device Type CPU Device Profile FULL_PROFILE Max compute units 8 Max clock frequency 2000MHz Device Partition (core) Max number of sub-devices 0 Supported partition types None Max work item dimensions 3 Max work item sizes 1024x1x1 Max work group size 1024 Preferred work group size multiple 1 Preferred / native vector sizes
char 16 / 16
short 8 / 8
int 4 / 4
long 2 / 2
half 0 / 0 (n/a) float 4 / 4
double 2 / 2 (cl_khr_fp64) Half-precision Floating-point support (n/a) Single-precision Floating-point support (core) Denormals Yes Infinity and NANs Yes Round to nearest Yes Round to zero Yes Round to infinity Yes IEEE754-2008 fused multiply-add Yes Support is emulated in software No Correctly-rounded divide and sqrt operations Yes Double-precision Floating-point support (cl_khr_fp64) Denormals Yes Infinity and NANs Yes Round to nearest Yes Round to zero Yes Round to infinity Yes IEEE754-2008 fused multiply-add Yes Support is emulated in software No Correctly-rounded divide and sqrt operations No Address bits 64, Little-Endian Global memory size 8589934592 (8GiB) Error Correction support No Max memory allocation 2147483648 (2GiB) Unified memory for Host and Device Yes Minimum alignment for any data type 128 bytes Alignment of base address 1024 bits (128 bytes) Global Memory cache type Read/Write Global Memory cache size 64 Global Memory cache line 6291456 bytes Image support Yes Max number of samplers per kernel 16 Max size for 1D images from buffer 65536 pixels Max 1D or 2D image array size 2048 images Base address alignment for 2D image buffers 1 bytes Pitch alignment for 2D image buffers 1 bytes Max 2D image size 8192x8192 pixels Max 3D image size 2048x2048x2048 pixels Max number of read image args 128 Max number of write image args 8 Local memory type Global Local memory size 32768 (32KiB) Max constant buffer size 65536 (64KiB) Max number of constant args 8 Max size of kernel argument 4096 (4KiB) Queue properties
Out-of-order execution No Profiling Yes Profiling timer resolution 1ns Execution capabilities
Run OpenCL kernels Yes Run native kernels Yes Prefer user sync for interop Yes printf() buffer size 1048576 (1024KiB) Built-in kernels
Device Available Yes Compiler Available Yes Linker Available Yes Device 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_fp64 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_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_3d_image_writes cl_khr_image2d_from_buffer cl_APPLE_fp64_basic_ops cl_APPLE_fixed_alpha_channel_orders cl_APPLE_biased_fixed_point_image_formats cl_APPLE_command_queue_priority

Device Name Iris Pro Device Vendor Intel Device Vendor ID 0x1024500 Device Version OpenCL 1.2 Driver Version 1.2(Nov 12 2015 16:12:02) Device OpenCL C Version OpenCL C 1.2 Device Type GPU Device Profile FULL_PROFILE Max compute units 40 Max clock frequency 1200MHz Device Partition (core) Max number of sub-devices 0 Supported partition types None Max work item dimensions 3 Max work item sizes 512x512x512 Max work group size 512 Preferred work group size multiple 32 Preferred / native vector sizes
char 1 / 1
short 1 / 1
int 1 / 1
long 1 / 1
half 0 / 0 (n/a) float 1 / 1
double 0 / 0 (n/a) Half-precision Floating-point support (n/a) Single-precision Floating-point support (core) Denormals No Infinity and NANs Yes Round to nearest Yes Round to zero Yes Round to infinity Yes IEEE754-2008 fused multiply-add Yes Support is emulated in software No Correctly-rounded divide and sqrt operations Yes Double-precision Floating-point support (n/a) Address bits 64, Little-Endian Global memory size 1610612736 (1.5GiB) Error Correction support No Max memory allocation 402653184 (384MiB) Unified memory for Host and Device Yes Minimum alignment for any data type 128 bytes Alignment of base address 1024 bits (128 bytes) Global Memory cache type None Image support Yes Max number of samplers per kernel 16 Max size for 1D images from buffer 25165824 pixels Max 1D or 2D image array size 2048 images Base address alignment for 2D image buffers 4 bytes Pitch alignment for 2D image buffers 32 bytes Max 2D image size 16384x16384 pixels Max 3D image size 2048x2048x2048 pixels Max number of read image args 128 Max number of write image args 8 Local memory type Local Local memory size 65536 (64KiB) Max constant buffer size 65536 (64KiB) Max number of constant args 8 Max size of kernel argument 1024 Queue properties
Out-of-order execution No Profiling Yes Profiling timer resolution 80ns Execution capabilities
Run OpenCL kernels Yes Run native kernels No Prefer user sync for interop Yes printf() buffer size 1048576 (1024KiB) Built-in kernels
Device Available Yes Compiler Available Yes Linker Available Yes Device 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

NULL platform behavior clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...) Apple clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...) Success [P0] clCreateContext(NULL, ...) [default] Success [P0] clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU) Success (1) Platform Name Apple Device Name Intel(R) Core(TM) i7-4750HQ CPU @ 2.00GHz clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU) Success (1) Platform Name Apple Device Name Iris Pro clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR) No devices found in platform clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM) <checkNullCtxFromType:2073: create context from type CL_DEVICE_TYPE_CUSTOM : error -30> clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL) Success (2) Platform Name Apple Device Name Iris Pro Device Name Intel(R) Core(TM) i7-4750HQ CPU @ 2.00GHz

Just thinking about it I used lua from brew rather than the luajit from torch, could that be the issue?

Sam

hughperkins commented 8 years ago

Hmmmm, I test using luajit. It should work using lua, and if it doesnt I need to fix that. However, I havent actually tested it as such recently/ever, and you can probably fix your current issue by using luajit from torch,rather than lua from brew.

(Update: note that on Linux, running the cltorch tests using lua works ok, so seems to be Mac-related somehow. Supporting Mac is a bit tricky for me. Since I dont have one :-) How acceptable is it for you to use luajit rather than lua?)

dylib commented 7 years ago

I just wanted to chime in here regarding a similar issue. The error seems to specifically be:

"dyld: lazy symbol binding failed: Symbol not found: _lua_pcall"

@hughperkins: Using the luajit version does appear to work as you've suggested.

The GPU performance does not seem to be a huge improvement over the CPU for whatever reason. I'm using dual AMD Radeon HD - FirePro D700, and have tried using --gpu 0, --gpu 1, --opencl, and they all seem to be about the same. If you have any suggestions on how to increase performance out the GPU I'm eager to know — thanks.

ekkus93 commented 7 years ago

I was having this issue on my Mac when I built cltorch with lua 5.2 using the following command: TORCH_LUA_VERSION=LUA52 ./install.sh

When I rebuilt it with lua 5.1, the error went away. I'm not sure why though. If you're having problems, try doing: cd ~/torch-cl ./clean.sh TORCH_LUA_VERSION=LUA51 ./install.sh