• openvino program


    为了兼容 fpgaconf -b 00 -d 04 -f 1 xxx.bin

    重新实现

    #!/bin/bash
    B=${2}
    D=${4}
    F=${6}
    BDF=${B##0x}:${D##0x}.${F##0x}
    FILE=${7%.*}.aocx
    mv "$7" "$FILE"
    DEVPATH=/sys/devices/pci0000:00/*/0000:$BDF/fpga/
    echo "Try to find $DEVPATH"
    if [ -d $DEVPATH ]
    then
        ACL=`ls $DEVPATH`
        ACL=${ACL##intel-fpga-dev.}
        echo "FIND FPGA device: acl$ACL"
    else
        echo "Can not find FPGA device: $BDF"
        exit 1
    fi
    PRE="/home/centos"
    source $PRE/intelrtestack/init_env.sh
    export CL_CONTEXT_COMPILER_MODE_ALTERA=3
    export CL_CONTEXT_COMPILER_MODE_INTELFPGA=3
    export INTELFPGAOCLSDKROOT="$PRE/intelrtestack/intelFPGA_pro/aclrte-linux64"
    export ALTERAOCLSDKROOT="$INTELFPGAOCLSDKROOT"
    export AOCL_BOARD_PACKAGE_ROOT="$OPAE_PLATFORM_ROOT/opencl/opencl_bsp"
    $AOCL_BOARD_PACKAGE_ROOT/linux64/libexec/setup_permissions.sh
    source $INTELFPGAOCLSDKROOT/init_opencl.sh
    echo "Start to program by aocl ==========================================="
    echo "  aocl program acl$ACL $7"
    aocl program acl$ACL $FILE > /tmp/intel_aocl_program.log 2>&1
    exit $?
    
    export IE_INSTALL="/opt/intel/computer_vision_sdk_fpga_2018.3.343/deployment_tools"
    source $IE_INSTALL/../bin/setupvars.sh
    export PATH="$PATH:$PRE/inference_engine_samples/intel64/Release"
    alias mo="python3.6 $IE_INSTALL/model_optimizer/mo.py"

     cyborg 烧写的command

    acc-get

    curl -g -X GET http://localhost/accelerator/v1/accelerators/deployables 
      -H "Content-Type: application/json" -H "Accept: application/json" 
      -H "X-Auth-Token: $(openstack token issue -f value -c id)" 
      |python -m json.tool |grep '"uuid":' | tail -n 1 |cut -d '"' -f 4

    acc-program

    curl -s -g -X PATCH http://localhost/accelerator/v1/accelerators/deployables/$UUID/program 
      -H "Content-Type: application/json" -H "Accept: application/json" 
      -H "X-Auth-Token: $(openstack token issue -f value -c id)" 
      -d "[{
        "path": "/program",
        "op": "replace",
        "value": [{
        "image_uuid": "$IMGUUID"
        }]
      }]" | python -m json.tool

    acc-show

    curl -g -s -X GET http://localhost/accelerator/v1/accelerators/deployables 
      -H "Content-Type: application/json" -H "Accept: application/json" 
      -H "X-Auth-Token: $(openstack token issue -f value -c id)" |python -m json.tool

    create-img

    openstack image create --file $FILE --property vendor=intel --property type=resnet --tag INTEL --tag FPGA $IMGNAME

    cyborg-env

    export FILE="/opt/intel/computer_vision_sdk_fpga_2018.3.343/a10_dcp_bitstreams/2-0-1_RC_FP11_ResNet.aocx"
    export IMGNAME=ResNetForObama
    echo "source ~/devstack/openrc admin admin"

    image-get

    openstack image list |grep $IMGNAME | awk -F'| ' '{print $2}'

    image-list

    openstack image list
  • 相关阅读:
    克如斯卡尔 P1546
    真正的spfa
    第四课 最小生成树 要点
    关于vscode中nullptr未定义
    cmake学习笔记
    python学习笔记
    (BFS 图的遍历) 2906. kotori和迷宫
    (图论基础题) leetcode 997. Find the Town Judge
    (BFS DFS 并查集) leetcode 547. Friend Circles
    (BFS DFS 图的遍历) leetcode 841. Keys and Rooms
  • 原文地址:https://www.cnblogs.com/shaohef/p/9867464.html
Copyright © 2020-2023  润新知