unitaryfund / qrack

Comprehensive, GPU accelerated framework for developing universal virtual quantum processors
https://qrack.readthedocs.io/en/latest/
GNU Lesser General Public License v3.0
164 stars 36 forks source link

QPager raises OpenCL error -5 (out of resources) #968

Closed WrathfulSpatula closed 2 years ago

WrathfulSpatula commented 2 years ago

At this stage in development, it seems that QPager raises -5 (out of resources) in pretty much every nontrivial use case. This might have to do with genuine hardware limitations on my (and other) systems, but it should be debugged. If QPager cannot ultimately be used to attain qubit widths beyond max single allocation segment, it should be (temporarily) removed from the default layer stack.

WrathfulSpatula commented 2 years ago

The problem might actually be due to a SEGFAULT, which NVIDIA apparently reports as -5:

https://stackoverflow.com/questions/23742619/opencl-cl-out-of-resources-in-a-for-loop

WrathfulSpatula commented 2 years ago

It was a segmentation fault, due to recent changes to QEngineOCL::ShuffleBuffers(). The need for these changes was predicated on ShuffleBuffers() being made asynchronous, which is a feature currently on hold. However, with the method reverted, QPager works again. Further, all deadlock conditions and failures on multi-page ket simulation widths have been fixed, (for real, this time,) so we'll want to iterate a PyQrack release immediately.