From 80d3855fee8b1b4bb3e9131cd7263c1c97298bcd Mon Sep 17 00:00:00 2001 From: chrischoy Date: Thu, 7 Jan 2021 16:53:09 +0900 Subject: [PATCH] diagnostics --- .github/ISSUE_TEMPLATE/bug_report.md | 9 ++-- CHANGELOG.md | 13 ++++++ MinkowskiEngine/__init__.py | 2 + MinkowskiEngine/diagnostics.py | 67 ++++++++++++++++++++++++++++ 4 files changed, 88 insertions(+), 3 deletions(-) create mode 100644 MinkowskiEngine/diagnostics.py diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index dbc87d37..c9788023 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -17,10 +17,13 @@ Steps to reproduce the behavior. Please add a minimally reproducible code here. A clear and concise description of what you expected to happen. **Desktop (please complete the following information):** - - CUDA version: [e.g. 11.1] - - NVIDIA Driver version: [e.g. 450.11] + - OS: [e.g. Ubuntu 18.04] - - Minkowski Engine version [e.g. 0.5.0] + - Please paste the output of the following command + +``` +wget -q https://raw.githubusercontent.com/NVIDIA/MinkowskiEngine/master/MinkowskiEngine/diagnostics.py ; python diagnostics.py +``` **Additional context** Add any other context about the problem here. diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d18b215..cbdee36e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - v0.5 documentation updates - Nonlinear functionals and modules - Warning when using cuda without ME cuda support +- diagnostics test ## [0.5.0a] - 2020-08-05 @@ -14,6 +15,18 @@ - Remove Makefile for installation as pytorch supports multithreaded compilation - GPU coordinate map support +- Coordinate union +- Sparse tensor binary operators +- CUDA 11.1 support +- quantization function updates +- Multi GPU examples +- Pytorch-lightning multi-gpu example +- Transpose pooling layers +- TensorField updates +- Batch-wise decomposition +- inverse_map when sparse() called (slice) +- ChannelwiseConvolution +- TensorField support for non-linearities ## [0.4.3] - 2020-05-29 diff --git a/MinkowskiEngine/__init__.py b/MinkowskiEngine/__init__.py index 94e4846f..03101e26 100644 --- a/MinkowskiEngine/__init__.py +++ b/MinkowskiEngine/__init__.py @@ -48,6 +48,8 @@ # Must be imported first to load all required shared libs import torch +from diagnostics import print_diagnostics + from MinkowskiEngineBackend._C import ( MinkowskiAlgorithm, CoordinateMapKey, diff --git a/MinkowskiEngine/diagnostics.py b/MinkowskiEngine/diagnostics.py new file mode 100644 index 00000000..5a89c2a7 --- /dev/null +++ b/MinkowskiEngine/diagnostics.py @@ -0,0 +1,67 @@ +import platform +import os +import subprocess + + +def parse_nvidia_smi(): + sp = subprocess.Popen( + ["nvidia-smi", "-q"], stdout=subprocess.PIPE, stderr=subprocess.PIPE + ) + out_dict = dict() + for item in sp.communicate()[0].decode("utf-8").split("\n"): + if item.count(":") == 1: + key, val = [i.strip() for i in item.split(":")] + out_dict[key] = val + return out_dict + + +def print_diagnostics(): + print("==========System==========") + print(platform.platform()) + os.system("cat /etc/lsb-release") + + print("==========Pytorch==========") + try: + import torch + + print(torch.__version__) + print(f"torch.cuda.is_available(): {torch.cuda.is_available()}") + except ImportError: + print("torch not installed") + + print("==========NVIDIA-SMI==========") + os.system("which nvidia-smi") + for k, v in parse_nvidia_smi().items(): + if "version" in k.lower(): + print(k, v) + + print("==========NVCC==========") + os.system("which nvcc") + os.system("nvcc --version") + + print("==========CC==========") + CC = "c++" + if "CC" in os.environ or "CXX" in os.environ: + # distutils only checks CC not CXX + if "CXX" in os.environ: + os.environ["CC"] = os.environ["CXX"] + CC = os.environ["CXX"] + else: + CC = os.environ["CC"] + print(f"CC={CC}") + os.system(f"which {CC}") + os.system(f"{CC} --version") + + print("==========MinkowskiEngine==========") + try: + import MinkowskiEngine as ME + + print(ME.__version__) + print(f"MinkowskiEngine compiled with CUDA Support: {ME.is_cuda_available()}") + print(f"NVCC version MinkowskiEngine is compiled: {ME.cuda_version()}") + except ImportError: + print("MinkowskiEngine not installed") + + +if __name__ == "__main__": + print_diagnostics()