[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"solution-scenes-menu":3,"tech-detail-2465":4},true,{"id":5,"title":6,"content":7,"picUrl":8,"tagIds":9,"keyWords":10,"htmlDescribe":11,"htmlUrl":12,"gmtCreate":13,"gmtModified":13,"articleInfoId":14},"2465","畅联云平台丨InspireFace GPU (CUDA) 编译避坑指南(2)","\u003Cp>\u003Cstrong>一、InspireFace 源码修改\u003C\u002Fstrong>\u003C\u002Fp>\u003Cp>  源码来自官网：\u003Ca href=\"https:\u002F\u002Fcloud.tencent.com\u002Fdeveloper\u002Ftools\u002Fblog-entry?target=https%3A%2F%2Fgithub.com%2FHyperInspire%2FInspireFace%2Freleases&amp;objectId=2665962&amp;objectType=1&amp;contentType=undefined\" rel=\"noopener noreferrer\">https:\u002F\u002Fgithub.com\u002FHyperInspire\u002FInspireFace\u002Freleases\u003C\u002Fa> \u003C\u002Fp>\u003Cp>   版本号：\u003Ca href=\"https:\u002F\u002Fcloud.tencent.com\u002Fdeveloper\u002Ftools\u002Fblog-entry?target=https%3A%2F%2Fgithub.com%2FHyperInspire%2FInspireFace%2Freleases%2Ftag%2Fv1.2.3&amp;objectId=2665962&amp;objectType=1&amp;contentType=undefined\" rel=\"noopener noreferrer\">InspireFace v1.2.3\u003C\u002Fa> \u003C\u002Fp>\u003Cp style=\"text-align:center\">\u003Cimg src=\"https:\u002F\u002Fqu-link.oss-cn-hangzhou.aliyuncs.com\u002F2026\u002F05\u002F28\u002Fdbfa2bc5-e841-4f22-a664-28724a521c5e.png\" alt=\"\" loading=\"lazy\" \u002F>\u003C\u002Fp>\u003Cp style=\"text-align:center\">\u003Cimg src=\"https:\u002F\u002Fqu-link.oss-cn-hangzhou.aliyuncs.com\u002F2026\u002F05\u002F28\u002F7485fd5f-0075-4c92-b987-1cd7674de79c.png\" alt=\"\" loading=\"lazy\" \u002F>\u003C\u002Fp>\u003Cp> \u003Cstrong>1.1 CMake CACHE 变量判空 bug\u003C\u002Fstrong>\u003C\u002Fp>\u003Cp>文件：根目录 CMakeLists.txt\u003C\u002Fp>\u003Cp>if (NOT DEFINED ISF_LINUX_MNN_CUDA)\u003C\u002Fp>\u003Cp>问题：NOT DEFINED 对 set(... CACHE ...) 变量永远为 FALSE，导致即使传入空路径也走 else 分支。\u003C\u002Fp>\u003Cp>下图为修改对比：\u003C\u002Fp>\u003Cp style=\"text-align:center\">\u003Cimg src=\"https:\u002F\u002Fqu-link.oss-cn-hangzhou.aliyuncs.com\u002F2026\u002F05\u002F28\u002F71f5946c-025c-4b09-a892-7f537dd188ff.png\" alt=\"\" loading=\"lazy\" \u002F>\u003C\u002Fp>\u003Cp>\u003Cstrong>1.2 宏定义不一致导致 CUDA 后端不生效\u003C\u002Fstrong>\u003C\u002Fp>\u003Cp>文件：cpp\u002Finspireface\u002Fmiddleware\u002Finference_adapter\u002Fmnn_cv_adapter_inference.h\u003C\u002Fp>\u003Cp>问题：\u003C\u002Fp>\u003Cp>#ifdef FORWARD_CUDA        \u002F\u002F ← 未定义的宏！\u003C\u002Fp>\u003Cp>backend_ = MNN_FORWARD_CUDA;\u003C\u002Fp>\u003Cp>下图为修改对比：\u003C\u002Fp>\u003Cp style=\"text-align:center\">\u003Cimg src=\"https:\u002F\u002Fqu-link.oss-cn-hangzhou.aliyuncs.com\u002F2026\u002F05\u002F28\u002F6294e520-e38a-4d57-bcb8-85fc321c374b.png\" alt=\"\" loading=\"lazy\" \u002F>\u003C\u002Fp>\u003Cp>\u003Cstrong>1.3\u003C\u002Fstrong> \u003Cstrong>inference_wrapper_mnn.cpp 文件加载版硬编码 CPU\u003C\u002Fstrong>\u003C\u002Fp>\u003Cp>文件：cpp\u002Finspireface\u002Fmiddleware\u002Finference_wrapper\u002Finference_wrapper_mnn.cpp\u003C\u002Fp>\u003Cp>问题：文件加载版 Initialize 函数中，无论是否启用 CUDA，scheduleConfig.type 都被设为 MNN_FORWARD_CPU。\u003C\u002Fp>\u003Cp>下图为修改对比：\u003C\u002Fp>\u003Cp style=\"text-align:center\">\u003Cimg src=\"https:\u002F\u002Fqu-link.oss-cn-hangzhou.aliyuncs.com\u002F2026\u002F05\u002F28\u002Fdf75fce0-569a-4671-943b-f02ef79ea3fd.png\" alt=\"\" loading=\"lazy\" \u002F>\u003C\u002Fp>\u003Cp>\u003Cstrong>1.4 meta.cpp.in 缺少 MNN CUDA 显示分支\u003C\u002Fstrong>\u003C\u002Fp>\u003Cp>文件：cpp\u002Finspireface\u002Fmeta.cpp.in\u003C\u002Fp>\u003Cp>问题：只有 TensorRT(CUDA) 和 MNN(CPU) 两个 \u003Ca href=\"https:\u002F\u002Fcloud.tencent.com\u002Fproduct\u002Fgpu?from_column=20065&amp;from=20065\" rel=\"noopener noreferrer\">GPU\u003C\u002Fa> 相关分支，缺少 MNN CUDA。\u003C\u002Fp>\u003Cp>下图为修改对比：\u003C\u002Fp>\u003Cp style=\"text-align:center\">\u003Cimg src=\"https:\u002F\u002Fqu-link.oss-cn-hangzhou.aliyuncs.com\u002F2026\u002F05\u002F28\u002F54d73c57-aef4-4865-9474-578185542c81.png\" alt=\"\" loading=\"lazy\" \u002F>\u003C\u002Fp>\u003Cp>\u003Cspan style=\"color:rgb(51, 51, 51);background-color:rgb(255, 255, 255);font-size:14px\">总结修改文件清单：\u003C\u002Fspan>\u003C\u002Fp>\u003Cp style=\"text-align:center\">\u003Cimg src=\"https:\u002F\u002Fqu-link.oss-cn-hangzhou.aliyuncs.com\u002F2026\u002F05\u002F28\u002Fb57dc7c1-91cb-43dd-a26a-aa2885afc9f8.png\" alt=\"\" loading=\"lazy\" \u002F>\u003C\u002Fp>","https:\u002F\u002Fqu-link.oss-cn-hangzhou.aliyuncs.com\u002F2026\u002F05\u002F28\u002Fee8133fd-3d9c-48b1-b79e-f4ff28e52597.jpg","8,9,84,83","美畅，美畅物联，畅联，畅联云平台，视频监控云平台，云视频监控，视频云平台，视频开放平台，视频感知云，视频接入网关，AIoT综合接入网关，视频中台，物联网中台，无插件播放，H265播放，Ehome，ISUP， GB28181，人脸识别，提取人脸特征码，向量库 ","原创技术分享丨美畅物联武工","http:\u002F\u002Fwww.24hlink.cn\u002Fweb-index\u002FKC20HEM.html","2026-05-28 14:41:17","827"]