Installing the Stack

On a QB2 from Tenstorrent, this is already done. The venvs are there, the driver is loaded, the firmware is flashed. This chapter is for understanding what exists and where — so you know which environment to activate when, and what to do if something’s missing.

If your QB2 came pre-configured: jump to What You Have below. The install already ran.

Installing the Tenstorrent Software Stack

On a QB2 from Tenstorrent, the stack is already there. This section is for installing on a fresh Ubuntu system, or understanding what the installer put where.

Prerequisites: Ubuntu 24.04 LTS (or 22.04), internet connection, sudo access.

sudo apt update && sudo apt install -y curl jq
curl -fsSL https://github.com/tenstorrent/tt-installer/releases/latest/download/install.sh | /bin/bash -s -- --use-uv

The installer handles drivers, firmware, kernel modules, and all three Python environments. Accept the defaults — they’re right for a QB2.

--use-uv tells the installer to build its Python environment with uv instead of python3 -m venv + pip, which sidesteps the usual host-Python headaches — no ensurepip, no distro Python that’s the wrong version, no --break-system-packages. It’s the “just works” path Tenstorrent is moving toward — tenstorrent.github.io#200 adds it to the official QB2 setup doc, which today still runs the installer without it. Nothing else changes: the venv still lands at ~/.tenstorrent-venv, and the installer fetches uv into ~/.local/bin/ if you don’t already have it. The flag is available in current releases (v2.1.0+) and is what makes --python-version 3.12 work if you ever need to pin an interpreter.

Note the <(…) process substitution rather than -c "$(…)" — with bash -c, a trailing flag becomes $0 and the installer never sees it. If you want a hands-off run, add --mode-non-interactive.

After it finishes, reboot:

sudo reboot

What ends up on your QB2

Path What it is
~/tt-metal/python_env/ TTNN / Direct API venv (pre-installed on QB2)
~/.tenstorrent-venv/ Main Python environment with vLLM and other tools
~/.local/bin/tt-forge Optional Forge container wrapper — only if you opted in; for most users Forge installs as a pip wheel instead
~/.local/bin/tt-smi Hardware monitoring CLI (on PATH)
~/models/ Model weights storage (create it: mkdir -p ~/models)

As of tt-installer v3.2.0, Docker is the default container runtime (Podman is still supported — pass --install-container-runtime=podman). The Metalium container installs by default. Forge is not installed by default — the TT-Forge docs install it as a pip wheel (pip install pjrt-plugin-tt … then tt-forge-install); tt-installer’s --install-forge-container is an optional convenience, not the recommended path. See the TT-Forge chapter for the full install. On a QB2 that shipped from Tenstorrent, the TTNN venv at ~/tt-metal/python_env/ is pre-built. The ~/tt-metal/ directory contains compiled environments — not the tt-metal source code.

tt-installer post-install state showing venvs, tt-smi, and hf on PATH
After tt-installer and reboot — venvs, tt-smi, and hf are ready

What You Have

On a QB2 from Tenstorrent, the stack is pre-installed. Here’s your map:

Component Location When to use it
TTNN venv ~/tt-metal/python_env/ Direct API work, TTNN operations, cookbook examples
vLLM vllm in ~/.tenstorrent-venv/ Serving models via HTTP, OpenAI-compatible API
Forge/XLA tt-forge wrapper in ~/.local/bin/ Compile PyTorch/JAX models via container
tt-smi ~/.local/bin/tt-smi (on PATH) Hardware monitoring, always available
Model storage ~/models/ (convention) Where you put downloaded model weights
Scratch space ~/tt-scratchpad/ Working directory for scripts and experiments

Installing on a fresh Ubuntu machine? tt-installer today uses Docker containers for Metalium and Forge — it creates ~/.tenstorrent-venv with Python tools and installs tt-metalium / tt-forge wrapper scripts in ~/.local/bin/. The paths here reflect a configured QB2; a fresh install may differ slightly.

Create the scratch directory if it doesn’t exist yet:

mkdir -p ~/tt-scratchpad ~/models

The Three Environments, Explained

TTNN (~/tt-metal/python_env/)

This is the workhorse. Use it for direct Python API work — opening devices, running TTNN operations, the cookbook examples in this guide.

source ~/tt-metal/python_env/bin/activate
# prompt changes to (python_env)
python3 -c "import ttnn; print('TTNN ready')"
deactivate

vLLM (in ~/.tenstorrent-venv)

Use this to run a model as a server with an OpenAI-compatible HTTP API. vLLM is available in the main tenstorrent venv:

source ~/.tenstorrent-venv/bin/activate

export TT_METAL_ARCH_NAME=blackhole
export MESH_DEVICE=P300              # one P300 card; P300x2 uses all four chips
export VLLM_RPC_TIMEOUT=900000       # the 10s default is far too short for a first compile

# HF_MODEL must match the --model path. tt-metal's tt_transformers reads it as the
# checkpoint directory, so serving a local path without it fails outright.
export HF_MODEL=~/models/Llama-3.1-8B-Instruct

vllm serve ~/models/Llama-3.1-8B-Instruct --port 8000

Watch the startup log for a line saying the tt platform has been selected. Without it, vLLM is running but cannot see your hardware — see the vLLM on QB2 chapter.

Or use tt-studio for a no-code UI that handles vLLM startup automatically.

TT-Forge (tt-forge wrapper)

tt-forge is a Docker container wrapper installed to ~/.local/bin/ by tt-installer. It runs the TT-XLA/Forge compiler stack without requiring a local Python venv:

# Use the tt-forge wrapper directly
tt-forge --help

For scripting with import forge in Python, use the tt-forge-fe source tree or check docs.tenstorrent.com/tt-forge for current installation instructions.

Confirming Each Environment Works

Run this check sequence:

# TTNN
source ~/tt-metal/python_env/bin/activate
python3 -c "import ttnn; print('✓ TTNN')" && deactivate

# vLLM (in the main tenstorrent venv)
source ~/.tenstorrent-venv/bin/activate
python3 -c "import vllm; print('✓ vLLM')" && deactivate

# Check for the tt-smi binary
which tt-smi && tt-smi --version

All three should respond without errors. If TTNN import fails, the venv may not be set up — check docs.tenstorrent.com for the current setup guide. If tt-smi isn’t found, add ~/.local/bin to your PATH (see below).

Activating the TTNN venv and importing ttnn on a QB2
Navigating between system Python and the TTNN venv — checking what's active before and after
📁 Why ~/tt-metal exists without source code: On a QB2, ~/tt-metal/ contains the pre-built TTNN Python environment and compiled shared libraries. The source code — C++ kernels, the build system — isn't there by default, and most users never need it. If you want to build from source (for kernel modification or upstream contributions), the build-tt-metal lesson walks through it.

Installing tt-smi if it’s Missing

On a QB2 it shouldn’t be missing, but on another Ubuntu system:

# Option A — public PyPI (any machine, no PPA needed):
pip install tt-smi

# Option B — via apt (requires Tenstorrent PPA, set up by tt-installer):
sudo apt install tt-smi

Both install the same tool. Option A works anywhere with Python; option B integrates with your system package manager. On a freshly installed Ubuntu machine without tt-installer, option A is the easier path.

Disk Space and Model Storage

Models consume significant disk space. Plan accordingly:

Model Size on disk
Qwen3-0.6B ~1.5 GB
Qwen3-8B ~16 GB
Llama-3.1-8B-Instruct ~16 GB
Llama-3.1-70B ~140 GB

The convention across all Tenstorrent documentation is ~/models/<model-name>/. Nothing enforces this — you can store models anywhere and point --model at any path — but using the convention means every tutorial command works without substitution.

Check space before any download:

df -h ~/models
tt-installer post-install state showing venvs, tt-smi, and hf on PATH
After tt-installer and reboot — venvs, tt-smi, and hf are ready

Next: Your First Model →