question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error while running Tvm on Android with OpenCL

See original GitHub issue

@tqchen

Am trying to run android rpc test script (https://github.com/dmlc/tvm/tree/master/apps/android_rpc) “Build with OpenCL” with my following environment with OpenCL enable in make/config.mk.

Environment : Laptop:: Description: Ubuntu 17.10 Release: 17.10 Target:: Huawei Mate 9 Mali G71 GPU

Error :

xxxxxxx@Dayananda:~/shared-windows7/nnvm/nnvm/tvm/apps/android_rpc$ python tests/android_rpc_test.py 
TVM: Initializing cython mode...
[16:03:39] src/runtime/opencl/opencl_device_api.cc:190: No OpenCL platform matched given existing options ...
Traceback (most recent call last):
  File "tests/android_rpc_test.py", line 75, in <module>
    test_rpc_module()
  File "tests/android_rpc_test.py", line 34, in test_rpc_module
    f = tvm.build(s, [A, B], "opencl", target_host=target, name="myadd")
  File "/home/xxxxxxx/.local/lib/python3.6/site-packages/tvm-0.2.0-py3.6-linux-x86_64.egg/tvm/build_module.py", line 449, in build
    mdev = codegen.build_module(fdevice, str(target_device))
  File "/home/xxxxxxx/.local/lib/python3.6/site-packages/tvm-0.2.0-py3.6-linux-x86_64.egg/tvm/codegen.py", line 20, in build_module
    return _Build(lowered_func, target)
  File "/home/xxxxxxx/.local/lib/python3.6/site-packages/tvm-0.2.0-py3.6-linux-x86_64.egg/tvm/_ffi/function.py", line 255, in my_api_func
    return flocal(*args)
  File "tvm/_ffi/_cython/./function.pxi", line 264, in core.FunctionBase.__call__
  File "tvm/_ffi/_cython/./function.pxi", line 213, in core.FuncCall
  File "tvm/_ffi/_cython/./function.pxi", line 205, in core.FuncCall3
  File "tvm/_ffi/_cython/./base.pxi", line 131, in core.CALL
tvm._ffi.base.TVMError: b'[16:03:39] src/runtime/opencl/opencl_module.cc:94: Check failed: workspace_->context != nullptr No OpenCL device

Note : For compilation success purpose libOpenCl.so is pointing with “/usr/lib/x86_64-linux-gnu/libOpenCL.so.1”

Questions::

  1. How to resolve this problem?
  2. “Build with OpenCL” tutorial i couldn’t find any much information related to OpenCl installation??
  3. Why tvm.build is depending on host libOpenCl.so?

tvm.build with CPU is success but tvm.build with OPENCL is failure.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
li3cmzcommented, Aug 26, 2018

Please I don’t know how to link the opencl library for RK3288. “The cross compiled library: runs on your phone, this must be built with USE_OPENCL=1, and link to proper opencl library on your phone” Help

0reactions
siju-samuelcommented, Mar 1, 2018

Do we need to add topi compute and schedule in CPP to support for running in Android device with OpenCL? or the ones with python alone can work fine?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error while running Tvm on Android with OpenCL #921 - GitHub
TVM uses a cross compiler. For android, you will need to download specific OpenCL library from the vendor or find it in your...
Read more >
Error while enabling OpenCL on TVM Android Demo Application
Dear All , I am trying to run TVM compiled GPU models on Android Device.
Read more >
[Apache TVM Discuss] [Questions] Check failed: ret == 0
I need to implement opencl operator resize, I modified the function check_target() in tests/python/topi/python/test_topi_image.py,The ...
Read more >
apps/android_rpc - tvm - Git at Google
This will compile TVM IR to shared libraries (CPU, OpenCL and Vulkan) and run vector addition on your Android device. To verify compiled...
Read more >
Build with different EPs | onnxruntime
Learm how to build ONNX Runtime from source for different execution providers.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found