-
I use Magick.NET for converting images, I've found that processing some images throws an exception: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.' After some investigation, I can found that I can 'fix' this problem by turning off OpenCL ( After another investigation, I found that problem images are very large (13600x10200). So, it seems my GPU cannot convert these images. But because I've found that only big images causes problem and OpenCL conversion is faster, I want to try use OpenCL version for small images and CPU version for big images. Is it possilble? Does switching OpenCL off/on in runtime will have an effect? Can it cause multi-threaded problems? Is there any better variant to switch image processing engines? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Can you share a small sample projects that reproduces the access violation? Feel free to contact me by email if you cannot share the image in public. |
Beta Was this translation helpful? Give feedback.
-
I've tried to reproduce issue and reveal, that error is not stable and does not occur for one concrete file.
Code to reproduce:
I've found that:
|
Beta Was this translation helpful? Give feedback.
-
I am unable to reproduce your issue with my hardware. I suspect that this could be related to your setup. And to answer a question you asked earlier. You can turn it on or off but that is a global setting so you could run into multi threading issues. |
Beta Was this translation helpful? Give feedback.
-
You can safely turn it off and on again. But make sure you don't do that multithreaded because that will cause undefined behavior. |
Beta Was this translation helpful? Give feedback.
You can safely turn it off and on again. But make sure you don't do that multithreaded because that will cause undefined behavior.