View Full Version : fft3dGPU 0.8.2
Pages :
1
2
3
4
5
6
7
[
8]
9
10
11
12
13
14
15
16
17
18
19
tsp
14th March 2006, 18:52
VagueDenoiser would be the "easiest" filter to make a gpu version of because it is similair to fft3dfilter and the source is GPL'ed.
DepanEstimate is harder to do because the source is not public available so I would have to guess how the filter is implemented(and it is not based on an article like fft3dfilter) and the current GPU fft is limited to power of 2 size(2,4,8,16,32,64,128,256,512 etc).
While I have read about gpu version of motion compensation it would require a lot of work to implement. And the tool for MPEG4 encoding on the gpu by ATI still does the motion compentaion/estimation on the cpu also the videoengine build in the latest GPU from nvidia and ati is not programable.
tsp:
the current GPU fft is limited to power of 2 size(2,4,8,16,32,64,128,256,512 etc).DePan manual:
winx - number of columns (width) of fft window (must be power of 2 if not fftw, default = maximum within frame width).
winy - number of rows (height) of fft window (must be power of 2 if not fftw, default = maximum within frame height).that I know, realy DepanEstimate always use "power of 2", if not "use hands for change it"
(i.e. always default)
ATI say that them GPU x1000 serial is physical coprocessor
(i.e. can be if use)
possibe in Radeon x1000 can be use for over development...
tsp
15th March 2006, 15:30
ATI say that them GPU x1000 serial is physical coprocessor
(i.e. can be if use)
possibe in Radeon x1000 can be use for over development...
they still ned to expose it somehow to the developer
hwti
16th March 2006, 16:13
I have a problem with FFT3dGPU and x264 CLI.
I don't know if the problem is related to x264 or FFT3dGPU, but if it is x264, it is probably linked to something uncommon in this filter
I use a simple script :
MPEG2source("...")
LeakKernelBob(order=1)
FFT3dGPU(sigma=2,bt=1,mode=0)
I only get 20fps in pass 1 with only 55% CPU used (sharktooth HQ-Slow profile), without FFT3dGPU I get 33fps (with 100% CPU)
In pass 2, I get 8.16fps instead of 10fps. (with 85% CPU)
I tested the avs script in virtual dub in direct stream copy mode : 64 fps
So I conclude that my 6800GS isn't the problem
I tested in virtualdub using x264 vfw (I can't test with same settings, since I don't understand the link between all vfw parameters and MeGUI/CLI parameters)
I always get 100% CPU with vfw interface.
Did someone have this problem or an explanation ?
PS : In all tests my 6800GS was in 3D high-speed mode (clocks 425/500)
tsp
16th March 2006, 18:32
it might be because that x264 CLI is singlethreaded so that the x264 encoder must wait on fft3dgpu to finnish each frame and while fft3dgpu works the cpu isn't used very much that would explain the low cpu utilization. Virtual dub is multithreaded so one thread runs the AVS script and produces frames for the other thread that encodes them usinf x264. This releases the free cpu time from the AVS thread to the x264 codec. So try and see if you can get the x264 CLI developeres to confirm if that is the case and change it if so.
aichan
21st March 2006, 01:44
tsp, fft3dgpu is not support for interlaced video yet. but if i deinterlace the video using TDeint and then denoise it with fft3dgpu, would it work fine??
so the script look like this :
...
TDeint()
FFT3dgpu()
...
edit : script sample
Boulder
21st March 2006, 07:11
Yes, it will work just fine.
aichan
25th March 2006, 14:37
okay, then i'll try it. thx..
Boulder
27th March 2006, 07:14
tsp,
could you please release the version which works with HC v0.17? It appears that the problem with the ffdshow, AVISource and HC combo is fixed in v0.17 but I can't use it until FFT3DGPU works since I need it for fast chroma denoising;)
Mug Funky
27th March 2006, 07:38
not sure if this has been reported yet, but there's a bit of a bug when running:
fft3dgpu(bw=8,bh=8,ow=0,oh=0,bt=0,sigma=xxx,plane=xxx) where xxx is any number you care to think of.
the 8x8 blocks seem to get put back together in the wrong order. it's quite strange.
i'm running it on a nvidia 6600GT, PCI-e (nicely enough i have the same card at work and at home, but i've only tried this on the work one).
tsp
27th March 2006, 17:25
Boulder: sure but you will have to wait until saturday before I can compile it.
Mug Funky:; I didn't expect anyone to set ow or oh to zero so it is kind of unsupported but I will see what I can do about it. (just curious doesn't it produce a lot of grid artifacts or is it part of a more complicated script?)
Mug Funky
30th March 2006, 06:55
more a matter of seeing how fast it can go. the grids aren't bad if the sigma is low, and bt=0 gets a lot of smoothing out of a low sigma.
of course, for stuff i care about overlapping is a must. i was just playing with it to see what i could get out of it. if you set the block sizes really small (2), then it acts like a basic temporal filter, which can be fun to have on a GPU. of course it's not the best usage for a filter like this...
new version that should fix the HC 0.17 bug. version 0.6.2.1 (http://www.avisynth.org/tsp/fft3dgpu0.6.2.1.exe)
Boulder
1st April 2006, 21:07
Thanks!
:)
Firesurfer
5th April 2006, 07:34
Thank you, too! :thanks:
I was waiting for that...
swaaye
3rd May 2006, 03:53
FFT3DGPU is only hitting my dual core at 50%. Is this right? I don't understand why Divx isn't even using some of the 2nd core with FFT3DGPU in use. It's like it restricts everything to a single thread. I disable FFT3DGPU and I get back up to 100 fps, with it I can't do better than 25 fps!
MPEG2Source("aaa", idct=3)
tfm(d2v="aaa")
tdecimate(hybrid=1)
FFT3dGPU(sigma=2,bt=3,sharpen=0.7,precision=1)
Crop(2,0,-2,-0)
BicubicResize(640,352,0,0.75)
I'm running a dual core Opteron 165 @ 2.6 GHz. Radeon X850 XT. Playing the .AVS back in MPC shows that it can definitely playback at realtime 24fps. I suppose the video card could be maxed out.
edit: with precision at 0 I get 40-50fps. CPU usage is slightly higher. I figured that since my GPU is the bottleneck I'll use the extra CPU cycles for higher DIVX quality settings.
TSP you should post on the Beyond3d.Com forum about optimizing the shader code. A lot of engineers from ATI and NV, along with some extremely talented graphics programmers, hang out there and I bet they'd welcome a challenge with such an ingenious use of their hardware. :)
swaaye
3rd May 2006, 19:34
I ran into a strange problem last night. One the 2nd pass of my 2nd encode I lost half of my framerate. I went back and re-ran the first encode and it was also half speed. Rebooted, no help. Reset video driver settings to defaults. Nothing. It seems to be FFT3DGPU that's causing the issue, somehow the video card and it aren't getting along now. I am totally baffled. I underclocked and overclocked my GPU and saw no speed change.
Tonight I will reinstall drivers for the video card and see if that helps. Sorta bummed here cuz it was going so well at 50 fps, but 30fps just isn't going to cut it for how many things I have to encode.
swaaye: The only limit FFT3dgpu has about restriction multithreading is it only allows 1 thread to execute code inside fft3dgpu. This shouldn't cause any problems so as you noted the limiting factor might be your GPU. It also depends on what program you use to encode with as some are only singlethreaded. VirtualDub works well as the encoding codec and avisynth runs on different threads.
As you have a dualcore processor you shouldn't expect to get 100% cpu utilization unless you're using a multithreaded codec as fft3dgpu alone rarely will use 50%.
As for optimizing the slowest part of my gpu code is the fft. It relies heavly on more or less random texture lookups so it is very bandwidth limited. I'm working on an improved version that shouldn't requere as many texture lookups and should have more linear texture reads.
About your second problem I don't know how fft3dgpu should cause that. Is the framerate stable or does it fluctuate a lot?
swaaye:
good idea for fast CPU and fast GPU
first - Luma in CPU
second - Chroma (U and V) in GPU
tsp
no problem with it, I am only recommend ;)
swaaye
3rd May 2006, 21:39
About your second problem I don't know how fft3dgpu should cause that. Is the framerate stable or does it fluctuate a lot?
I don't know what happened. It has me totally baffled. I didn't change anything between the encodes. Same settings for all. I use StaxRip for encoding and that uses VDubmod. It's definitely multithreaded. I've been encoding with it for months now and I can usually pull 90-100fps with what I'm doing and multithreaded Divx 6.2.
FFT3DGPU dropped me to exactly 50% CPU when I enabled it with the settings above. So, it was doing something making DIVX not use the 2nd core at all. I upped the DIVX quality settings in the codec and managed to pull 80-90% usage while maintaining the same encoding 40-55fps framerate. This worked for 1.5 encodes, on the second pass of the 2nd encode it dropped to 35fps inexplicably.
Now, I can not get that speed back at all and it is using 50% CPU no matter what. I am totally baffled. GPU clock speed had little to no effect which was extremely strange, signifying some other problem. Disabling FFT3DGPU in the filter stream brought speed up to the normal 100fps with both cores working. So it's gotta be something between the video card and the software.
Like I said I'll try reinstalling the video drivers tonight. I updated DirectX 9c to the April 2006 release. Could that be a prob? It worked fine for 3 passes of Divx though.
AI: what is wrong with
fft3dfilter(plane=0)
fft3dgpu(plane=1)
??
swaaye:
How does it behave if you replace fft3dgpu with fft3dfilter? Does it makes any difference using an older version of fft3dgpu? What if you use VDub without StaxRip? Installing the april edition of Dx shouldn't make any difference(as it only installs a single dll file that doesn't overwrite older versions). Has the cpu affinity been changed somehow so it only runs on 1 core (look in the taskmanager)
swaaye
4th May 2006, 03:01
I got a monstrous speedup by moving resize from AVISynth to the DIVX codec's internal resize option. VERY odd. But that filter was the problem. I went from 35fps to 50+fps!
Now there are no filters after FFT3DGPU. So perhaps having filters after it can mess it up performance-wise?
edit: it's back to its old slow self again. Something strange is sure happening here. It's like DIVX gets locked to a single thread sometimes. But it's only with FFT3DGPU in use... and then there are the random times when it works and I get up to 90% CPU and 50+fps!
Swaaye: Try this (http://www.avisynth.org/tsp/fft3dgpu0.6.2.2.exe) version and see if it behaves better. I disabled the part of the code that only allows fft3dgpu to run in one thread at a time.
swaaye
5th May 2006, 00:36
Okay I tried a bunch of tests with the new version. I think I've narrowed the problem down to bt=3.
FFT3dGPU(sigma=2,bt=2,sharpen=0.5) = 45-60 fps
FFT3dGPU(sigma=2,bt=3,sharpen=0.5) = 32-40 fps
MPEG2Source("ddddd", idct=3)
tfm(d2v="ddddd")
tdecimate(hybrid=1)
FFT3dGPU(sigma=2,bt=2,sharpen=0.5)
Basically there is a huge difference in speed with bt=3 vs. bt=2 or lower. What's odd is that I'm fairly sure I saw bt=3 doing that faster speed in an earlier run, but I don't see it now.... Interestingly, running my X800GTO2 at 400/500 vs. 500/610 has an almost unnoticeable impact on speed at the bt=3 setting whereas with the bt=2 speed it gets me 10fps more or so. bt=4 runs at about the same speed as bt=3.
Also, having filters after FFT3DGPU drops the framerate to the level of bt=3 regardless of the actual filter settings, even default settings (ie FFT3DGPU() ).
well higher bt means more to do for the GPU allthough it is somewhat strange that you don't see any difference when overclocking it. On my comp(opteron 165 currently @ 1.8GHz and a Geforce 7800GT 500/700(GPU/Mem) I get 45-48fps with bt=2 and 47-50 fps with bt=3. This is with no encoding.
One of the reason you might see a framedrop with filters after fft3dgpu is that they are not executed parralel with fft3dgpu.
Is there any change with the cpu utilization between bt=2 and bt=3?
swaaye
6th May 2006, 02:53
I tested the bt=3 and overclocking again and there does seem to be a difference after all. During encoding it'll vary between 30 and 50fps. Quite a range. I upped the DIVX quality slider to 7 (!!!) and with that I saw about 80% CPU.
I think I was getting thrown off by the initial slow 30fps. It starts off a lot faster at bt=2.
G_M_C
10th May 2006, 10:21
Up till now i've been using FFT3D filter to clean op my video before processing, and upon encoding i get avg. 7 fps using XviD (very slow for a dual Xeon, but hey . . . im still learning. SMP is next on the list for instance).
This is a very simple script im running now
LoadPlugin("C:\Program Files\Video-Programs\DLLs\DGDecode.dll")
mpeg2source("C:\AVI-Forge\Input.D2V",idct=3)
Crop(0,16,0,-16)
Tweak(sat=1.1, bright=1.4, cont=0.96)
LanczosResize (688,384)
fft3dfilter(sigma=2, plane=4)
But today my new Graphics Board has arrived, a Gainward BLISS 7800GS GoldenSample plus with 512 Mb and the full 24 pipelines :) (AGP btw).
Later today ill adapt my script to use FFT3DGPU in stead of teh "non GPU" version. Im very curious to see what a difference it will make.
As said my sctipt is running @ 7 fps now and its doing the 1st pass of a 2-pass encode . With the second pass ill use the GPU version. So it will be a "honest" compere betweet the two :)
PS: Is this filter more dependend on the "number op pipelines" or "the number of shaders" ?
fft3dgpu is mainly limited by memory bandwidth (memory clock and width). So I would say that more pipelines is better than more shaders per pipeline but faster memory is even better.
To get the most fair compairison between fft3dfilter and fft3dgpu use
fft3dgpu(sigma=2,plane=4,precision=2,bw=64,bh=64,ow=24,oh=24)
and I will recomend using the same script for both passes as the are minor differences between the output from fft3dgpu and fft3dfilter.
G_M_C
10th May 2006, 16:03
Thx for your answer :)
Anyway, using GPU now, and fps is up by 300% (21 ~22 fps in stead of 7) :D
So basically, its faster to do a new 1st pass and then a new 2nd pass. Because 2 passes with FFT3DGPU is faster then 1 pass with "regular" FFT3D (wow).
I'm very impressed http://gathering.tweakers.net/global/smileys/worshippy.gif
Very many Kudo's to you man. Amazing stuff !
Btw. did you mean System memory or Graphics memory in your post before ?
Is that speed with fft3dgpu(sigma=2,plane=4,precision=2,bw=64,bh=64,ow=24,oh=24)?
The Geforce 7900 is a rather fast card.
I mean Graphics memory. The fft version I work on now should be less memory bandwidth dependent as I have cut down the number of texture lookup
G_M_C
10th May 2006, 21:53
Is that speed with fft3dgpu(sigma=2,plane=4,precision=2,bw=64,bh=64,ow=24,oh=24)?
The Geforce 7900 is a rather fast card.
I mean Graphics memory. The fft version I work on now should be less memory bandwidth dependent as I have cut down the number of texture lookup
Yes, I've modified my script exactly as you specified in your posting, with fft3dgpu(sigma=2,plane=4,precision=2,bw=64,bh=64,ow=24,oh=24). I was amazed too at the very big speed gain.
And speaking of the GPU; I've bought my card as a 7800GS GoldenSamplePlus, BLISS edition. I allways thought the 7800 series had a G70 class GPU.
But when i removed the cooler today (to change the heatpaste&heatpads to Arctic Silver 5) i saw that my card actually had a G71 on it. I mention this because its indeed a 7900GTX in AGP format. The difference between my version and the "real" 7900GTX is slower mem (512 Mb GDDR3 @ 1250 MHz). So im sort a lucky I guess buying a 7800 and getting a 7900 (BLISS indeed ;) )
I never would have guessed it would be this fast, even with my AviSynth scripts this new Graphics board speeds things up (guess what it does to my 3DMark scores :P).
But as i said; Hope you keep developing filters that use GPU, and I hope others follow suit. Because results are absolutely amazing. Many complements on your work, and i'll keep using your filter (and hopefully more GPU filters in the future) :)
swaaye
11th May 2006, 22:31
So would SM2b add anything useful for FFT3DGPU & ATI's Xx00 series? Or do you think that would be a waste of your time (TSP) to implement?
I'd also like to see some of the favorite settings of the forumgoers here. I've settled on:
FFT3dGPU(sigma=2,bt=2,sharpen=0.5)
for speed and quality. My overclocked X800GTO2 at 510/610 can pull about 55fps with this. I run this with DIVX set at quality=4 on the slider and use DIVX's internal resizer that's multithreaded. Gives me about 90% CPU so I don't slow down because of either GPU or CPU.
So would SM2b add anything useful for FFT3DGPU & ATI's Xx00 series? Or do you think that would be a waste of your time (TSP) to implement?
well it is allready implemented. The code in fft3dgpu.hlsl is compiled and optimized by directx using the best shader model your card support (that is0 SM 2.0 for Radeon 9xxx,SM 2a for geforce fx 5xxx, SM 2b for Radeon Xxxx, SM 3 for Geforce 6xxx,7xxx and Radeon X1xxx)
G_M_C
12th May 2006, 08:28
[offtopic & Brainstorm]
Reading one of you previous postings, i understood that you treat the AviSynth fram an a texture for processing with FFT3DGPU.
That would mean you've implemented a system to transfer the avisynth fram to the texture-buffer and back.
But now the brainstorm: Since you've got a frame into the texture buffer, it would be "kind of easy" toe implement a rezise to it, wouldn't it ? Rezising textures is one of the main functions of a graphics card after all.
This would be a usefull function, because a Graphics card has much more advanced functions for resizing than AviSynth. All GPU's support trilinear resizing for instance, and AviSynth doesn't up till now. And modern GPU's even have more advanced methods than trilinear allone ("called advanced" or "optimal" or such). And added to the advanced methods, most modern GPU's can do a AntiAliasing stage when resizing, if i'm not mistaking.
And this all would be bazingly fast, since it is one of the most optimized functions of any GPU.
So: What would your thoughts be on a "GPUresize ()" function ?
[/offtopic & Brainstorm]
[offtopic & Brainstorm]
So: What would your thoughts be on a "GPUresize ()" function ?
[/offtopic & Brainstorm]
Called "Haali renderer" :) As for advanced resizing, I dont' think cards natively support Lanczos. And even bicubic resizing is not straightforward and require quite a lot of GPU resources.
Fizick
12th May 2006, 19:32
http://www.avisynth.org/JapanesePlugins
G_M_C
12th May 2006, 23:57
http://www.avisynth.org/JapanesePlugins
Thx,
never thought of looking in that section ... because my Japanese isn't up to spec atm :D
Guess i missed something ;)
Called "Haali renderer" :) As for advanced resizing, I dont' think cards natively support Lanczos. And even bicubic resizing is not straightforward and require quite a lot of GPU resources.
GPU resources I have enough (I think) since my new card arrived ;)
But what i meant is that there are some "standard" filtering / resizing methodes build into the hardware of any GPU that have a equivelant command in AviSynth (bilinear). Those could be "transferred" to the GPU to gain speed, at least that was my thought. And doing so could gain at least one extra resizing method; Trilinear, wich isnt in AviSynth, but is standard in all GPU's.
foxyshadis
13th May 2006, 00:25
Trilinear isn't made for the totally planar video frames, though. It'd be interesting if someone came up with a good way to use it, but the way trilinear works is that it uses prerendered larger and smaller textures, interpolates both to the desired size, and averages them, weighting based on how close the result is to each prerendered size. (The gpu has certain efficiency requirements, like each step up being a power of two.) Thing is, how often do you have two videos, one twice the size of the other, that you can pass to the gpu?
I can only name one: When using eedi2 reconstruction.
You'd be better off implementing spline or gaussian, or even some crazy vector/fractal resize, in the gpu if you want the top quality, or bilinear/bicubic for hardware asic speed.
G_M_C
13th May 2006, 02:20
Ive been watching GPU programmabillity for some time now, and awaiting the first atual uses it would have for me personally. FFT3DGPU is one of the first more "gereral" apps designed to take advantage of the computational power of the GPU.
Stanford univerety has been doing a lot of research in to the usage of GPU's in geberal progamming. Much of their research is open sourced, and might be of some use.
So i give the link: http://graphics.stanford.edu/projects/brookgpu/index.html
Ive been watching GPU programmabillity for some time now, and awaiting the first atual uses it would have for me personally. FFT3DGPU is one of the first more "gereral" apps designed to take advantage of the computational power of the GPU.
I would call Haali renderer much more "general app" than FFT3DGPU. Besides, even older builds of mpc used bicubic resizing implemented with PS 2.0 (i.e. GPU was used).
foxyshadis
13th May 2006, 02:41
3D renderers, like Maya, and video software like Combustion and AE, have been able to use them for years too, although mostly limited to the Quadro/FireGL lines of pro cards (because the GeForce/Radeon drivers are slightly crippled, though hardware is nearly identical, a bit of a scam). AGP also wasn't really suited to GPU computation at all - returning to main memory is painfully slow - so the PCIe transition has started the evolution now.
Another GPU filter by antitorgo: http://forum.doom9.org/showthread.php?t=86793
As foxyshadis stated trilinear filtering wouldn't be all that usefull even if non power of two textures can be used (as on geforce 6xxx/7xxx and maybe radeon X1xxx) more advanced resizers can be used as postprocesing using shaders (and is used in virtualdub) but currently it is not one of my highest priority.
G_M_C: The first two versions of fft3dgpu was created with brook.
swaaye
15th May 2006, 01:37
Well honestly the GPU is tapped out pretty much just doing fft3DGPU. If you're running a dual core setup the GPU quickly becomes the bottleneck, unless of course you were using fft3dfilter or some such. I didn't even bother with noise filtering until this GPU filter. Speed is fairly critical for me. The normal resizers don't seem to have that much overhead relatively, especially DIVX's multithreaded resizers in their codec.
I'd like to hear from someone endowed with a SLI/Crossfire setup. :)
You can use another GPU filter after fft3dgpu without interfering with it. Unfortunatly SLI/Crossfire doesn't work with fft3dgpu as there would be excesive texture transfers from one GPU to anhother when running in Split frame rendering and Alternative frame rendering wouldn't work because fft3dgpu needs the result from the previous frame.
new test version 0.6.2.9 that includes new fft code. Should improve speed for larger bw, bh size(>32). Doesn't work with geforce fx 5xxx card currently. Please try it and report back if you experience slowdown or other problem with.
Link:
http://www.avisynth.org/tsp/fft3dgpu0.6.2.9.exe
modsoul
26th May 2006, 10:50
i ried using this simple scriupt as a beginnig test
directshowsource("C:\anime\black
cat\[Ani-Kraze]_Black_Cat_-_01_[C93856CD].avi")
ConvertToYV12()
fft3dgpu (sharpen=3)
but i get this error
error X1507 failed to open source file C:\program file\ avi synth 2.5\plugins\ps.hlsl
what am i doing wrong.
Boulder
26th May 2006, 11:02
Do you have the ps.hlsl file in your Avisynth plugins directory?
modsoul
26th May 2006, 11:06
NOPE. its not there. where can i find. it.
modsoul
26th May 2006, 11:30
ok i renamed fft3dgpu.hlsl to ps.hlsl ( i did not remove fft3dgpu.hlsl)
is that what i am supposed to do
forgot to mention. now it gives error
"sharpen entry point not found.
is my script ok ?
ok i downloaded version 0.47 and that seems to have the pd.hlsl file. usingthat file and the dlls from the latest version i can run it. am i doing this all wrong ?
where can i find. it.see first message in this thread
PS manual (http://avisynth.org.ru/docs/english/externalfilters/fft3dgpu.htm)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.