Skip to content

Commit 2e969c7

Browse files
Use the firmware bundle
Do not rely on building from source. Signed-off-by: Dimitri Gnidash <[email protected]>
1 parent 693ada9 commit 2e969c7

File tree

1 file changed

+11
-137
lines changed

1 file changed

+11
-137
lines changed

.github/workflows/hardware-long.yml

Lines changed: 11 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -11,142 +11,7 @@ concurrency:
1111
cancel-in-progress: true
1212

1313
jobs:
14-
hardware-zephyr-test:
15-
strategy:
16-
fail-fast: false
17-
matrix:
18-
config:
19-
- board: p100
20-
runs-on:
21-
- yyz-zephyr-lab-p100
22-
- board: p100a
23-
runs-on:
24-
- yyz-zephyr-lab-p100a
25-
runs-on: ${{ matrix.config.runs-on }}
26-
env:
27-
"ZEPHYR_SDK_INSTALL_DIR": /opt/toolchains
28-
container:
29-
image: ghcr.io/zephyrproject-rtos/ci-repo-cache:v0.27.4.20241026
30-
volumes:
31-
- /dev/hugepages-1G:/dev/hugepages-1G
32-
- /dev/hugepages:/dev/hugepages
33-
- /opt/SEGGER:/opt/SEGGER
34-
- /opt/tenstorrent/fw/stable:/opt/tenstorrent/fw/stable
35-
- /opt/tenstorrent/twister:/opt/tenstorrent/twister
36-
- /opt/tenstorrent/bin/openocd-rtt:/opt/tenstorrent/bin/openocd-rtt
37-
options: '--device /dev/tenstorrent --device /dev/bus/usb --privileged'
38-
steps:
39-
- name: Checkout
40-
uses: actions/checkout@v4
41-
with:
42-
path: tt-zephyr-platforms
43-
ref: ${{ github.ref }}
44-
45-
- name: Set up Python
46-
uses: actions/setup-python@v5
47-
with:
48-
python-version: '3.10'
49-
50-
- name: Log Test SHA
51-
working-directory: tt-zephyr-platforms
52-
run: |
53-
# debug
54-
git log --pretty=oneline | head -n 10
55-
56-
- name: Install west
57-
run: |
58-
pip install west
59-
60-
- name: west setup
61-
# FIXME: would be ideal to use a built-in github environment variable
62-
# instead of tt-zephyr-platforms
63-
run: |
64-
rm -Rf .west
65-
west init -l tt-zephyr-platforms
66-
67-
- name: Setup Zephyr modules
68-
run: |
69-
west config manifest.group-filter -- +optional
70-
west update
71-
72-
# need to install protoc manually here, for some reason
73-
pip install -r zephyr/scripts/requirements.txt
74-
pip install protobuf grpcio-tools
75-
76-
- name: Apply patches
77-
run: |
78-
west patch clean
79-
west -v patch apply -r
80-
81-
- name: Checkout pyluwen
82-
uses: actions/checkout@v4
83-
with:
84-
repository: tenstorrent/luwen
85-
path: luwen
86-
87-
- name: Build pyluwen
88-
run: |
89-
# Setup cargo, since we run with a different $HOME
90-
HOME=/root . /root/.cargo/env
91-
# Install maturin for build (we already have cargo)
92-
pip install maturin
93-
cd luwen/crates/pyluwen
94-
maturin build --release
95-
pip install ../../target/wheels/*
96-
97-
- name: Generate board names
98-
shell: bash
99-
run: |
100-
case "${{ matrix.config.board }}" in
101-
p100) SMC_BOARD=tt_blackhole@p100/tt_blackhole/smc;;
102-
p100a) SMC_BOARD=tt_blackhole@p100a/tt_blackhole/smc;;
103-
p150a) SMC_BOARD=tt_blackhole@p150a/tt_blackhole/smc;;
104-
*) echo "Unknown board: ${{ matrix.config.board }}"; exit 1;;
105-
esac
106-
case "${{ matrix.config.board }}" in
107-
p100) BMC_BOARD=tt_blackhole@p100/tt_blackhole/bmc;;
108-
p100a) BMC_BOARD=tt_blackhole@p100a/tt_blackhole/bmc;;
109-
p150) BMC_BOARD=tt_blackhole@p150/tt_blackhole/bmc;;
110-
p300) BMC_BOARD=p300/tt_blackhole/bmc;;
111-
*) echo "Unknown board: ${{ matrix.config.board }}"; exit 1;;
112-
esac
113-
echo "SMC_BOARD=$SMC_BOARD" >> "$GITHUB_ENV"
114-
echo "BMC_BOARD=$BMC_BOARD" >> "$GITHUB_ENV"
115-
116-
- name: Flash Firmware
117-
working-directory: zephyr
118-
run: |
119-
# This needs to be added to the github runner
120-
export PATH=$PATH:/opt/SEGGER/JLink/
121-
122-
# TODO: ideally we would use one twister command to build and
123-
# flash BMC and SMC firmware, but since each chip uses a separate
124-
# debug adapter this doesn't work. For now, just flash BMC
125-
# then run twister with SMC firmware
126-
../tt-zephyr-platforms/scripts/rescan-pcie.sh
127-
./scripts/twister -i --retry-failed 3 \
128-
--retry-interval 5 \
129-
--tag e2e \
130-
-p $BMC_BOARD --device-testing \
131-
--hardware-map /opt/tenstorrent/twister/hw-map.yml --west-flash \
132-
-T ../tt-zephyr-platforms/app -ll DEBUG
133-
# Run E2E test to verify BMC and SMC firmware boot, and that
134-
# the SMC firmware sets up PCIe and ARC messages
135-
./scripts/twister -i --retry-failed 3 \
136-
-p $SMC_BOARD --device-testing \
137-
--tag e2e \
138-
--hardware-map /opt/tenstorrent/twister/hw-map.yml --west-flash \
139-
-T ../tt-zephyr-platforms/app -ll DEBUG
140-
- name: Install TT-SMI and reset the device
141-
run: |
142-
sed -i -e 's/http/https/g' /etc/apt/sources.list
143-
apt update
144-
apt install -y cargo
145-
pip install git+https://github.com/tenstorrent/[email protected]
146-
tt-smi -r 0
14714
hardware-metal-test:
148-
needs:
149-
- hardware-zephyr-test
15015
strategy:
15116
fail-fast: false
15217
matrix:
@@ -169,10 +34,19 @@ jobs:
16934
TT_METAL_HOME: ${{ github.workspace }}/tt-metal
17035
PYTHONPATH: ${{ github.workspace }}/tt-metal
17136
steps:
172-
- name: Install Git LFS
37+
- name: Install Git LFS and Cargo (for tt-flash)
17338
run: |
17439
apt update
175-
apt install -y git-lfs
40+
apt install -y git-lfs cargo
41+
- name: Download the latest firmware bundle
42+
# Replace this with the reliance on the previous workflow that builds the firmware bundle.
43+
run: |
44+
curl -L -o combined-fwbundle.zip https://nightly.link/tenstorrent/tt-zephyr-platforms/workflows/build-fw/main/combined-fwbundle.zip
45+
unzip combined-fwbundle.zip
46+
- name: Flash the firmware
47+
run: |
48+
pip install git+https://github.com/tenstorrent/tt-flash.git
49+
tt-flash --fw-tar fw_pack*.fwbundle --force
17650
- name: Run the rescan-pcie.sh script
17751
run: |
17852
curl -o /tmp/rescan-pcie.sh https://raw.githubusercontent.com/tenstorrent/tt-zephyr-platforms/${{ github.ref }}/scripts/rescan-pcie.sh

0 commit comments

Comments
 (0)