errors from terminal:

/tmp/ccwCifBp.o: In function `nvinfer1::(anonymous namespace)::createInferRuntime(nvinfer1::ILogger&)':
/home/tonyyan/Downloads/TensorRT-7.2.2.3/include/NvInferRuntime.h:2025: undefined reference to `createInferRuntime_INTERNAL'
/tmp/ccwCifBp.o: In function `nvinfer1::(anonymous namespace)::createInferBuilder(nvinfer1::ILogger&)':
/home/tonyyan/Downloads/TensorRT-7.2.2.3/include/NvInfer.h:7462: undefined reference to `createInferBuilder_INTERNAL'
/tmp/ccwCifBp.o: In function `doInference(nvinfer1::IExecutionContext&, float*, float*, int)':
/home/tonyyan/Documents/Bios/tensorrtx-master/resnet/resnet18.cpp:247: undefined reference to `cudaMalloc'
/home/tonyyan/Documents/Bios/tensorrtx-master/resnet/resnet18.cpp:248: undefined reference to `cudaMalloc'
/home/tonyyan/Documents/Bios/tensorrtx-master/resnet/resnet18.cpp:252: undefined reference to `cudaStreamCreate'
/home/tonyyan/Documents/Bios/tensorrtx-master/resnet/resnet18.cpp:255: undefined reference to `cudaMemcpyAsync'
/home/tonyyan/Documents/Bios/tensorrtx-master/resnet/resnet18.cpp:257: undefined reference to `cudaMemcpyAsync'
/home/tonyyan/Documents/Bios/tensorrtx-master/resnet/resnet18.cpp:258: undefined reference to `cudaStreamSynchronize'
/home/tonyyan/Documents/Bios/tensorrtx-master/resnet/resnet18.cpp:261: undefined reference to `cudaStreamDestroy'
/home/tonyyan/Documents/Bios/tensorrtx-master/resnet/resnet18.cpp:262: undefined reference to `cudaFree'
/home/tonyyan/Documents/Bios/tensorrtx-master/resnet/resnet18.cpp:263: undefined reference to `cudaFree'
collect2: error: ld returned 1 exit status

 

solution:

add the following args to tasks.json:

"-L/usr/local/cuda-10.2/targets/x86_64-linux/lib",
                "-lcudart",
                "-lnvinfer"

 

相关文章:

  • 2022-01-01
  • 2021-04-21
  • 2021-06-20
  • 2021-09-22
  • 2021-11-11
  • 2021-05-05
猜你喜欢
  • 2022-12-23
  • 2021-08-10
  • 2022-12-23
  • 2022-12-23
  • 2021-04-24
  • 2022-12-23
  • 2023-02-15
相关资源
相似解决方案