Textures access on the GPU : performance tips ?

Asic transit gloria mundi.
spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

Textures access on the GPU : performance tips ?

Postby spectral » Thu Mar 15, 2012 10:01 am

Hi,

I have do some test with the Sponza scene from here : http://www.crytek.com/cryengine/cryengine3/downloads
There is a lot of textures and 167 Mb of files and approximatively +400 Mb uncrompressed.

The problem is that when I remove the texture my scene rendering speedup by 24x !

So, of course I need texture and I should be able to handle them correctly and as fast as possible.

Do you know some techniques, tips to improve this ?

Thanks for your help
Spectral
OMPF 2 global moderator

Dade
Posts: 206
Joined: Fri Dec 02, 2011 8:00 am

Re: Textures access on the GPU : performance tips ?

Postby Dade » Fri Mar 16, 2012 8:02 am

spectral wrote:Do you know some techniques, tips to improve this ?


Have you checked if the texture maps are swapped from CPU <=> GPU memory during the rendering because you are out of GPU memory ? I ask because a 24x factor is really a HUGE difference.

spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

Re: Textures access on the GPU : performance tips ?

Postby spectral » Sun Mar 18, 2012 1:44 pm

Thanks Dade,

I create a simple buffer with all the textures, so finally I have a sequential array of 400 Mb ! I send it to the GPU and don't see why/how it is possible to swap between CPU and GPU.
I do the 'setArgs(... texturesBuffer)' at each render-loop, but I suppose that the whole buffer is not send each time !

Thx
Spectral
OMPF 2 global moderator

Dade
Posts: 206
Joined: Fri Dec 02, 2011 8:00 am

Re: Textures access on the GPU : performance tips ?

Postby Dade » Mon Mar 19, 2012 8:08 am

spectral wrote:I create a simple buffer with all the textures, so finally I have a sequential array of 400 Mb ! I send it to the GPU and don't see why/how it is possible to swap between CPU and GPU.
I do the 'setArgs(... texturesBuffer)' at each render-loop, but I suppose that the whole buffer is not send each time !


It shouldn't but never trust the drivers :lol: BTW, I have noticed that 'setArgs()' seems to have a noticeable cost sometime, I 'setArgs()' only once after the kernel compilation for all arguments that don't change over the execution time.

You could also try to just cut in half (or under 128MB, read below) the size of the textures and check how the performance change.

There also another limit that may affect you if you are using a AMD GPU, described here http://forum.beyond3d.com/showthread.ph ... ost1628390, the following answer (by "OpenGL guy") is from a guy working for AMD.

spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

Re: Textures access on the GPU : performance tips ?

Postby spectral » Mon Mar 19, 2012 3:07 pm

Thanks Dade,

I already set my arguments only once... what I have see is that if I remove 3 textures of 12MB it seems to works faster (30x).
Maybe I have concurrent access to my texture buffer, but anyway each pixel should access another location of the texture !

BTW, for now I'm testing on NVidia GPU only, but your link is very interesting... and surprising too, thanks.
Spectral
OMPF 2 global moderator

spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

Re: Textures access on the GPU : performance tips ?

Postby spectral » Wed Mar 21, 2012 8:14 am

Hi Dade,

I would like to test this scene with SLG, but does SLG support .obj file loading ? or there is another way to do ? (How can I convert them to the supported format) ?
Spectral
OMPF 2 global moderator

Dade
Posts: 206
Joined: Fri Dec 02, 2011 8:00 am

Re: Textures access on the GPU : performance tips ?

Postby Dade » Wed Mar 21, 2012 8:28 am

spectral wrote:I would like to test this scene with SLG, but does SLG support .obj file loading ? or there is another way to do ? (How can I convert them to the supported format) ?


It should be quite easy to load all .obj files in Blender an than use the SLG Exporter :idea:

spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

Re: Textures access on the GPU : performance tips ?

Postby spectral » Wed Mar 21, 2012 8:47 am

Thanks,

It is what I'm trying to do, but when I try to render it tell me that SLG has no emitter or sun ! But in the "World" tab I have choosed "environment lighting" !

Even when I add a small lamp into the scene... :-P
Spectral
OMPF 2 global moderator

spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

Re: Textures access on the GPU : performance tips ?

Postby spectral » Wed Mar 21, 2012 9:21 am

I have finaly test with SLG... I directly use the .exe and the exported scene from blender.

So, SLG does not look very fast too with this scene... I will do more tests...
Spectral
OMPF 2 global moderator

zsolnai
Posts: 24
Joined: Thu Mar 15, 2012 1:49 pm

Re: Textures access on the GPU : performance tips ?

Postby zsolnai » Wed Mar 21, 2012 9:36 am

spectral wrote:Thanks,

It is what I'm trying to do, but when I try to render it tell me that SLG has no emitter or sun ! But in the "World" tab I have choosed "environment lighting" !

Even when I add a small lamp into the scene... :-P


Hello there,
you have probably figured it out since then, but if not, you may want to use the "object data" tab (the one with the little sun icon) for the sunlight, and use the sky and/or atmosphere tabs instead of world/environment lighting


Return to “GPU”

Who is online

Users browsing this forum: No registered users and 1 guest