Skip to content

Commit

Permalink
[misc] tell users to check troubleshooting page when error occurred (#…
Browse files Browse the repository at this point in the history
…1127)

* [misc] tell users to check troubleshooting page when error occurred

* [skip ci] fix format server

* [skip ci] enforce code format

Co-authored-by: Taichi Gardener <taichigardener@gmail.com>
  • Loading branch information
archibate and taichi-gardener authored Jun 4, 2020
1 parent 44fe2a2 commit 8c483a4
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 10 deletions.
17 changes: 14 additions & 3 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://aka.ms/vs/16/release/vc_redist.x64.exe>`_.

Python issues
*************

Expand Down Expand Up @@ -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
Expand All @@ -71,7 +76,7 @@ OpenGL issues

- If Taichi crashes with a stack backtrace containing a line of ``glfwCreateWindow`` (see `#958 <https://github.com/taichi-dev/taichi/issues/958>`_):

.. code-block::
.. code-block:: none
[Taichi] mode=release
[E 05/12/20 18.25:00.129] Received signal 11 (Segmentation Fault)
Expand All @@ -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 <https://github.com/taichi-dev/taichi/issues/new?labels=potential+bug&template=bug_report.md>`_ on GitHub. This would help us improve user experiences and compatibility, many thanks!
6 changes: 4 additions & 2 deletions python/taichi/core/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
7 changes: 2 additions & 5 deletions python/taichi/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions taichi/system/traceback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8c483a4

Please sign in to comment.