Installation

Taichi can be easily installed via pip:

python3 -m pip install taichi

Note

Currently, Taichi only supports Python 3.6/3.7/3.8 (64-bit).

  • On Ubuntu 19.04+, please execute sudo apt install libtinfo5.
  • On Arch Linux, please execute yay -S ncurses5-compat-libs.
  • On Fedora and RHEL, please execute sudo yum install ncurses-compat-libs.
  • On Windows, please install Microsoft Visual C++ Redistributable if you haven’t.

Troubleshooting

Windows issues

Python issues

  • If pip complains that it could not find a satisfying package, i.e.,

    ERROR: Could not find a version that satisfies the requirement taichi (from versions: none)
    ERROR: No matching distribution found for taichi
    
    • Make sure you’re using Python version 3.6/3.7/3.8:

      python3 -c "print(__import__('sys').version[:3])"
      # 3.6, 3.7 or 3.8
      
    • Make sure your Python executable is 64-bit:

      python3 -c "print(__import__('platform').architecture()[0])"
      # 64bit
      
  • If pip keeps warning about HTTP error:

    • Use a mirror repo for better connectivity if you live in China :)

      python3 -c pip install -i https://pypi.tuna.tsinghua.edu.cn/simple taichi
      
    • Sometimes pip could fail when its version is not the latest. Upgrade it and try installing taichi again:

      python3 -c pip install --upgrade pip
      python3 -c pip install taichi
      
  • If python shows an error message like:

    AttributeError: module 'taichi' has no attribute 'init'
    

    This is likely because you have put a file named taichi.py in the same directory where the main program is executed. Python will consider this file as a module named taichi, hiding our real taichi module.

    • Possible solution: don’t name your file as taichi.py, rename it to any other name, like hello_taichi.py. Also, double-check you don’t have other files named taichi.py and directories named taichi/ in the current directory.

CUDA issues

  • If Taichi crashes with the following messages:

    [Taichi] mode=release
    [Taichi] version 0.6.0, supported archs: [cpu, cuda, opengl], commit 14094f25, python 3.8.2
    [W 05/14/20 10:46:49.549] [cuda_driver.h:call_with_warning@60] CUDA Error CUDA_ERROR_INVALID_DEVICE: invalid device ordinal while calling mem_advise (cuMemAdvise)
    [E 05/14/20 10:46:49.911] Received signal 7 (Bus error)
    

    This might be due to the fact that your NVIDIA GPU is pre-Pascal and has limited support for Unified Memory.

    • Possible solution: add export TI_USE_UNIFIED_MEMORY=0 to your ~/.bashrc. This disables unified memory usage in CUDA backend.
  • If you find other CUDA problems:

    • Possible solution: add export TI_ENABLE_CUDA=0 to your ~/.bashrc. This disables the CUDA backend completely and Taichi will fall back on other GPU backends such as OpenGL.

OpenGL issues

  • If Taichi crashes with a stack backtrace containing a line of glfwCreateWindow (see #958):

    [Taichi] mode=release
    [E 05/12/20 18.25:00.129] Received signal 11 (Segmentation Fault)
    ***********************************
    * Taichi Compiler Stack Traceback *
    ***********************************
    
    ... (many lines, omitted)
    
    /lib/python3.8/site-packages/taichi/core/../lib/taichi_core.so: _glfwPlatformCreateWindow
    /lib/python3.8/site-packages/taichi/core/../lib/taichi_core.so: glfwCreateWindow
    /lib/python3.8/site-packages/taichi/core/../lib/taichi_core.so: taichi::lang::opengl::initialize_opengl(bool)
    
    ... (many lines, omitted)
    

    This is likely because you are running Taichi on a (virtual) machine with an old OpenGL API. Taichi requires OpenGL 4.3+ to work.

    • Possible solution: add export TI_ENABLE_OPENGL=0 to your ~/.bashrc even if you initialize Taichi with other backends than OpenGL. This disables the OpenGL backend detection to avoid incompatibilities.

Linux issues

  • If Taichi crashes and reports libtinfo.so.5 not found:

    • On Ubuntu, execute sudo apt install libtinfo5.

    • On Arch Linux, first edit /etc/pacman.conf, and append these lines:

      [archlinuxcn]
      Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch
      

      Then execute sudo pacman -Syy ncurses5-compat-libs.

    • On Fedora and RHEL, execute sudo yum install ncurses-compat-libs.

  • If Taichi crashes and reports /usr/lib/libstdc++.so.6: version `CXXABI_1.3.11' not found:

    You might be using Ubuntu 16.04, please try the solution in this thread:

    sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
    sudo apt-get update
    sudo apt-get install libstdc++6
    

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!