Skip to content

Commit d86324c

Browse files
committed
boot.py: Fix import errors with newer tt-smi
Some module and function names have changed in newer tt-smi versions leading to: mpe@rvsw-bh-03:~/tt-bh-linux$ make boot /home/mpe/.tenstorrent-venv/bin/python boot.py --boot --ttdevice 0 --l2cpu 0 --opensbi_bin fw_jump.bin --opensbi_dst 0x400030000000 --rootfs_dst 0x4000e5000000 --kernel_bin Image --kernel_dst 0x400030200000 --dtb_bin blackhole-card.dtb --dtb_dst 0x400030100000 Traceback (most recent call last): File "/home/mpe/tt-bh-linux/boot.py", line 10, in <module> from tt_smi.tt_smi_backend import pci_board_reset ModuleNotFoundError: No module named 'tt_smi.tt_smi_backend' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/mpe/tt-bh-linux/boot.py", line 13, in <module> from tt_smi.tt_smi_reset import pci_board_reset ModuleNotFoundError: No module named 'tt_smi.tt_smi_reset' make: *** [Makefile:114: boot] Error 1 Add another try block to use the new names if the old names are not found. Related tt-smi commits: tenstorrent/tt-smi@1a66172 tenstorrent/tt-smi@982fd81
1 parent e174d3a commit d86324c

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

‎boot.py‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,14 @@
99
# Luwen pre-v4.2.0
1010
from tt_smi.tt_smi_backend import pci_board_reset
1111
except ImportError:
12-
# v4.2.0 onwards
13-
from tt_smi.tt_smi_reset import pci_board_reset
14-
from tt_smi.tt_smi_reset import pci_board_reset, parse_reset_input
12+
try:
13+
# v4.2.0 onwards
14+
from tt_smi.tt_smi_reset import pci_board_reset, parse_reset_input
15+
except ImportError:
16+
# v5.2.0 onwards
17+
from tt_smi.reset import pci_board_reset
18+
from tt_smi.device_input import parse_smi_device_input as parse_reset_input
19+
1520
import clock
1621
import time
1722
import libfdt

0 commit comments

Comments
 (0)