I’ve written a simple code to test which CPU and GPU are faster.
This is the code:
using namespace std;
using namespace cv;
int main(int argc, char *argv)
And I get the results:
cv time: 0.048594s
cuda time: 0.125343s
GPU is slower than CPU?
Are my results normal or am I doing something wrong?
This is related to the OpenCV implementation.
It’s recommended to find openCV engineer for help directly.
Here are some initial suggestion for you:
1. Please build openCV with correct GPU architecture. sm=53 for Nano.
Please ignore this if you are using our default OpenCV package.
2. Please maximize the device performance first.
By the way, we also have a library includes canny detector.
You can also give it a try: https://developer.nvidia.com/embedded/visionworks
Hi AastaLLL, Thanks for your reply!
I have rebuilt the openCV with GPU architecture. sm=53. and maximized the device performance.
I have tested visionworks’s Canny too.
But the results confused me！
Canny - CPU OpenCV cost time: 0.06526 sec.
Canny - CUDA OpenCV cost time: 0.09753 sec.
Canny - VisionWorks cost time: 0.20656 sec.
What’s going on here?
Are you measuring latency of a single operation, or throughput of many operations?
VisionWorks is quite interesting. Is it possiblento use it with Python?