enazoe / yolo-tensorrt

TensorRT8.Support Yolov5n,s,m,l,x .darknet -> tensorrt. Yolov4 Yolov3 use raw darknet *.weights and *.cfg fils. If the wrapper is useful to you,please Star it.
MIT License
1.19k stars 315 forks source link

insuficient memory error #169

Open sleepingsaint opened 2 years ago

sleepingsaint commented 2 years ago

Error

I am trying to run the sample_detector.cpp application. It got compiled with no errors ( some are deprecated warnings ) but I think it got compiled properly. Now when I run the yolo-trt I get insufficient memory error.

WARNING: Requested amount of GPU memory (4294967296 bytes) could not be allocated. There may not be enough free memory for allocation to succeed.
WARNING: Skipping tactic 1 due to insuficient memory on requested size of 4294967296 detected for tactic 0.
Try decreasing the workspace size with IBuilderConfig::setMaxWorkspaceSize()

This is the error I am getting.

Solutions I tried

I tried adding setMaxWorkspaceSize as suggested in the error like below:

// filename : modules/yolo.cpp line 164:166
// setting max workspace size as 1 GB 
std::size_t MAX_WORKSPACE_SIZE = 1ULL << 30;
config->setMaxWorkspaceSize(MAX_WORKSPACE_SIZE);

Even adding this didn't resolve the issue. Still getting the error.

Could you please help me? Any where else to add the setMaxWorkspaceSize function or should I do any thing else?

PC Specs

Ubuntu 20.04 LTS 8 GB RAM Nvidia 940MX - 4 GB graphics card Tensorrt Docker container with opencv installed

Docker file I used

FROM nvcr.io/nvidia/tensorrt:22.02-py3
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install --no-install-recommends -y libopencv-dev

Any help is appreciated. Thanks in advance :)