Skip to content

Issue running the tutorial #523

@pradyotprakash

Description

@pradyotprakash

I installed tvm as per the instructions in the github repo. When I try to run the tutorial provided here, I get an error when trying to execute the statement,

fadd_cuda = tvm.build(s, [A, B, C], "cuda", target_host="llvm", name="myadd")

I get the following error.

<ipython-input-5-a63326b9397b> in <module>()
      5 s[C].bind(tx, tvm.thread_axis("threadIdx.x"))
      6 
----> 7 fadd_cuda = tvm.build(s, [A, B, C], "cuda", target_host="llvm", name="myadd")

/home/pradyot/.local/lib/python2.7/site-packages/tvm-0.1.0-py2.7-linux-x86_64.egg/tvm/build_module.pyc in build(sch, args, target, target_host, name, binds)
    366     fhost = [ir_pass.LowerIntrin(x, target_host) for x in fhost]
    367     fhost = [ir_pass.CombineContextCall(x) for x in fhost]
--> 368     mhost = codegen.build_module(fhost, target_host)
    369 
    370     if fdevice:

/home/pradyot/.local/lib/python2.7/site-packages/tvm-0.1.0-py2.7-linux-x86_64.egg/tvm/codegen.pyc in build_module(lowered_func, target)
     18         The corressponding module.
     19     """
---> 20     return _Build(lowered_func, target)
     21 
     22 _init_api("tvm.codegen")

/home/pradyot/.local/lib/python2.7/site-packages/tvm-0.1.0-py2.7-linux-x86_64.egg/tvm/_ffi/function.pyc in my_api_func(*args)
    253         The result of the API function call.
    254         """
--> 255         return flocal(*args)
    256     return my_api_func
    257 

/home/pradyot/.local/lib/python2.7/site-packages/tvm-0.1.0-py2.7-linux-x86_64.egg/tvm/_ffi/_ctypes/function.pyc in __call__(self, *args)
    181         check_call(_LIB.TVMFuncCall(
    182             self.handle, values, tcodes, ctypes.c_int(num_args),
--> 183             ctypes.byref(ret_val), ctypes.byref(ret_tcode)))
    184         _ = temp_args
    185         _ = args

/home/pradyot/.local/lib/python2.7/site-packages/tvm-0.1.0-py2.7-linux-x86_64.egg/tvm/_ffi/base.pyc in check_call(ret)
     60     """
     61     if ret != 0:
---> 62         raise TVMError(py_str(_LIB.TVMGetLastError()))
     63 
     64 

TVMError: [20:21:14] src/codegen/codegen.cc:27: Check failed: bf != nullptr Target llvm is not enabled

Stack trace returned 10 entries:
[bt] (0) /home/pradyot/.local/lib/python2.7/site-packages/tvm-0.1.0-py2.7-linux-x86_64.egg/tvm/libtvm.so(_ZN3tvm7codegen5BuildERKNS_5ArrayINS_11LoweredFuncEvEERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0xf99) [0x7fbf49afbc39]
[bt] (1) /home/pradyot/.local/lib/python2.7/site-packages/tvm-0.1.0-py2.7-linux-x86_64.egg/tvm/libtvm.so(+0x316979) [0x7fbf49ab6979]
[bt] (2) /home/pradyot/.local/lib/python2.7/site-packages/tvm-0.1.0-py2.7-linux-x86_64.egg/tvm/libtvm.so(TVMFuncCall+0x5e) [0x7fbf49cb440e]
[bt] (3) /usr/lib/x86_64-linux-gnu/libffi.so.6(ffi_call_unix64+0x4c) [0x7fbf75e85e40]
[bt] (4) /usr/lib/x86_64-linux-gnu/libffi.so.6(ffi_call+0x2eb) [0x7fbf75e858ab]
[bt] (5) /usr/lib/python2.7/lib-dynload/_ctypes.x86_64-linux-gnu.so(_ctypes_callproc+0x48f) [0x7fbf7609d3df]
[bt] (6) /usr/lib/python2.7/lib-dynload/_ctypes.x86_64-linux-gnu.so(+0x11d82) [0x7fbf760a1d82]
[bt] (7) /usr/bin/python(PyObject_Call+0x43) [0x4b0cb3]
[bt] (8) /usr/bin/python(PyEval_EvalFrameEx+0x5faf) [0x4c9faf]
[bt] (9) /usr/bin/python(PyEval_EvalCodeEx+0x255) [0x4c2765]

The stack trace tells me that llvm is not enabled. However, the installation instructions mention that llvm is not needed for CUDA targets. Anyway, I re-build tvm using llvm 4.0.1 but I still get a similar error. What am I doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions