Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on OSX in OpenCL backend #60

Closed
jramapuram opened this issue Mar 24, 2016 · 15 comments
Closed

Error on OSX in OpenCL backend #60

jramapuram opened this issue Mar 24, 2016 · 15 comments

Comments

@jramapuram
Copy link
Member

Evaluating OpenCL Backend...
There are 2 OpenCL compute devices
ArrayFire v3.4.0 (OpenCL, 64-bit Mac OSX, build 2ecff98)
[0] APPLE   : GeForce GT 750M, 2048 MB
-1- APPLE   : Iris Pro, 1536 MB
Create a 10-by-10 matrix of random floats on the compute device
No Name Array
[10 10 1 1]
Process 32181 stopped
* thread #1: tid = 0x1ba85f, 0x00007fff8798ef06 libsystem_kernel.dylib`__pthread_kill + 10, queue = 'opencl_runtime', stop reason = signal SIGABRT
    frame #0: 0x00007fff8798ef06 libsystem_kernel.dylib`__pthread_kill + 10
libsystem_kernel.dylib`__pthread_kill:
->  0x7fff8798ef06 <+10>: jae    0x7fff8798ef10            ; <+20>
    0x7fff8798ef08 <+12>: movq   %rax, %rdi
    0x7fff8798ef0b <+15>: jmp    0x7fff879897cd            ; cerror_nocancel
    0x7fff8798ef10 <+20>: retq
(lldb) bt
* thread #1: tid = 0x1ba85f, 0x00007fff8798ef06 libsystem_kernel.dylib`__pthread_kill + 10, queue = 'opencl_runtime', stop reason = signal SIGABRT
  * frame #0: 0x00007fff8798ef06 libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fff87c844ec libsystem_pthread.dylib`pthread_kill + 90
    frame #2: 0x00007fff9ae886e7 libsystem_c.dylib`abort + 129
    frame #3: 0x00007fff95c07e5c libGPUSupportMercury.dylib`gpusGenerateCrashLog + 158
    frame #4: 0x00007fff93fa4dc7 GeForceGLDriver`___lldb_unnamed_function6443$$GeForceGLDriver + 9
    frame #5: 0x00007fff95c08818 libGPUSupportMercury.dylib`gpusQueueSubmitDataBuffers + 162
    frame #6: 0x00007fff9797b026 libclh.dylib`channelFlushUnitFlushGLK + 278
    frame #7: 0x00007fff9791346d libclh.dylib`channelFlush_UnderLock + 317
    frame #8: 0x00007fff979132fe libclh.dylib`channelEndPushInternal_UnderLock + 526
    frame #9: 0x00007fff979130be libclh.dylib`channelEndPushInternal + 14
    frame #10: 0x00007fff9791a3f8 libclh.dylib`ctxMarkerPushAwakenInternal + 360
    frame #11: 0x00007fff9791a73d libclh.dylib`ctxMarkerWait + 77
    frame #12: 0x00007fff978567e2 libclh.dylib`cuiCtxSynchronize + 258
    frame #13: 0x00007fff94088af6 GeForceGLDriver`gldFinishQueue + 253
    frame #14: 0x00007fff8685bb86 OpenCL`___lldb_unnamed_function16$$OpenCL + 78
    frame #15: 0x00007fff8685c058 OpenCL`___lldb_unnamed_function17$$OpenCL + 1114
    frame #16: 0x00007fff8687a358 OpenCL`___lldb_unnamed_function440$$OpenCL + 95
    frame #17: 0x00007fff8687d9b8 OpenCL`___lldb_unnamed_function475$$OpenCL + 286
    frame #18: 0x00007fff8557540b libdispatch.dylib`_dispatch_client_callout + 8
    frame #19: 0x00007fff85583a9a libdispatch.dylib`_dispatch_barrier_sync_f_slow + 856
    frame #20: 0x00007fff8687d834 OpenCL`___lldb_unnamed_function474$$OpenCL + 127
    frame #21: 0x00007fff86879430 OpenCL`___lldb_unnamed_function426$$OpenCL + 436
    frame #22: 0x00007fff8686e777 OpenCL`clEnqueueReadBuffer + 817
    frame #23: 0x0000000104315cdd libafopencl.3.dylib`void opencl::copyData<float>(float*, opencl::Array<float> const&) + 573
    frame #24: 0x0000000105a6b595 libafopencl.3.dylib`af_get_data_ptr + 149
    frame #25: 0x0000000105c9dd81 libafopencl.3.dylib`void print<float>(char const*, void*, int, std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool) + 1025
    frame #26: 0x0000000105c9d543 libafopencl.3.dylib`af_print_array + 227
    frame #27: 0x0000000100003e11 unified`arrayfire::array::print(input=0x00007fff5fbfecb8) + 33 at array.rs:323
    frame #28: 0x000000010000166c unified`unified::test_backend + 1004 at unified.rs:18
    frame #29: 0x000000010000263f unified`unified::main + 3599 at unified.rs:52
    frame #30: 0x000000010000cca3 unified`sys_common::unwind::try::try_fn::h14566978960817497624 + 35
    frame #31: 0x000000010000b659 unified`__rust_try + 9
    frame #32: 0x000000010000cb46 unified`rt::lang_start::h8931373347d15a278Vx + 566
    frame #33: 0x0000000100003b7a unified`main + 42
    frame #34: 0x00007fff96df45ad libdyld.dylib`start + 1
@jramapuram
Copy link
Member Author

(same issue with 3.3.0 , just pulled latest from devel on af mainline to make sure there wasen't a bugfix along the way)

@jramapuram
Copy link
Member Author

@pavanky : Is there something in the mainline that could be causing this?

@pavanky
Copy link
Member

pavanky commented Mar 24, 2016

@jramapuram can you check the C++ version and see what happens ?

@jramapuram
Copy link
Member Author

Yup, same issue. Changing it to use the Iris Pro though enables things to work.
Looks like an issue when using the CUDA OpenCL backend.

Some related info:

➜  unified git:(devel) gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.4.0
Thread model: posix
➜  unified git:(devel) nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2015 NVIDIA Corporation
Built on Thu_Sep_24_00:26:39_CDT_2015
Cuda compilation tools, release 7.5, V7.5.19
➜  unified git:(devel) lldb ./basic_unified
(lldb) target create "./basic_unified"
Current executable set to './basic_unified' (x86_64).
(lldb) process launch

[... working CPU & CUDA tests ... ] 

Trying OpenCL Backend
ArrayFire v3.4.0 (OpenCL, 64-bit Mac OSX, build 2ecff98)
[0] APPLE   : GeForce GT 750M, 2048 MB
-1- APPLE   : Iris Pro, 1536 MB
A
[10 10 1 1]
Process 35592 stopped
* thread #1: tid = 0x1c401c, 0x00007fff8798ef06 libsystem_kernel.dylib`__pthread_kill + 10, queue = 'opencl_runtime', stop reason = signal SIGABRT
    frame #0: 0x00007fff8798ef06 libsystem_kernel.dylib`__pthread_kill + 10
libsystem_kernel.dylib`__pthread_kill:
->  0x7fff8798ef06 <+10>: jae    0x7fff8798ef10            ; <+20>
    0x7fff8798ef08 <+12>: movq   %rax, %rdi
    0x7fff8798ef0b <+15>: jmp    0x7fff879897cd            ; cerror_nocancel
    0x7fff8798ef10 <+20>: retq
(lldb) bt
* thread #1: tid = 0x1c401c, 0x00007fff8798ef06 libsystem_kernel.dylib`__pthread_kill + 10, queue = 'opencl_runtime', stop reason = signal SIGABRT
  * frame #0: 0x00007fff8798ef06 libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fff87c844ec libsystem_pthread.dylib`pthread_kill + 90
    frame #2: 0x00007fff9ae886e7 libsystem_c.dylib`abort + 129
    frame #3: 0x00007fff95c07e5c libGPUSupportMercury.dylib`gpusGenerateCrashLog + 158
    frame #4: 0x00007fff93fa4dc7 GeForceGLDriver`___lldb_unnamed_function6443$$GeForceGLDriver + 9
    frame #5: 0x00007fff95c08818 libGPUSupportMercury.dylib`gpusQueueSubmitDataBuffers + 162
    frame #6: 0x00007fff9797b026 libclh.dylib`channelFlushUnitFlushGLK + 278
    frame #7: 0x00007fff9791346d libclh.dylib`channelFlush_UnderLock + 317
    frame #8: 0x00007fff979132fe libclh.dylib`channelEndPushInternal_UnderLock + 526
    frame #9: 0x00007fff979130be libclh.dylib`channelEndPushInternal + 14
    frame #10: 0x00007fff9791a3f8 libclh.dylib`ctxMarkerPushAwakenInternal + 360
    frame #11: 0x00007fff9791a73d libclh.dylib`ctxMarkerWait + 77
    frame #12: 0x00007fff978567e2 libclh.dylib`cuiCtxSynchronize + 258
    frame #13: 0x00007fff94088af6 GeForceGLDriver`gldFinishQueue + 253
    frame #14: 0x00007fff8685bb86 OpenCL`___lldb_unnamed_function16$$OpenCL + 78
    frame #15: 0x00007fff8685c058 OpenCL`___lldb_unnamed_function17$$OpenCL + 1114
    frame #16: 0x00007fff8687a358 OpenCL`___lldb_unnamed_function440$$OpenCL + 95
    frame #17: 0x00007fff8687d9b8 OpenCL`___lldb_unnamed_function475$$OpenCL + 286
    frame #18: 0x00007fff8557540b libdispatch.dylib`_dispatch_client_callout + 8
    frame #19: 0x00007fff85583a9a libdispatch.dylib`_dispatch_barrier_sync_f_slow + 856
    frame #20: 0x00007fff8687d834 OpenCL`___lldb_unnamed_function474$$OpenCL + 127
    frame #21: 0x00007fff86879430 OpenCL`___lldb_unnamed_function426$$OpenCL + 436
    frame #22: 0x00007fff8686e777 OpenCL`clEnqueueReadBuffer + 817
    frame #23: 0x00000001050fecdd libafopencl.3.dylib`void opencl::copyData<float>(float*, opencl::Array<float> const&) + 573
    frame #24: 0x0000000106854595 libafopencl.3.dylib`af_get_data_ptr + 149
    frame #25: 0x0000000106a86d81 libafopencl.3.dylib`void print<float>(char const*, void*, int, std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool) + 1025
    frame #26: 0x0000000106a9122a libafopencl.3.dylib`af_print_array_gen + 346
    frame #27: 0x00000001002388dd libaf.3.dylib`af::print(char const*, af::array const&) + 61
    frame #28: 0x00000001000019fb basic_unified`testBackend() + 91
    frame #29: 0x0000000100001af6 basic_unified`main + 150
    frame #30: 0x00007fff96df45ad libdyld.dylib`start + 1
    frame #31: 0x00007fff96df45ad libdyld.dylib`start + 1

@pavanky
Copy link
Member

pavanky commented Mar 25, 2016

Did you build from source or are you using an installer?

@jramapuram
Copy link
Member Author

@pavanky : built from source with the standard: cmake .. && make && sudo make install

@9prady9
Copy link
Member

9prady9 commented Apr 25, 2016

Is there a issue on upstream regarding this ?

@jramapuram You said Iris Pro device works fine for you ? It is not working for me if i create an Array using Array::new. However, if the Array is created using functions such as randu, it is working fine - pi example.

@jramapuram
Copy link
Member Author

@9prady9 : Not sure, thats why I referenced @pavanky . It might be a OSX only issue. But yes, OpenCL on Iris works fine, just not CUDA

@9prady9
Copy link
Member

9prady9 commented May 20, 2016

@jramapuram do we have any code stub that can reproduce this error on Mac OSX ? or All examples are now running fine on our build machine now.

@jramapuram
Copy link
Member Author

Just tried this on latest AF devel @9prady9 . Still happening. What GPU is on your Mac build machine? My MBP has a Nvidia GT 750M running CUDA 7.5 & Apple LLVM version 7.0.2 (clang-700.1.81)

➜  build git:(devel) ✗ lldb ./test/gfor_opencl
(lldb) target create "./test/gfor_opencl"
Current executable set to './test/gfor_opencl' (x86_64).
(lldb) r
Process 10881 launched: './test/gfor_opencl' (x86_64)
Running main() from gtest_main.cc
[==========] Running 18 tests from 3 test cases.
[----------] Global test environment set-up.
[----------] 8 tests from GFOR
[ RUN      ] GFOR.Assign_Scalar_Span
Process 10881 stopped
* thread #6: tid = 0x16609d, 0x00007fff95e392d6 libclh.dylib`cuiModuleUnloadEx + 102, queue = 'opencl_runtime', stop reason = EXC_BAD_ACCESS (code=1, address=0x10)
    frame #0: 0x00007fff95e392d6 libclh.dylib`cuiModuleUnloadEx + 102
libclh.dylib`cuiModuleUnloadEx:
->  0x7fff95e392d6 <+102>: movq   0x10(%r15), %rdi
    0x7fff95e392da <+106>: addq   $0x260, %rdi
    0x7fff95e392e1 <+113>: xorl   %esi, %esi
    0x7fff95e392e3 <+115>: xorl   %edx, %edx
(lldb) bt
* thread #6: tid = 0x16609d, 0x00007fff95e392d6 libclh.dylib`cuiModuleUnloadEx + 102, queue = 'opencl_runtime', stop reason = EXC_BAD_ACCESS (code=1, address=0x10)
  * frame #0: 0x00007fff95e392d6 libclh.dylib`cuiModuleUnloadEx + 102
    frame #1: 0x00007fff95e37f2e libclh.dylib`cuiModuleUnload + 14
    frame #2: 0x00007fff86d693dd GeForceGLDriver`___lldb_unnamed_function11029$$GeForceGLDriver + 461
    frame #3: 0x00007fff86d6b8a1 GeForceGLDriver`gldExecuteKernel + 379
    frame #4: 0x00007fff994d74a7 OpenCL`___lldb_unnamed_function22$$OpenCL + 737
    frame #5: 0x00007fff994f40da OpenCL`___lldb_unnamed_function438$$OpenCL + 419
    frame #6: 0x00007fff994f79cc OpenCL`___lldb_unnamed_function475$$OpenCL + 306
    frame #7: 0x00007fff919cb40b libdispatch.dylib`_dispatch_client_callout + 8
    frame #8: 0x00007fff919d003b libdispatch.dylib`_dispatch_queue_drain + 754
    frame #9: 0x00007fff919d6707 libdispatch.dylib`_dispatch_queue_invoke + 549
    frame #10: 0x00007fff919cb40b libdispatch.dylib`_dispatch_client_callout + 8
    frame #11: 0x00007fff919cf29b libdispatch.dylib`_dispatch_root_queue_drain + 1890
    frame #12: 0x00007fff919ceb00 libdispatch.dylib`_dispatch_worker_thread3 + 91
    frame #13: 0x00007fff919c24de libsystem_pthread.dylib`_pthread_wqthread + 1129
    frame #14: 0x00007fff919c0341 libsystem_pthread.dylib`start_wqthread + 13

@9prady9
Copy link
Member

9prady9 commented May 20, 2016

Ok, so the problem is not yet solved in upstream. Just wanted to check if latest devel solves it. I would have to check with @shehzan10 about what CUDA GPU do we have on OSX setup.

@9prady9
Copy link
Member

9prady9 commented Sep 14, 2016

@jramapuram Can you please check if this is resolved on latest devel or 3.4.0 release (ArrayFire not rust wrapper).

@jramapuram
Copy link
Member Author

Same issue @9prady9

(lldb) r
Process 15137 launched: './test/gfor_opencl' (x86_64)
Running main() from gtest_main.cc
[==========] Running 18 tests from 3 test cases.
[----------] Global test environment set-up.
[----------] 8 tests from GFOR
[ RUN      ] GFOR.Assign_Scalar_Span
Process 15137 stopped
* thread #4: tid = 0x5d0b9a, 0x00007fff9940e2d6 libclh.dylib`cuiModuleUnloadEx + 102, queue = 'opencl_runtime', stop reason = EXC_BAD_ACCESS (code=1, address=0x10)
    frame #0: 0x00007fff9940e2d6 libclh.dylib`cuiModuleUnloadEx + 102
libclh.dylib`cuiModuleUnloadEx:
->  0x7fff9940e2d6 <+102>: movq   0x10(%r15), %rdi
    0x7fff9940e2da <+106>: addq   $0x260, %rdi
    0x7fff9940e2e1 <+113>: xorl   %esi, %esi
    0x7fff9940e2e3 <+115>: xorl   %edx, %edx
(lldb) bt
* thread #4: tid = 0x5d0b9a, 0x00007fff9940e2d6 libclh.dylib`cuiModuleUnloadEx + 102, queue = 'opencl_runtime', stop reason = EXC_BAD_ACCESS (code=1, address=0x10)
  * frame #0: 0x00007fff9940e2d6 libclh.dylib`cuiModuleUnloadEx + 102
    frame #1: 0x00007fff9940cf2e libclh.dylib`cuiModuleUnload + 14
    frame #2: 0x00007fff9b9d13dd GeForceGLDriver`___lldb_unnamed_function11029$$GeForceGLDriver + 461
    frame #3: 0x00007fff9b9d38a1 GeForceGLDriver`gldExecuteKernel + 379
    frame #4: 0x00007fff975044a7 OpenCL`___lldb_unnamed_function22$$OpenCL + 737
    frame #5: 0x00007fff975210da OpenCL`___lldb_unnamed_function438$$OpenCL + 419
    frame #6: 0x00007fff975249cc OpenCL`___lldb_unnamed_function475$$OpenCL + 306
    frame #7: 0x00007fff9539740b libdispatch.dylib`_dispatch_client_callout + 8
    frame #8: 0x00007fff9539c03b libdispatch.dylib`_dispatch_queue_drain + 754
    frame #9: 0x00007fff953a2707 libdispatch.dylib`_dispatch_queue_invoke + 549
    frame #10: 0x00007fff9539740b libdispatch.dylib`_dispatch_client_callout + 8
    frame #11: 0x00007fff9539b29b libdispatch.dylib`_dispatch_root_queue_drain + 1890
    frame #12: 0x00007fff9539ab00 libdispatch.dylib`_dispatch_worker_thread3 + 91
    frame #13: 0x00007fff91b714de libsystem_pthread.dylib`_pthread_wqthread + 1129
    frame #14: 0x00007fff91b6f341 libsystem_pthread.dylib`start_wqthread + 13
(lldb)

@9prady9
Copy link
Member

9prady9 commented Jan 10, 2017

@jramapuram Can you please check if this is still an issue with latest CUDA and ArrayFire 3.4.2.

@9prady9 9prady9 modified the milestone: 3.5.0 Jan 11, 2017
@9prady9 9prady9 changed the title OSX Error on 3.3.0 w/ OpenCL backend Error on OSX in OpenCL backend Jan 30, 2017
@9prady9 9prady9 added the OSX label Jan 30, 2017
@9prady9
Copy link
Member

9prady9 commented Feb 26, 2017

@mlloreda Do we have a OSX machine or VM with CUDA GPU on it ?

@9prady9 9prady9 added this to Bug Fix TO DO in arrayfire-rust board Jun 9, 2017
@9prady9 9prady9 moved this from Bug Fix TO DO to Upstream Issues in arrayfire-rust board Jun 9, 2017
@9prady9 9prady9 modified the milestone: 3.5.0 Jun 28, 2017
@9prady9 9prady9 closed this as completed Jun 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
arrayfire-rust board
Upstream Issues
Development

No branches or pull requests

3 participants