tvm ubuntu20.04安装
时间: 2023-11-03 19:06:54 浏览: 127
安装 TVM 在 Ubuntu 20.04 上的步骤如下:
1. 安装依赖项:
```
sudo apt-get update
sudo apt-get install -y python3 python3-dev python3-setuptools gcc libtinfo-dev zlib1g-dev build-essential cmake libedit-dev libxml2-dev
```
2. 克隆 TVM 仓库并初始化子模块:
```
git clone --recursive https://github.com/apache/tvm
cd tvm
git submodule update --init --recursive
```
3. 设置环境变量:
```
export TVM_HOME=`pwd`
export PYTHONPATH=$TVM_HOME/python:$TVM_HOME/topi/python:$PYTHONPATH
```
4. 编译 TVM:
```
mkdir build
cp cmake/config.cmake build/
cd build
cmake ..
make -j$(nproc)
```
5. 安装 Python 包:
```
cd ..
pip3 install --user tvm-0.8.dev0-cp38-cp38-linux_x86_64.whl
```
6. 验证安装:
```
python3 -c "import tvm; print(tvm.runtime.enabled('llvm'))"
```
如果输出为 True,则说明安装成功。
阅读全文
相关推荐















