Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 7th August 2015, 17:18   #261  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
OK. Testing with AVSMeter.

With device_type="GPU" I get 32fps with a simple script @ 50% CPU usage, and without it, I get 11fps @ 100% CPU usage.

Yet, MSI Afterburner still doesn't show any GPU usage. Perhaps it doesn't detect and report it properly, is there a better software to use to measure GPU usage?
MysteryX is offline   Reply With Quote
Old 7th August 2015, 17:27   #262  |  Link
detmek
Registered User
 
Join Date: Aug 2009
Posts: 463
Try with GPU-Z.
__________________
Intel Pentium G3220, Asus H81M-K, 4GB DDR3@1600MHz (1333MHz working), LG W1934S, Windows 8.1 Pro x64
detmek is offline   Reply With Quote
Old 7th August 2015, 17:45   #263  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
GPU-Z reports a 2% load on the Intel HD 4000... AVSMeter is rendering at 36fps

Increasing MT mode from 8 threads to 16 threads increases CPU usage and lowers performance to 22fps, with same 2% GPU usage.

Disabling MT results in 32fps with only 7% CPU usage, still 2% GPU usage.

It seems MT mode doesn't work well with KNLMeans, and that it's not making efficient use of the GPU.

Since MT provides no performance improvement whatsoever with KNLMeans, is there a way to disable MT only for that command? I'm using both AviSynth 2.6 and AviSynth+ so I'd need both syntaxes.

Last edited by MysteryX; 7th August 2015 at 17:50.
MysteryX is offline   Reply With Quote
Old 7th August 2015, 18:37   #264  |  Link
Khanattila
Registered User
 
Khanattila's Avatar
 
Join Date: Nov 2014
Posts: 440
Quote:
Originally Posted by MysteryX View Post
GPU-Z reports a 2% load on the Intel HD 4000... AVSMeter is rendering at 36fps

Increasing MT mode from 8 threads to 16 threads increases CPU usage and lowers performance to 22fps, with same 2% GPU usage.

Disabling MT results in 32fps with only 7% CPU usage, still 2% GPU usage.

It seems MT mode doesn't work well with KNLMeans, and that it's not making efficient use of the GPU.

Since MT provides no performance improvement whatsoever with KNLMeans, is there a way to disable MT only for that command? I'm using both AviSynth 2.6 and AviSynth+ so I'd need both syntaxes.
1) MT is not good program in general. Best avoided.
2) Are you sure you are using the AMD discrete and not the integrated GPU?

EDIT. If you want a technical explain, OpenCL provides parallel computing using task-based and data-based parallelism.
MT only creates unnecessary queues.

Last edited by Khanattila; 7th August 2015 at 18:54.
Khanattila is offline   Reply With Quote
Old 7th August 2015, 18:40   #265  |  Link
Khanattila
Registered User
 
Khanattila's Avatar
 
Join Date: Nov 2014
Posts: 440
Quote:
Originally Posted by MysteryX View Post
Huh... it was using the CPU device by default! That explains.



By adding device_type="GPU", it performs MUCH faster. But even with a script that doesn't do any heavy operation besides KNLMeansCL with D=3, A=3, I still barely see any GPU usage in Afterburner while the video plays slowly.
By default uses your default device OpenCL. More default so.
Khanattila is offline   Reply With Quote
Old 7th August 2015, 18:55   #266  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
It is currently using the Intel integrated chipset (HD 4000), and perhaps there's no point in using the Radeon if it's under-utilizing it in such a way? I'll try with the Radeon and see if results are different.
MysteryX is offline   Reply With Quote
Old 7th August 2015, 19:04   #267  |  Link
Khanattila
Registered User
 
Khanattila's Avatar
 
Join Date: Nov 2014
Posts: 440
Quote:
Originally Posted by MysteryX View Post
It is currently using the Intel integrated chipset (HD 4000), and perhaps there's no point in using the Radeon if it's under-utilizing it in such a way? I'll try with the Radeon and see if results are different.
The fastest solution is to uninstall the Intel OpenCL driver.

EDIT. Or edit HKEY_LOCAL_MACHINE \ SOFTWARE \ Khronos \ OpenCL \ Vendors. More or less.

Last edited by Khanattila; 7th August 2015 at 19:13.
Khanattila is offline   Reply With Quote
Old 7th August 2015, 21:25   #268  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by MysteryX View Post
OK. Testing with AVSMeter.

With device_type="GPU" I get 32fps with a simple script @ 50% CPU usage, and without it, I get 11fps @ 100% CPU usage.
What source? Post the full script. Apart from that, the result with device_type="GPU" looks pretty good compared to the other one. It's not only 3 times faster, it also reduces the CPU load significantly.

Yet, you somehow seem dissatisfied.
Groucho2004 is offline   Reply With Quote
Old 7th August 2015, 22:14   #269  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
I tried running it on the Radeon, and can't get it to run on the Radeon. On a dual-graphics system, I set the application as "High Performance" for the Radeon or "Power Saving" for the Intel HD.

This time I'm getting 7-10% usage on the Intel HD 4000.

If I set AVSMeter.exe to run on High Performance, or on Power Saving, it's still running on the Intel HD 4000 either way with exactly the same performance. I tried changing it for cmd.exe, and that still doesn't switch it to the Radeon. With that low usage, it's not really an issue.

What makes more of a difference is the very high CPU usage when running in MT mode. I don't have any issues with MT so far; only this performance issue here. The output looks good, but is this plugin compatible with MT, or is there side-effects in terms of quality?

Here's the script, when running in MT mode. It gives 30-32fps no matter if it's High Performance or Power Saving, and with or without MT. The only difference is that without MT CPU usage is 7%, with MT it goes up to 50%. The rest of the script is very CPU intensive and requires MT.

Cores=8
SetMTMode(3,Cores)
AviSource("Preview.avi", audio=false, pixel_type="YV12")
SetMTMode(2)
ColorMatrix(mode="Rec.601->Rec.709")
Crop(0, 0, -10, -0)
KNLMeansCL(D=2, A=1, h=3, device_type="GPU")
Distributor()
MysteryX is offline   Reply With Quote
Old 7th August 2015, 23:29   #270  |  Link
Khanattila
Registered User
 
Khanattila's Avatar
 
Join Date: Nov 2014
Posts: 440
Quote:
Originally Posted by MysteryX View Post
I tried running it on the Radeon, and can't get it to run on the Radeon. On a dual-graphics system, I set the application as "High Performance" for the Radeon or "Power Saving" for the Intel HD.

This time I'm getting 7-10% usage on the Intel HD 4000.

If I set AVSMeter.exe to run on High Performance, or on Power Saving, it's still running on the Intel HD 4000 either way with exactly the same performance. I tried changing it for cmd.exe, and that still doesn't switch it to the Radeon. With that low usage, it's not really an issue.

What makes more of a difference is the very high CPU usage when running in MT mode. I don't have any issues with MT so far; only this performance issue here. The output looks good, but is this plugin compatible with MT, or is there side-effects in terms of quality?

Here's the script, when running in MT mode. It gives 30-32fps no matter if it's High Performance or Power Saving, and with or without MT. The only difference is that without MT CPU usage is 7%, with MT it goes up to 50%. The rest of the script is very CPU intensive and requires MT.

Cores=8
SetMTMode(3,Cores)
AviSource("Preview.avi", audio=false, pixel_type="YV12")
SetMTMode(2)
ColorMatrix(mode="Rec.601->Rec.709")
Crop(0, 0, -10, -0)
KNLMeansCL(D=2, A=1, h=3, device_type="GPU")
Distributor()
KNLMeansCL is not compatible with MT.
Why? Because it's written in OpenCL, as if it were already multithreaded.
In addition, the GPU works in a different way, it is not that simple.

Try uninstalling "OpenCL™ Driver for Intel® Iris™ and Intel® HD".
So it is forced to use only the AMD.
__________________
github.com
Khanattila is offline   Reply With Quote
Old 8th August 2015, 00:59   #271  |  Link
amayra
Quality Checker
 
amayra's Avatar
 
Join Date: Aug 2013
Posts: 285
is this work with madVR ?
__________________
I love Doom9
amayra is offline   Reply With Quote
Old 8th August 2015, 01:10   #272  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,666
Quote:
Originally Posted by Khanattila View Post
KNLMeansCL is not compatible with MT.
Why? Because it's written in OpenCL, as if it were already multithreaded.
In addition, the GPU works in a different way, it is not that simple.
SEt said this about nnedi3ocl:
Quote:
Originally Posted by SEt View Post
...
MTMode to use: 2.
....
Major speed note 2.
The OpenCL code is quite optimized, but memory transfers are not. So, much time is lost there. Using high number of threads with MTMode 2 (even more than physical threads your CPU has) is the best workaround for now.
I guess the same does not apply to KNLMeans? Then again using a high number of threads would probably only be beneficial if you're just using strictly OpenCL (or GPU) plugins, I doubt it would work efficiently when you start mixing CPU and GPU filters in complex scripts.

---

Groucho2004: Imagine Donald Trump and Usain Bolt going for a run together. Who do you think will sweat less?

LOL, good one

Last edited by Reel.Deel; 8th August 2015 at 03:49. Reason: add off topic coment
Reel.Deel is offline   Reply With Quote
Old 8th August 2015, 03:30   #273  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
Quote:
Originally Posted by Reel.Deel View Post
SEt said this about nnedi3ocl:


I guess the same does not apply to KNLMeans? Then again using a high number of threads would probably only be beneficial if you're just using strictly OpenCL (or GPU) plugins, I doubt it would work efficiently when you start mixing CPU and GPU filters in complex scripts.
It's not the case here. Increasing the threads greatly increase CPU usage while providing no performance benefit whatsoever.

Yet I can't throw away MT for what I'm doing.

I'm developing this for a redistributable application; starting to play with drivers and registry is a bad idea. Not something I'd do on other machines.
MysteryX is offline   Reply With Quote
Old 8th August 2015, 07:07   #274  |  Link
foxyshadis
Angel of Night
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,559
Just use SetMTMode(5) or 6 before KNLMeans. That's a necessary step for any filter that doesn't support external multithreading.

Or use VapourSynth, KNLMeans works correctly with its automatic multithreading.
foxyshadis is offline   Reply With Quote
Old 8th August 2015, 10:17   #275  |  Link
Khanattila
Registered User
 
Khanattila's Avatar
 
Join Date: Nov 2014
Posts: 440
Quote:
Originally Posted by Reel.Deel View Post
SEt said this about nnedi3ocl:


I guess the same does not apply to KNLMeans? Then again using a high number of threads would probably only be beneficial if you're just using strictly OpenCL (or GPU) plugins, I doubt it would work efficiently when you start mixing CPU and GPU filters in complex scripts.

---

Groucho2004: Imagine Donald Trump and Usain Bolt going for a run together. Who do you think will sweat less?

LOL, good one
Copy the data host-to-device and device-to-host does not take long. Of course you can do it in multiple threads, but the difference is minimal.
__________________
github.com
Khanattila is offline   Reply With Quote
Old 25th August 2015, 22:18   #276  |  Link
Xebika
Registered User
 
Join Date: May 2014
Location: Denmark
Posts: 50
I got a problem when i open a script with KNLMeans.

The loading is taking long time and when i click on VirtualDub and MeGUI it just crashes with message "Not Responsing"

I have tried with different version of KNLMeans and Geforce drivers.

And i also tried a clean installation of Windows 10 x64
Xebika is offline   Reply With Quote
Old 26th August 2015, 11:57   #277  |  Link
Khanattila
Registered User
 
Khanattila's Avatar
 
Join Date: Nov 2014
Posts: 440
v0.6.0 release: https://github.com/Khanattila/KNLMeansCL/releases.
__________________
github.com
Khanattila is offline   Reply With Quote
Old 26th August 2015, 11:59   #278  |  Link
Khanattila
Registered User
 
Khanattila's Avatar
 
Join Date: Nov 2014
Posts: 440
Quote:
Originally Posted by Xebika View Post
I got a problem when i open a script with KNLMeans.

The loading is taking long time and when i click on VirtualDub and MeGUI it just crashes with message "Not Responsing"

I have tried with different version of KNLMeans and Geforce drivers.

And i also tried a clean installation of Windows 10 x64
Post the script.
__________________
github.com
Khanattila is offline   Reply With Quote
Old 26th August 2015, 12:47   #279  |  Link
Xebika
Registered User
 
Join Date: May 2014
Location: Denmark
Posts: 50
Code:
LoadPlugin("C:\Video\MeGUI\tools\dgindexnv\DGDecodeNV.dll")
DGSource("C:\Video\Video.dgi",fieldop=0, deinterlace=1)
crop(24, 0, -8, -6)
Spline36Resize(768,576)
Levels(5, 1, 255, 0, 255)
SmoothContrast(contrast=0.2, sat=0.1)
LSFmod(defaults="slow")
KNLMeansCL(D=1, A=1, h=4.5)
Xebika is offline   Reply With Quote
Old 26th August 2015, 13:33   #280  |  Link
Khanattila
Registered User
 
Khanattila's Avatar
 
Join Date: Nov 2014
Posts: 440
Quote:
Originally Posted by Xebika View Post
Code:
LoadPlugin("C:\Video\MeGUI\tools\dgindexnv\DGDecodeNV.dll")
DGSource("C:\Video\Video.dgi",fieldop=0, deinterlace=1)
crop(24, 0, -8, -6)
Spline36Resize(768,576)
Levels(5, 1, 255, 0, 255)
SmoothContrast(contrast=0.2, sat=0.1)
LSFmod(defaults="slow")
KNLMeansCL(D=1, A=1, h=4.5)
It seems correct. Version of AviSynth?
It is possible that MeGUI uses its version included.
__________________
github.com
Khanattila is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:40.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.