How to build Apache TVM from source with uv (2025/12)
Previous post: How to build Apache TVM from source with uv (2025/09)
What I changed from the previous post is setting CMAKE_BUILD_TYPE=RelWithDebInfo, which provides much better error logs.
uv python install 3.12
uv venv --python 3.12
source .venv/bin/activate
uv pip install ninja
git clone --recursive https://github.com/apache/tvm.git
cd tvm
uv pip install -e . --config-setting editable-mode=compat --config-settings=cmake.args="-G Ninja; -DCMAKE_BUILD_TYPE=RelWithDebInfo; -DUSE_MLIR=ON; -DUSE_CPP_RPC=ON; -DUSE_LLVM=llvm-config; -DUSE_CUDA=ON; -DUSE_TENSORRT_CODEGEN=ON;"
python -c "import tvm; print(tvm.__version__)"
If you want to build wheel, run
uv build --wheel . --config-settings=cmake.args="-G Ninja; -DCMAKE_BUILD_TYPE=RelWithDebInfo; -DUSE_MLIR=ON; -DUSE_CPP_RPC=ON; -DUSE_LLVM=llvm-config; -DUSE_CUDA=ON; -DUSE_TENSORRT_CODEGEN=ON;"