cyrusbehr / tensorrt-cpp-api

TensorRT C++ API Tutorial
MIT License
577 stars 72 forks source link

Cuda declarations were not declared in this scope for all the cuda commands #24

Closed mathanprasannakumar closed 10 months ago

mathanprasannakumar commented 10 months ago

Hey @cyrusbehr , Thank you for this awesome work, I was using this library, while compiling using make , for all the cuda commands i am getting error. Please help me i am stuck here.

Is there any cuda include location needs to be changed for the target in the default CMakeLists.txt ?

Screenshot from 2023-10-09 17-19-57 Screenshot from 2023-10-09 17-19-45

Please let me know if you require further information

mathanprasannakumar commented 10 months ago

@cyrusbehr , My system configuration,

Ubuntu : 20.4 Cuda : 10.2.3 Cudnn : 8.2.1 Tensorrt : 8.0.1.6 Open cv : 4.8.0 with Cuda

cyrusbehr commented 10 months ago

Can you please let me know if adding #include "cuda_runtime.h" to the top of engine.cpp fixes the issue?

mathanprasannakumar commented 10 months ago

Thank for the reply , I will check with in next 12 hrs as i am currently not having the device. I have a doubt how cuda libraries are working for you guys as cuda header files are not included in any of the src files in this repo. Actually i tried the below code during debug , the same issue happened.

#include <cuda_runtime.h>

cyrusbehr commented 10 months ago

Can you try compiling with CUDA 11 instead of CUDA 10 and see if that solves the issue? You can try doing so in a docker container so that you avoid messing with your system cuda.

mathanprasannakumar commented 10 months ago

Hey @cyrusbehr , I solved this isssue, we can close this issue

1) For my device , all the libraries and its corresponding header files are located under differant locations, so i modified the CMakeLists.txt as per the library locations that i have in my device. 2) Included #include<cuda_runtime.h> in engine.h 3) My tensorrt version is 8.0.1.0 and cuda version is 10.2.3 , i followed @ltetrel his implementation, as his cuda version and tensorrt is closer to my device.

Now everything works, Thanks @cyrusbehr and @ltetrel for your valuable work

cyrusbehr commented 10 months ago

Ok glad you were able to resolve it. I added to cuda_runtime.h header to the engine.h file.