Is there a way of resetting the GPU through arrayfire with each run without restarting the Python console?
I have a python script which calls a number of functions to be executed on a GPU using arrayfire. The script gives the expected result when run once, but if run a second time without changing any parameters it returns NaN
values. This stops once I either restart the Python console or, equivalently, run the following:
import arrayfire as af
af.device.free_device(af.device.device_mem_info()['alloc']['bytes'])
which restarts the console after clearing all allocated device memory.
I'm having a hard time seeing what could be going wrong here; the program runs well the first time, so I think that it is likely to be a command that I can't find in the docs that I am missing.
I have tried most of the functions in the docs which looks promising (device_gc
, free_device
, free_pinned
, device.init
, etc.) but have not had much luck. I have also attempted to use reload(arrayfire)
too.
Could this be a bug? Any advice would be appreciated.
I'm using: nvidia quadro M4000, Python 2.7, windows 7, Spyder 3