tvm icon indicating copy to clipboard operation
tvm copied to clipboard

[COMPILER][BUG] Can't cross compile OpenCL target without OpenCL device

Open mnuyens opened this issue 8 years ago • 1 comments

If you enable OpenCL and are running on a device without a gpu (in my case a virtual machine) you can't compile a model for the target tvm.target.intel_graphics, due a check in the opencl_module.cc file.

CHECK(workspace_->context != nullptr) << "No OpenCL device"

I tried disabling that check and it compiles afterwords, but the compiled lib file won't load. I get the following error message.

Check failed: f != nullptr Loader of (module.loadbinary_) is not presented.

I rebuilt tvm with OpenCL disabled and compiled with the same target, and the code that was generated worked correctly, but from my understanding I need to build the runtime with OpenCL enabled. The runtime and the compiler should be built using the same configuration but in this case I'm unable to do so. Also if the compiler works fine compiling for OpenCL targets without OpenCL enabled, why is the code different with OpenCL enabled?

mnuyens avatar Aug 17 '18 17:08 mnuyens

Thanks for bringing this up, please open up a thread in https://discuss.tvm.ai/

tqchen avatar Aug 17 '18 21:08 tqchen