Nvidia AGX Xavier刷機過程中報錯及解決
注意事項
- 不需要在host主機上裝Cuda之類的,所以在SDKManager里可不勾選
- 安裝的時候線一定要對
- 刷機時刷4.2.3的,有tensorflow可選,記得一定要選(任務需要)
- 如遇錯誤突然終止,肯定跟本機的python、環境變量配置有關,需要逐一排查。
所遇報錯及解決
刷機過程中突然出錯終止,遂直接運行flash.sh看看會有什么報錯
sudo ./flash.sh jetson-xavier mmcblk0p1
出現以下報錯:
son-xavier mmcblk0p1
###############################################################################
# L4T BSP Information:
# R32 , REVISION: 2.3
###############################################################################
# Target Board Information:
# Name: jetson-xavier, Board Family: t186ref, SoC: Tegra 194,
# OpMode: production, Boot Authentication: NS,
###############################################################################
copying soft_fuses(/media/xueaoru/其他/download/JetPack_4.2.3_Linux_GA_P2888/Linux_for_Tegra/bootloader/t186ref/BCT/tegra194-mb1-soft-fuses-l4t.cfg)... done.
./tegraflash.py --chip 0x19 --applet "/media/xueaoru/其他/download/JetPack_4.2.3_Linux_GA_P2888/Linux_for_Tegra/bootloader/mb1_t194_prod.bin" --skipuid --soft_fuses tegra194-mb1-soft-fuses-l4t.cfg --bins "mb2_applet nvtboot_applet_t194.bin" --cmd "dump eeprom boardinfo cvm.bin;reboot recovery"
Welcome to Tegra Flash
version 1.0.0
Type ? or help for help and q or quit to exit
Use ! to execute system commands
[ 0.0241 ] Generating RCM messages
[ 0.0249 ] tegrahost_v2 --chip 0x19 0 --magicid MB1B --appendsigheader /media/xueaoru/其他/download/JetPack_4.2.3_Linux_GA_P2888/Linux_for_Tegra/bootloader/mb1_t194_prod.bin zerosbk
[ 0.0256 ] Header already present for /media/xueaoru/Traceback (most recent call last):
File "./tegraflash.py", line 1280, in <module>
tegraflash_run_commands()
File "./tegraflash.py", line 1149, in tegraflash_run_commands
interpreter.onecmd(command)
File "/usr/lib/python3.7/cmd.py", line 217, in onecmd
return func(arg)
File "./tegraflash.py", line 779, in do_dump
tegraflash_dump(exports, args)
File "/media/xueaoru/其他/download/JetPack_4.2.3_Linux_GA_P2888/Linux_for_Tegra/bootloader/tegraflash_internal.py", line 1146, in tegraflash_dump
tegraflash_generate_rcm_message(is_pdf)
File "/media/xueaoru/其他/download/JetPack_4.2.3_Linux_GA_P2888/Linux_for_Tegra/bootloader/tegraflash_internal.py", line 3383, in tegraflash_generate_rcm_message
run_command(command)
File "/media/xueaoru/其他/download/JetPack_4.2.3_Linux_GA_P2888/Linux_for_Tegra/bootloader/tegraflash_internal.py", line 195, in run_command
log = print_process(process, enable_print)
File "/media/xueaoru/其他/download/JetPack_4.2.3_Linux_GA_P2888/Linux_for_Tegra/bootloader/tegraflash_internal.py", line 158, in print_process
outputchar = output.decode('ascii')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 0: ordinal not in range(128)
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Original exception was:
Traceback (most recent call last):
File "./tegraflash.py", line 1280, in <module>
tegraflash_run_commands()
File "./tegraflash.py", line 1149, in tegraflash_run_commands
interpreter.onecmd(command)
File "/usr/lib/python3.7/cmd.py", line 217, in onecmd
return func(arg)
File "./tegraflash.py", line 779, in do_dump
tegraflash_dump(exports, args)
File "/media/xueaoru/其他/download/JetPack_4.2.3_Linux_GA_P2888/Linux_for_Tegra/bootloader/tegraflash_internal.py", line 1146, in tegraflash_dump
tegraflash_generate_rcm_message(is_pdf)
File "/media/xueaoru/其他/download/JetPack_4.2.3_Linux_GA_P2888/Linux_for_Tegra/bootloader/tegraflash_internal.py", line 3383, in tegraflash_generate_rcm_message
run_command(command)
File "/media/xueaoru/其他/download/JetPack_4.2.3_Linux_GA_P2888/Linux_for_Tegra/bootloader/tegraflash_internal.py", line 195, in run_command
log = print_process(process, enable_print)
File "/media/xueaoru/其他/download/JetPack_4.2.3_Linux_GA_P2888/Linux_for_Tegra/bootloader/tegraflash_internal.py", line 158, in print_process
outputchar = output.decode('ascii')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 0: ordinal not in range(128)
Reading board information failed.
網上搜索后得到以下解決方案
默認Python是python3.7,所需python是3.6,按照網上的來:
1、 sudo apt-get remove --purge python-apt
2、 sudo apt-get install python-apt -f
3、 cd /usr/lib/python3/dist-packages/
4、 sudo cp apt_pkg.cpython-36m-x86_64-linux-gnu.so apt_pkg.cpython-37m-x86_64-linux-gnu.so
發現解決了一部分問題,但是仍有下面報錯:
###############################################################################
# L4T BSP Information:
# R32 , REVISION: 2.3
###############################################################################
# Target Board Information:
# Name: jetson-xavier, Board Family: t186ref, SoC: Tegra 194,
# OpMode: production, Boot Authentication: NS,
###############################################################################
copying soft_fuses(/media/xueaoru/其他/download/JetPack_4.2.3_Linux_GA_P2888/Linux_for_Tegra/bootloader/t186ref/BCT/tegra194-mb1-soft-fuses-l4t.cfg)... done.
./tegraflash.py --chip 0x19 --applet "/media/xueaoru/其他/download/JetPack_4.2.3_Linux_GA_P2888/Linux_for_Tegra/bootloader/mb1_t194_prod.bin" --skipuid --soft_fuses tegra194-mb1-soft-fuses-l4t.cfg --bins "mb2_applet nvtboot_applet_t194.bin" --cmd "dump eeprom boardinfo cvm.bin;reboot recovery"
Welcome to Tegra Flash
version 1.0.0
Type ? or help for help and q or quit to exit
Use ! to execute system commands
[ 0.0054 ] Generating RCM messages
[ 0.0062 ] tegrahost_v2 --chip 0x19 0 --magicid MB1B --appendsigheader /media/xueaoru/其他/download/JetPack_4.2.3_Linux_GA_P2888/Linux_for_Tegra/bootloader/mb1_t194_prod.bin zerosbk
[ 0.0069 ] Header already present for /media/xueaoru/Traceback (most recent call last):
File "./tegraflash.py", line 1280, in <module>
tegraflash_run_commands()
File "./tegraflash.py", line 1149, in tegraflash_run_commands
interpreter.onecmd(command)
File "/usr/lib/python3.7/cmd.py", line 217, in onecmd
return func(arg)
File "./tegraflash.py", line 779, in do_dump
tegraflash_dump(exports, args)
File "/media/xueaoru/其他/download/JetPack_4.2.3_Linux_GA_P2888/Linux_for_Tegra/bootloader/tegraflash_internal.py", line 1146, in tegraflash_dump
tegraflash_generate_rcm_message(is_pdf)
File "/media/xueaoru/其他/download/JetPack_4.2.3_Linux_GA_P2888/Linux_for_Tegra/bootloader/tegraflash_internal.py", line 3383, in tegraflash_generate_rcm_message
run_command(command)
File "/media/xueaoru/其他/download/JetPack_4.2.3_Linux_GA_P2888/Linux_for_Tegra/bootloader/tegraflash_internal.py", line 195, in run_command
log = print_process(process, enable_print)
File "/media/xueaoru/其他/download/JetPack_4.2.3_Linux_GA_P2888/Linux_for_Tegra/bootloader/tegraflash_internal.py", line 158, in print_process
outputchar = output.decode('ascii')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 0: ordinal not in range(128)
Reading board information failed.
查看代碼,發現此處只是一個用於輸出的錯誤,屏蔽即可,沒有任何影響。
加上try屏蔽該異常。
try:
outputchar = output.decode('ascii')
except Exception as e:
pass
發現flash.sh可以正常運行,於是重新使用sdkmanager刷機,成功。