ultralytics / ultralytics

NEW - YOLOv8 🚀 in PyTorch > ONNX > OpenVINO > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
28.39k stars 5.64k forks source link

inference fps fluctuate #1517

Closed shieman closed 1 year ago

shieman commented 1 year ago

Hi

When i use yolov8 with pytorch, onnx or tensorrt model, fps inference fluctuate and monitoring of Gpu shows that it is under utilised.

If i lauch on other program in parralel ( here Touchdesigner) wich uses Gpu, the Gpu frequency goes high and yolov8 inference fps goes down and don't fluctuate.

Is there a way to solve it ?

Thanks

github-actions[bot] commented 1 year ago

👋 Hello @shieman, thank you for your interest in YOLOv8 🚀! We recommend a visit to the YOLOv8 Docs for new users where you can find many Python and CLI usage examples and where many of the most common questions may already be answered.

If this is a 🐛 Bug Report, please provide a minimum reproducible example to help us debug it.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results.

Install

Pip install the ultralytics package including all requirements.txt in a Python>=3.7 environment with PyTorch>=1.7.

pip install ultralytics

Environments

YOLOv8 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

Ultralytics CI

If this badge is green, all Ultralytics CI tests are currently passing. CI tests verify correct operation of all YOLOv8 Modes and Tasks on macOS, Windows, and Ubuntu every 24 hours and on every commit.

AyushExel commented 1 year ago

The GPU can be( mostly is) under-utilized during inference, both in terms of memory and power consumption because it's not as intensive a task as training is. The FPS fluctuations however are a different matter. 5-10% fluctuation is common, but if you're seeing a massive, reproducible fluctuation, it can be a bug. Although we haven't seen anything like that in our testing. So, please provide a way to reproduce it and we'll try to confirm if any problem exists.

shieman commented 1 year ago

Hi I resolved the problem of low fps caused by an opencv waitkey. But the Gpu frequency (Laptop Rtx 3060) continues fluctuating between 1,1Ghz and 1,7Ghz... When i launch Touchdesigner in parralel, frequency stays constant at 2Ghz.

github-actions[bot] commented 1 year ago

👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.

For additional resources and information, please see the links below:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLO 🚀 and Vision AI ⭐

github-actions[bot] commented 1 year ago

👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.

For additional resources and information, please see the links below:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLO 🚀 and Vision AI ⭐

johnnynunez commented 4 months ago

Hi I resolved the problem of low fps caused by an opencv waitkey. But the Gpu frequency (Laptop Rtx 3060) continues fluctuating between 1,1Ghz and 1,7Ghz... When i launch Touchdesigner in parralel, frequency stays constant at 2Ghz.

how?

glenn-jocher commented 4 months ago

@johnnynunez great to hear you solved the FPS issue! 🚀 The GPU frequency fluctuations during YOLOv8 inference without Touchdesigner might be due to the GPU's attempt at power saving when the workload isn't constant. Launching Touchdesigner likely increases GPU demand, stabilizing its frequency. To achieve stable frequency without additional workload, you could explore setting a higher performance mode in your GPU's control panel or using a tool like nvidia-smi for NVIDIA GPUs.

For example, you can try setting the power mode to Prefer Maximum Performance in the NVIDIA Control Panel under Manage 3D settings.

Just a side note, ensure this change aligns with your power and thermal preferences!