This is an automated email from the ASF dual-hosted git repository.

zhasheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
     new b25ec8e  Improve diagnose.py, adding build features info and binary 
library path. (#15499)
b25ec8e is described below

commit b25ec8efb77462bb7b033ff98dc6558c74b68790
Author: Pedro Larroy <[email protected]>
AuthorDate: Sat Jul 13 22:23:50 2019 -0700

    Improve diagnose.py, adding build features info and binary library path. 
(#15499)
---
 tools/diagnose.py | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/tools/diagnose.py b/tools/diagnose.py
old mode 100644
new mode 100755
index 0f878f9..f3026e6
--- a/tools/diagnose.py
+++ b/tools/diagnose.py
@@ -97,6 +97,11 @@ def check_pip():
     except ImportError:
         print('No corresponding pip install for current python.')
 
+def get_build_features_str():
+    import mxnet.runtime
+    features = mxnet.runtime.Features()
+    return '\n'.join(map(str, list(features.values())))
+
 def check_mxnet():
     print('----------MXNet Info-----------')
     try:
@@ -105,13 +110,20 @@ def check_mxnet():
         mx_dir = os.path.dirname(mxnet.__file__)
         print('Directory    :', mx_dir)
         commit_hash = os.path.join(mx_dir, 'COMMIT_HASH')
-        with open(commit_hash, 'r') as f:
-            ch = f.read().strip()
-            print('Commit Hash   :', ch)
+        if os.path.exists(commit_hash):
+            with open(commit_hash, 'r') as f:
+                ch = f.read().strip()
+                print('Commit Hash   :', ch)
+        else:
+            print('Commit hash file "{}" not found. Not installed from 
pre-built package or built from source.'.format(commit_hash))
+        print('Library      :', mxnet.libinfo.find_lib_path())
+        try:
+            print('Build features:')
+            print(get_build_features_str())
+        except Exception:
+            print('No runtime build feature info available')
     except ImportError:
         print('No MXNet installed.')
-    except IOError:
-        print('Hashtag not found. Not installed from pre-built package.')
     except Exception as e:
         import traceback
         if not isinstance(e, IOError):

Reply via email to