多核并发编译引起的编译错误

编译某个模型的工程化代码,模型里有多个算子使用了tensorrt plugin方式实现的,编译时总是报插件相关的目标文件找不到:

CMake Error at /opt/conda/share/cmake-3.22/Modules/FindCUDA/make2cmake.cmake:48 (file):
  file failed to open for reading (No such file or directory):

    /workspace/FOCC/build/CMakeFiles/bevdem.dir/src/bevdem_generated_preprocess_plugin.cu.o.NVCC-depend


CMake Error at bevdem_generated_preprocess_plugin.cu.o.DEBUG.cmake:237 (message):
  Error generating
  /workspace/FOCC/build/CMakeFiles/bevdem.dir/src/./bevdem_generated_preprocess_plugin.cu.o


-- Removing /workspace/FOCC/build/CMakeFiles/bevdem.dir/src/bevdem_generated_bevpool_plugin.cu.o.depend.tmp and /workspace/FOCC/build/CMakeFiles/bevdem.dir/src/bevdem_generated_bevpool_plugin.cu.o.NVCC-depend
make[2]: *** [CMakeFiles/export.dir/build.make:77: CMakeFiles/bevdem.dir/src/bevdem_generated_preprocess_plugin.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMake Error at /opt/conda/share/cmake-3.22/Modules/FindCUDA/make2cmake.cmake:48 (file):
  file failed to open for reading (No such file or directory):

    /workspace/FOCC/build/CMakeFiles/bevdem.dir/src/bevdem_generated_gatherbev_plugin.cu.o.NVCC-depend


-- Generating /workspace/FOCC/build/CMakeFiles/bevdem.dir/src/./bevdem_generated_preprocess_plugin.cu.o
CMake Error at bevdem_generated_gatherbev_plugin.cu.o.DEBUG.cmake:237 (message):
  Error generating
  /workspace/FOCC/build/CMakeFiles/bevdem.dir/src/./bevdem_generated_gatherbev_plugin.cu.o

开始以为是支持环境有问题,换不同的cuda和tensorrt版本有不同的表现,但只是错误的多少,冷静下来想想file failed to open for reading这种错误按理不应该出现,因为相关plugin的源码都有,编译时也都应该执行了,没有其他编译错误怎么会找不到呢,可能是哪里有时序问题,看了一下编译脚本里的命令,果然是有, make -j使用多核多任务并行编译加快了速度但是可能会造成这种依赖上的问题,改成make后编译就顺利完成了,记录一下备忘免得下次又忘了想到这种原因去苦哈哈的排查其他错误浪费时间。

相关推荐
爱听歌的周童鞋5 天前
Depth-Anything推理详解及部署实现(下)
tensorrt·cuda·deploy·mde·depth anything
因为风的缘故~5 天前
Ubuntu22.04安装cuda12.1+cudnn8.9.2+TensorRT8.6.1+pytorch2.3.0+opencv_cuda4.9+onnxruntime-gpu1.18
pytorch·深度学习·tensorrt·cuda·anaconda·cudnn
Dnelic-1 个月前
【笔记】Android Gradle Plugin配置文件相关说明-libs.versions.toml
android·ide·笔记·gradle·plugin·版本控制
10km2 个月前
java:修复aspectj-maven-plugin插件在java9项目中执行报错:cannot be resolved to a module
java·plugin·module-info·aspectj·jdk9
aworkholic2 个月前
opencv dnn模块 示例(27) 目标检测 object_detection 之 yolov11
pytorch·opencv·yolo·目标检测·dnn·tensorrt·yolo11
刘悦的技术博客3 个月前
Win11本地部署FaceFusion3最强AI换脸,集成Tensorrt10.4推理加速,让甜品显卡也能发挥生产力
ai·tensorrt·cuda
橘子真甜~3 个月前
Linux基础3-基础工具3(make,makefile,gdb详解)
linux·运维·服务器·makefile·make·gbd
zhangzhangkeji3 个月前
make 程序规定的 makefile 文件的书写语法
makefile·make
williamdsy3 个月前
【vite-plugin-vuetify】自动导入 vuetify 组件和指令
vite·plugin·vuetify·自动导入