4041-Support convolution calculation


I tried to write a convolution using gpt, but wm does not support this calculation function,Really need this, hope wm can support convolution function

2 Likes

The error message you saw in the scripting output is telling you that there is no opencl driver on your system. This is somewhat unusual, but you can always use the Intel CPU-based openCL drivers available here:

https://www.intel.com/content/www/us/en/developer/articles/technical/intel-cpu-runtime-for-opencl-applications-with-sycl-support.html

They actually work quite well for World Machine.
Install the drivers above and then launch World Machine. Go to Program Settings->Compute and make sure GPU Compute is checked, and the Intel OpenCL platform selected, then try again.

3 Likes

I retested the code and found that the code had too much computational effort, incorrect syntax or program freezes may lead to Compute capabilities not available. Part of the reason was that the code could run normally after restarting wm, but sometimes it was still unavailable. It might be a problem with my operation, but I don’t know how it was triggered.

Yes. Usually the cause is reading/writing to a buffer past its size…Unfortunately, if your OpenCL code crashes the nvidia driver, there’s not a lot WM can do. WM tries to release and reinitialize the system, but I’ve also found that this doesn’t reliably fix things - the only solution is to restart WM. There are some additional workarounds, such as spinning up a compute-only process that can be trashed and restarted as needed, but they’re out of scope right now.

Incidently, if you just need to do a basic blur convolution like the above, you can simply use the Blur device…

1 Like

Will wm consider allowing code to call external programs in subsequent updates?
And import files from external or make the lua compilation solution public and make a vscode plugin

The current Code device uses lua specifically because it is one of the few languages that can be completely sandboxed, allowing for safe sharing of new devices between users without any security concerns.

For internal use, it would definitely be useful to relax those constraints and allow the host scripts (whether lua or something like python) to access the local machine. Gaining access to Python and all of its various useful libraries in particular would be powerful. This is something I’ve considered but there’s no ETA on such a thing yet.

2 Likes