Giter Club home page Giter Club logo

Comments (7)

cancan101 avatar cancan101 commented on May 30, 2024

I tried the same script on a different device. It works intermittently. Sometimes it works, sometimes I get this in stdout/err:

OPENCL_V< CLFFT_INVALID_PLAN > (3083): fftRepo.getPlan failed

and sometimes I get the following exception:

Exception gpyfft.gpyfftlib.GpyFFT_Error: GpyFFT_Error() in 'gpyfft.gpyfftlib.Plan.get_dim' ignored
---------------------------------------------------------------------------
GpyFFT_Error                              Traceback (most recent call last)
<ipython-input-2-38dd57c8a3ed> in <module>()
     30 
     31 
---> 32 print 'plan.strides_in', plan.strides_in
     33 print 'plan.strides_out', plan.strides_out
     34 print 'plan.distances', plan.distances

/Users/alex/.python-eggs/Gpyfft-0.2-py2.7-macosx-10.9-x86_64.egg-tmp/gpyfft/gpyfftlib.so in gpyfft.gpyfftlib.Plan.strides_in.__get__ (gpyfft/gpyfftlib.c:3447)()

/Users/alex/.python-eggs/Gpyfft-0.2-py2.7-macosx-10.9-x86_64.egg-tmp/gpyfft/gpyfftlib.so in gpyfft.gpyfftlib.errcheck (gpyfft/gpyfftlib.c:1534)()

GpyFFT_Error: 'Functionality is not implemented yet.'

and sometimes in stderr/out:

Python(26389,0x7fff766b7310) malloc: *** error for object 0x7fd95157fa48: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug

In some of these cases python dies (I assume segfault).

from gpyfft.

cancan101 avatar cancan101 commented on May 30, 2024

It appears that running these line repeatedly causes Python to crash:

G = gpyfft.GpyFFT(debug=False)
plan = G.create_plan(context, cl_data.shape)

from gpyfft.

geggo avatar geggo commented on May 30, 2024

cannot reproduce this on OS X 10.9.3, Python 2.7.6, python 0.21dev, on Nvidia GT 330M.

from gpyfft.

cancan101 avatar cancan101 commented on May 30, 2024

Python does not die even running the two lines repeatedly together?

I noticed that the end of the script explicitly calls del on G and plan. Why is that?

from gpyfft.

geggo avatar geggo commented on May 30, 2024

Could once reproduce a segfault on OS X, happens in FFTPlan::ReleaseBuffers(), when plan is released.

Perhaps during garbage collection DestroyPlan is called after Teardown. This should not happen, each Plan keeps a reference to the GpyFFT object, to keep it alive. Quick testing indicates this is not the case. Repeatedly calling only plan = G.create_plan(context, cl_data.shape) seems to be ok.

Perhaps clFFT does not like to be initialized and deallocated repeatedly. There must have been a good reason why I added the comment #TODO: need to initialize (and destroy) at module level to GpyFFT.
So for the moment, create a GpyFFT instance only once.

The explicit del for plan and G is to trigger deallocation (clfftDestroyPlan(), clfftTeardown() ) for testing, not necessary.

from gpyfft.

geggo avatar geggo commented on May 30, 2024

I will change how the library get initialized, needs some work. Anyhow, please use the high level interface as defined in fft.py, the lower level interface as tested in test_simple.py is likely to change.

from gpyfft.

geggo avatar geggo commented on May 30, 2024

Reworked resource deallocation, so time to close this issue...

from gpyfft.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.