areusch commented on a change in pull request #5484:
URL: https://github.com/apache/incubator-tvm/pull/5484#discussion_r419717711



##########
File path: python/tvm/_ffi/base.py
##########
@@ -48,8 +48,11 @@ def _load_lib():
     """Load libary by searching possible path."""
     lib_path = libinfo.find_lib_path()
     lib = ctypes.CDLL(lib_path[0], ctypes.RTLD_GLOBAL)
-    # DMatrix functions
     lib.TVMGetLastError.restype = ctypes.c_char_p
+    # Put the libpath to LD_LIBRARY_PATH
+    # will be useful for pipe session to find libtvm
+    os.environ["LD_LIBRARY_PATH"] = "%s:%s" % (

Review comment:
       correct me if i'm wrong, doesn't this mean that any python script that 
imports tvm and then launches a subprocess will launch a subprocess with 
LD_LIBRARY_PATH set? we really don't want that. if the subprocess depends on 
any library that happens to be in the same dir as libtvm.so, it will wind up 
loading that instead of the system-installed copy. this is a really subtle bug 
that is very difficult to track down.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to