Skip to content
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

[Windows] cl_invalid_context when testing OpenCL-enabled plugin in standalone mode #2

Open
ghost opened this issue Mar 20, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented Mar 20, 2018

I've made a test case for my C++ plugin that uses the maya/MOpenCL* libraries. The usage of those OpenCL libraries is similar to your cvWrap plugin.

I can run the test case interactively (from the Maya GUI), and the test passes. However, if I run the test from Maya's standalone interpreter, the entire interpreter crashes with nothing more than the classic "Fatal Error" error. The crash occurs when my plugin invokes the clCreateBuffer command.

Have you been able to run any tests on your cvWrap plug-in, using the standalone mode? I would try, but I'm not sure what's involved with getting cvWrap to run.

Thanks for any thoughts!

@ghost ghost changed the title Fatal error occurs when running CMT to test OpenCL-enabled plugin Fatal error when testing OpenCL-enabled plugin in standalone mode Mar 20, 2018
@ghost
Copy link
Author

ghost commented Mar 21, 2018

I did some more digging into this. I haven't resolved the problem yet, but made some progress.

It seems that, in my plugin, invoking the clCreateBuffer command returns the error cl_invalid_context, which I suppose suggests that the context given by MOpenCL::getOpenCLContext() is invalid. I tried understanding why this error occurs but didn't get anywhere.

From there I tried running scripts/cmt/test/mayaunittest.py using mayaBatch.exe rather than mayaPy.exe. This gives the same error as above, so no real surprises there.

I then removed the dependency on the maya/MOpenCL* libraries altogether and instead rewrote my plugin using the clew/clew_cl.h header (the clew library appears to be built in with my Windows installation). With this rewrite, I can successfully run my plugin using mayaBatch.exe; however, it still fails with the same error on mayaPy.exe.

@ghost ghost changed the title Fatal error when testing OpenCL-enabled plugin in standalone mode cl_invalid_context when testing OpenCL-enabled plugin in standalone mode Mar 21, 2018
@ghost
Copy link
Author

ghost commented Apr 3, 2018

Note: it seems that this is only an issue on Windows.

@ghost ghost changed the title cl_invalid_context when testing OpenCL-enabled plugin in standalone mode [Windows] cl_invalid_context when testing OpenCL-enabled plugin in standalone mode Apr 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants