-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use MIVisionX on AMD 890M GPU #1477
Comments
Hi @zydjohnHotmail, thanks for opening this issue! Would you mind confirming whether you're on Windows, since you have mentioned installing the HIP SDK? I will start with the fact that the AMD 890M is not supported by ROCm (see here), so you may not be able to use the GPU backend for your workload in this case. As for using MIVisionX, follow the installation guide here depending on your environment. You can give it a try by verifying with our samples, where the If you would like to use HIP to write a kernel to find contours similarly to your OpenCV program, I would first check whether a simple HIP kernel may be executed on your 890M. There are C++ code examples here you could try running against your GPU first to verify whether this is possible. Please let me know if you have additional questions or concerns. Thank you! |
Hi, using OpenCvSharp; public class ContourDetection
} |
Hi @zydjohnHotmail, thank you for your response. For MIVisionX porting, since you already have OpenCV code (albeit in C#) I would first recommend you take a look at amd_opencv, an extension of amd_openvx. You will have to make changes to your code to accommodate the OpenVX API, while maintaining your OpenCV image processing and function calls (through OpenVX kernels listed in the first link). Then, when running the application you could specify the device via environment variables. As I mentioned in my previous comment, your GPU is not supported by ROCm, so there would likely be a CPU-backend fallback, which is not what you desire given that the changes you will need to make to the code are non-trivial and you are looking for GPU performance. However, it is good news that you are able to find CUDA code for a similar job. Though CUDA programs are not directly supported on AMD GPUs, we maintain a tool known as Hipify that can translate CUDA code to HIP C++ code. This is necessary because CUDA programs are not supported on AMD GPUs. It is not supported on Windows currently but you can use WSL for the translations. My suggestion is to first try this out and see if you are able to execute a simple HIP kernel on your GPU. If not, then the card is certainly unsupported unfortunately and you will need a supported GPU. You do not need the new RX9070 card (although it is likely to be supported by ROCm in the future) to do this, take a look at the supported GPUs for Windows for other options. Please don't hesitate to let me know if you have any further questions. Thanks! |
Hi, |
Hi @zydjohnHotmail, Thank you for following up. To guide you, here are the sources of OpenVX kernels that access OpenCV functionality, implemented from the list I sent previously. I do not see a contouring example that matches your desired code, but the implementation of canny could help you start with a C++ version of your code for use as an OpenVX kernel (I have checked the OpenCV documentation, and there are 1:1 API mappings between C#/C++ for things like We do not provide 1:1 code translations at the moment, but if you complete the code based on the guides above, I'd be happy to help debug any problems you have. Sorry for the inconvenience. Feel free to let me know if you have any further questions or thoughts. Thank you! |
Hi,
I have a new AMD AI HX370 CPU with 890M GPU.
I have some old code using OpenCv to do something like find contour; but the performance on CPU is not good.
I have installed HIP SDK 6.2; so I want to know if I can write some C++ code using HIP SDK to do the same job like find contour in OpenCv but using basically GPU to improve the performance.
If it is possible, please show me some code.
Thanks,
The text was updated successfully, but these errors were encountered: