I want to run a pyCUDA code on a flask
server. The file runs correctly directly using python3
but fails when the corresponding function is called u
PyCUDA may not be compatible with WSGI web server contexts. You could possibly make it work if you use some kind of message queue like Celery, where the HTTP request places a job on the queue and the worker on the other side of the queue runs the CUDA program.
Edit: A quick and easy way would be to use Python Subprocess check_output function
In the web request:
subprocess.check_output(['python', 'cudaFlask.py'])