wang-xinyu / tensorrtx

Implementation of popular deep learning networks with TensorRT network definition API
MIT License
6.95k stars 1.77k forks source link

yolov5 make compilation error #1180

Closed eladpar closed 1 year ago

eladpar commented 1 year ago

Env

About this repo

Your problem

im building using this https://wiki.seeedstudio.com/YOLOv5-Object-Detection-Jetson/#inference-on-jetson-device toturial when i hit the make command i get this ouput : Screenshot from 2022-12-20 16-19-14

Scanning dependencies of target myplugins
[  7%] Building CUDA object CMakeFiles/myplugins.dir/plugin/yololayer.cu.o
/usr/local/cuda/include/cuda_runtime_api.h(13213): error: attribute "__host__" does not apply here

/usr/local/cuda/include/cuda_runtime_api.h(13213): error: expected a ";"

/home/eladpar/tensorrtx/yolov5/plugin/yololayer.h(87): warning: function "nvinfer1::IPluginV2Ext::configurePlugin(const nvinfer1::Dims *, int32_t, const nvinfer1::Dims *, int32_t, const nvinfer1::DataType *, const nvinfer1::DataType *, const __nv_bool *, const __nv_bool *, nvinfer1::PluginFormat, int32_t)" is hidden by "nvinfer1::YoloLayerPlugin::configurePlugin" -- virtual function override intended?

2 errors detected in the compilation of "/tmp/tmpxft_000369d4_00000000-6_yololayer.cpp1.ii".
make[2]: *** [CMakeFiles/myplugins.dir/build.make:63: CMakeFiles/myplugins.dir/plugin/yololayer.cu.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:163: CMakeFiles/myplugins.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
wang-xinyu commented 1 year ago

Can you check your nvcc? Try this command nvcc --version.

eladpar commented 1 year ago

Can you check your nvcc? Try this command nvcc --version.

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243
wang-xinyu commented 1 year ago

Here the nvcc is 10.1, but your CUDA is 11.8. You need to use /usr/local/cuda/bin/nvcc.

eladpar commented 1 year ago

Here the nvcc is 10.1, but your CUDA is 11.8. You need to use /usr/local/cuda/bin/nvcc.

can you elaborate on what needs to be done? beacuse as seen in this question : https://stackoverflow.com/a/53504578 the cuda seen in nvidia-smi and nvcc-version don't have to be the same?

wang-xinyu commented 1 year ago

Thing is you have two nvcc in your OS. Can you check your nvcc path by running which nvcc? And also check if /usr/local/cuda/bin/nvcc is in your system?

eladpar commented 1 year ago

Thing is you have two nvcc in your OS. Can you check your nvcc path by running which nvcc? And also check if /usr/local/cuda/bin/nvcc is in your system?

my nvcc is located in /usr/bin/nvcc there is no nvcc located in /usr/local/cuda/bin/nvcc

wang-xinyu commented 1 year ago

Where are your CUDA libs and bins installed?

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.