zoukankan      html  css  js  c++  java
  • [学习笔记] Nvidia AGX Xavier刷机过程中报错及解决

    Nvidia AGX Xavier刷机过程中报错及解决

    注意事项

    1. 不需要在host主机上装Cuda之类的,所以在SDKManager里可不勾选
    2. 安装的时候线一定要对
    3. 刷机时刷4.2.3的,有tensorflow可选,记得一定要选(任务需要)
    4. 如遇错误突然终止,肯定跟本机的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刷机,成功。

  • 相关阅读:
    CDH6.3.1安装详细步骤(感写B站若泽大数据)
    windows远程ubuntu UI教程
    CentOS7搭建Tensorflow计算环境(cuda+cudnn+jupyterlab(Anaconda3)+pytorch+Tensorflow)
    中国计算机学会推荐国际学术会议和期刊目录-2019
    基于BA网络模型的二部图数据集生成
    GitHub文件的克隆与上传
    博客园中随笔,文章的区别
    Pycharm新建文件时头部模板的配置方法
    asyncio 和aiohttp
    随机UA
  • 原文地址:https://www.cnblogs.com/aoru45/p/12112323.html
Copyright © 2011-2022 走看看