Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Improve diagnose.py, adding build features info and binary library pa…
Browse files Browse the repository at this point in the history
…th. (#15499)
  • Loading branch information
larroy authored and szha committed Jul 14, 2019
1 parent d677d1a commit b25ec8e
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions tools/diagnose.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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):
Expand Down

0 comments on commit b25ec8e

Please sign in to comment.