Jetson Nano 移植ncnn

酆华皓
2023-12-01

编译&安装

# a fresh start
$ sudo apt-get update
$ sudo apt-get upgrade
# install dependencies
$ sudo apt-get install cmake wget
$ sudo apt-get install libprotobuf-dev protobuf-compiler libvulkan-dev
# download ncnn
$ git clone --depth=1 https://github.com/Tencent/ncnn.git
# download glslang
$ cd ncnn
$ git submodule update --depth=1 --init
# prepare folders
$ mkdir build
$ cd build
# build 64-bit ncnn for Jetson Nano
$ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/jetson.toolchain.cmake -DNCNN_VULKAN=ON -DCMAKE_BUILD_TYPE=Release ..
$ make -j4
$ sudo make install

测试

$ cd ../benchmark
$ cp ../build/benchmark/benchncnn ./
$ ./benchncnn 8 4 0 -1 1
loop_count = 8
num_threads = 4
powersave = 0
gpu_device = -1
cooling_down = 1
          squeezenet  min =   30.36  max =   93.72  avg =   43.04
     squeezenet_int8  min =   32.96  max =   63.76  avg =   41.03
           mobilenet  min =   40.13  max =  158.23  avg =   60.30
      mobilenet_int8  min =   58.65  max =  164.63  avg =   76.83
        mobilenet_v2  min =   31.76  max =   74.16  avg =   43.57
        mobilenet_v3  min =   28.91  max =  119.15  avg =   49.97
          shufflenet  min =   23.12  max =   83.44  avg =   40.24
       shufflenet_v2  min =   20.94  max =  101.76  avg =   32.29
             mnasnet  min =   30.34  max =   55.84  avg =   35.08
     proxylessnasnet  min =   35.55  max =  144.41  avg =   58.46
     efficientnet_b0  min =   67.63  max =  168.60  avg =   87.01
        regnety_400m  min =   57.54  max =  207.05  avg =   79.46
           blazeface  min =    7.67  max =   10.88  avg =    8.17
           googlenet  min =  102.81  max =  236.06  avg =  140.58
      googlenet_int8  min =  117.30  max =  252.45  avg =  153.89
            resnet18  min =  107.24  max =  202.77  avg =  130.57
       resnet18_int8  min =  112.87  max =  203.81  avg =  135.43
             alexnet  min =  112.41  max =  177.81  avg =  128.67
               vgg16  min =  516.80  max =  593.30  avg =  553.60
          vgg16_int8  min =  826.89  max =  872.26  avg =  846.04
            resnet50  min =  233.51  max =  386.12  avg =  307.67
       resnet50_int8  min =  222.37  max =  342.62  avg =  273.02
      squeezenet_ssd  min =   87.24  max =  213.17  avg =  105.93
 squeezenet_ssd_int8  min =  104.68  max =  242.72  avg =  141.82
       mobilenet_ssd  min =   86.30  max =  219.40  avg =  127.02
  mobilenet_ssd_int8  min =   95.24  max =  194.80  avg =  115.25
      mobilenet_yolo  min =  195.69  max =  338.56  avg =  249.24
  mobilenetv2_yolov3  min =  115.82  max =  211.68  avg =  153.20
         yolov4-tiny  min =  165.02  max =  291.73  avg =  197.70
$ ./benchncnn 8 1 0 0 1
[0 NVIDIA Tegra X1 (nvgpu)]  queueC=0[16]  queueG=0[16]  queueT=0[16]
[0 NVIDIA Tegra X1 (nvgpu)]  bugsbn1=0  bugcopc=0  bugihfa=0
[0 NVIDIA Tegra X1 (nvgpu)]  fp16p=1  fp16s=1  fp16a=1  int8s=1  int8a=1
[0 NVIDIA Tegra X1 (nvgpu)]  subgroup=32  basic=1  vote=1  ballot=1  shuffle=1
loop_count = 8
num_threads = 1
powersave = 0
gpu_device = 0
cooling_down = 1
          squeezenet  min =   14.79  max =   16.06  avg =   15.42
     squeezenet_int8  min =   93.32  max =   94.90  avg =   93.89
           mobilenet  min =   16.03  max =   16.53  avg =   16.30
      mobilenet_int8  min =  187.44  max =  189.70  avg =  188.32
        mobilenet_v2  min =   12.98  max =   13.67  avg =   13.25
        mobilenet_v3  min =   16.60  max =   18.74  avg =   17.53
          shufflenet  min =   16.20  max =   20.03  avg =   18.00
       shufflenet_v2  min =   18.77  max =   27.95  avg =   23.88
             mnasnet  min =   18.96  max =   21.66  avg =   20.47
     proxylessnasnet  min =   17.34  max =   34.16  avg =   22.37
     efficientnet_b0  min =   23.48  max =   32.95  avg =   28.32
        regnety_400m  min =   22.30  max =   30.86  avg =   26.73
           blazeface  min =    6.71  max =    7.66  avg =    7.13
           googlenet  min =   44.05  max =   52.42  avg =   46.86
      googlenet_int8  min =  312.54  max =  315.17  avg =  313.81
            resnet18  min =   43.63  max =   50.00  avg =   44.50
       resnet18_int8  min =  309.59  max =  313.25  avg =  310.89
             alexnet  min =   73.81  max =   77.05  avg =   74.65
               vgg16  min =  307.13  max =  310.95  avg =  308.51
          vgg16_int8  min = 1776.61  max = 1815.36  avg = 1801.09
            resnet50  min =   94.05  max =  104.11  avg =   97.41
       resnet50_int8  min =  641.70  max =  646.48  avg =  643.99
      squeezenet_ssd  min =   56.70  max =   63.95  avg =   59.08
 squeezenet_ssd_int8  min =  240.19  max =  244.43  avg =  242.68
       mobilenet_ssd  min =   35.69  max =   39.37  avg =   37.22
  mobilenet_ssd_int8  min =  295.33  max =  300.94  avg =  297.44
      mobilenet_yolo  min =   81.22  max =   90.77  avg =   86.35
  mobilenetv2_yolov3  min =   50.50  max =   60.10  avg =   53.44
         yolov4-tiny  min =   97.88  max =  108.29  avg =  104.27
 类似资料: