deepdrr icon indicating copy to clipboard operation
deepdrr copied to clipboard

Fix issue #69

Open coolteemf opened this issue 1 year ago • 1 comments

Fixes issue #69 by reusing cuda primary context instead of creating one through pycuda.autoinit. When the gpu is to be used by the projector, this primary context is made active and then deactivated when not needed anymore. This at least prevents conflicts when importing deepdrr and using PyTorch with cuda afterwards.

coolteemf avatar Jul 08 '22 13:07 coolteemf

Testing with a Nvidia GeForce GTX 1080 Ti worked but when I switched to a GTX 1070, it didn't work anymore and crashed the python process and made the GPU unavailable. So I think something strange is happening on PyCuda's part

coolteemf avatar Jul 26 '22 15:07 coolteemf

This was a quick and dirty fix to get it working with my pipeline which includes using deepdrr to generate projections and then PyTorch to make predictions on the GPU on the projections. However, it did not fix the conflict when using the GPU with PyTorch at the same time as the pycuda context was open. This issue produced constant 0 projection images. Is the conflict between pycuda and PyTorch fixed now ?

coolteemf avatar Feb 03 '23 10:02 coolteemf

This issue resolved by using Cupy instead of Pycuda.

benjamindkilleen avatar Nov 14 '23 15:11 benjamindkilleen