diff --git a/docs/install.rst b/docs/install.rst index 8fae688eb3b50..76be6e69aafa3 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -20,6 +20,11 @@ Taichi can be easily installed via ``pip``: Troubleshooting --------------- +Windows issues +************** + +- If Taichi crashes and reports ``ImportError`` on Windows: Please consider installing `Microsoft Visual C++ Redistributable `_. + Python issues ************* @@ -49,7 +54,7 @@ CUDA issues - If Taichi crashes with the following messages: - .. code-block:: + .. code-block:: none [Taichi] mode=release [Taichi] version 0.6.0, supported archs: [cpu, cuda, opengl], commit 14094f25, python 3.8.2 @@ -71,7 +76,7 @@ OpenGL issues - If Taichi crashes with a stack backtrace containing a line of ``glfwCreateWindow`` (see `#958 `_): - .. code-block:: + .. code-block:: none [Taichi] mode=release [E 05/12/20 18.25:00.129] Received signal 11 (Segmentation Fault) @@ -95,4 +100,10 @@ OpenGL issues Linux issues ************ -- If Taichi crashes and reports ``libtinfo.so.5 not found``: Please install ``libtinfo5`` on Ubuntu or ``ncurses5-compat-libs`` (AUR) on Arch Linux. +- If Taichi crashes and reports ``libtinfo.so.5 not found``: Please install ``libtinfo5`` for Ubuntu or ``ncurses5-compat-libs`` (AUR) for Arch Linux. + + +Other issues +************ + +- If none of those above address your problem, please report this by `opening an issue `_ on GitHub. This would help us improve user experiences and compatibility, many thanks! diff --git a/python/taichi/core/util.py b/python/taichi/core/util.py index 8c97b36b3727d..226a5915f5dc2 100644 --- a/python/taichi/core/util.py +++ b/python/taichi/core/util.py @@ -36,8 +36,10 @@ def import_ti_core(tmp_dir=None): except Exception as e: if isinstance(e, ImportError): print( - "Share object taichi_core import failed. If you are on Windows, please consider installing \"Microsoft Visual C++ Redistributable\" (https://aka.ms/vs/16/release/vc_redist.x64.exe)" - ) + Fore.YELLOW + "Share object taichi_core import failed, " + "check this page for possible solutions:\n" + "https://taichi.readthedocs.io/en/stable/install.html#troubleshooting" + + Fore.RESET) raise e ti_core = core if get_os_name() != 'win': diff --git a/python/taichi/main.py b/python/taichi/main.py index db774f292e772..6b167f5276819 100644 --- a/python/taichi/main.py +++ b/python/taichi/main.py @@ -403,11 +403,8 @@ def format(self, arguments: list = sys.argv[2:]): """Reformat modified source files""" parser = argparse.ArgumentParser(description=f"{self.format.__doc__}") parser.add_argument( - '-d', - '--diff', - required=False, - default=None, - dest='diff', + 'diff', + nargs='?', type=str, help="A commit hash that git can use to compare diff with") args = parser.parse_args(arguments) diff --git a/taichi/system/traceback.cpp b/taichi/system/traceback.cpp index 09b3f21c6d593..b36cb19690016 100644 --- a/taichi/system/traceback.cpp +++ b/taichi/system/traceback.cpp @@ -353,6 +353,11 @@ TI_EXPORT void print_traceback() { } std::free(strings); #endif + + fmt::print( + fg(fmt::color::orange), + "\nInternal Error occurred, check this page for possible solutions:\n" + "https://taichi.readthedocs.io/en/stable/install.html#troubleshooting\n"); } TI_NAMESPACE_END