cuda with OpenGL using FBO?

Hello,
I am novice of cuda and OpenGL, I have some question to ask.

I want to use FBO as source data and target data. How can I do it?

It seems that current SDK sample use PBO,but not FBO.

Also I have do some trace on sample Sobel filter,
But I have some problem of it.
even I run with the argument of -fbo , it still use display() not displayFBO()?
I dont get much idea about how to use FBO since class have encapsule the FBO usage.

Do anybody have suggests or idea? sample code is much better for me.

Thanks for your help!

You cannot read directly from an FBO in CUDA currently.

You need to do a glReadPixels to read from the frame buffer to a PBO (the postProcessGL sample in the SDK demonstrates this).

Thanks,
then How can I use cuda to write FBO?
what code sample have the usage?

Thank you very much!

You can’t write directly to an FBO either - you need to write to a mapped PBO, and then do a glDrawPixels from this.

Can cuda read/write from/to FBOs in CUDA 4.0?

CB

Is this still a case that one can only do the trick with PBO or direct FBO access is now possible, with CUDA version 5 and highier?

MK