ncnn icon indicating copy to clipboard operation
ncnn copied to clipboard

海思交叉编译环境编译ncnn2mem转换的模型显示virtual memory exhausted: Cannot allocate memory

Open dengxiongshi opened this issue 2 years ago • 0 comments

我正在使用ncnn2mem转换的id.h和mem.h头文件进行加密处理,打包成so动态库

当我使用load_param()和load_model()从mem.h中加载字节数组时,使用cmake编译,显示virtual memory exhausted: Cannot allocate memory报错,我使用的是虚拟机ubuntu20,海思交叉编译环境是hisix200或者hisix400,下面是错误显示 dxs@dxs-ubuntu:~/nfsroot/yolov5/build$ cmake .. -- YOLOV5_VERSION_STRING = 1.0.20220902 -- Found OpenMP_C: -fopenmp
-- Found OpenMP_CXX: -fopenmp
OPENMP FOUND -- Found OpenMP_C: -fopenmp
-- Found OpenMP_CXX: -fopenmp
ncnn FOUND -- Configuring done -- Generating done -- Build files have been written to: /home/dxs/nfsroot/yolov5/build dxs@dxs-ubuntu:~/nfsroot/yolov5/build$ make Scanning dependencies of target yolov5 [ 50%] Building CXX object CMakeFiles/yolov5.dir/yolov5.cpp.o virtual memory exhausted: Cannot allocate memory make[2]: *** [CMakeFiles/yolov5.dir/build.make:63:CMakeFiles/yolov5.dir/yolov5.cpp.o] 错误 1 make[1]: *** [CMakeFiles/Makefile2:68:CMakeFiles/yolov5.dir/all] 错误 2 make: *** [Makefile:130:all] 错误 2 ` 然而,我按照出错原因到网上进行了查找,增加了虚拟内存,还是一样 MiB Mem : 19625.5 total, 17417.5 free, 1694.8 used, 513.2 buff/cache MiB Swap: 32768.0 total, 32761.4 free, 6.5 used. 17617.1 avail Mem

但是,我在虚拟机ubuntu本地进行编译可以通过,有谁遇到过相似的问题吗,请教大神指点一二

dengxiongshi avatar Sep 02 '22 02:09 dengxiongshi