View Full Version : KNLMeansCL: OpenCL NLMeans de-noising algorithm [2018-01-29]
Khanattila
12th December 2016, 23:07
I'm also looking for official document for new version...
Update: oh the next version will be documented, that's great!
I have to finish to update the wiki ;)
WolframRhodium
13th December 2016, 01:16
I have to finish to update the wiki ;)
That wiki helps me a lot, thank you.
Anyway, isn't the default value of "wmode" is 1(DFT_WMODE)? The wiki says by default the value is 0. And there are 3 kind of Bisquare weighting function but the wiki just mention 2.
dipje
13th December 2016, 09:24
Easiest is to say, that while the 1.0 branch is in 'beta' the doc and wiki will be outdated or have a chance to be incorrect. It's a beta for a reason, a quick release to find problems, not to have a complete finished and documented release :P.
Then again, there are a lot of plugins and products around here that never leave the beta phase so. mweh :).
tormento
13th December 2016, 13:33
A beta can't be really tested until parameters are known :)
Khanattila
13th December 2016, 16:27
A beta can't be really tested until parameters are known :)
Done (https://github.com/Khanattila/KNLMeansCL/wiki/Filter-description).
tormento
13th December 2016, 17:40
Done (https://github.com/Khanattila/KNLMeansCL/wiki/Filter-description).
Great. Thanks.
tormento
14th December 2016, 10:36
Maybe because "wmode" has changed? For v1.0.0-beta.1, you should set it to 0 (Welsch weighting function), which is used in v0.7.7 by default.
It seems it is the default value for both releases.
So, I dunno why output bitrate changed.
WolframRhodium
14th December 2016, 10:44
It seems it is the default value for both releases.
So, I dunno why output bitrate changed.
I just read the source code and perhaps I made a mistake.
The update log mentions "Improved de-noising quality around image edge." Maybe that's the reason?
Update:
I have made another test of v1.0.0-beta.1 on vapoursynth just now.
Yes, the default value of "wmode" is 1 for both version, but in v0.7.7, it indicates "Welsch weighting function", while in v1.0.0-beta.1, it indicates "Modified Bisquare weighting function", so what I have suggested you before to set it to 0 for v1.0.0-beta.1 is to return to use "Welsch weighting function".
I'm sorry for my poor English expression. I'm not a native English speaker.
Khanattila
14th December 2016, 11:58
I just read the source code and perhaps I made a mistake.
The update log mentions "Improved de-noising quality around image edge." Maybe that's the reason?
Update:
I have made another test of v1.0.0-beta.1 on vapoursynth just now.
Yes, the default value of "wmode" is 1 for both version, but in v0.7.7, it indicates "Welsch weighting function", while in v1.0.0-beta.1, it indicates "Modified Bisquare weighting function", so what I have suggested you before to set it to 0 for v1.0.0-beta.1 is to return to use "Welsch weighting function".
I'm sorry for my poor English expression. I'm not a native English speaker.
There were several problems in the release of v1.0.0-beta1, so before I make other changes I release beta2.
https://github.com/Khanattila/KNLMeansCL/releases/tag/v1.0.0-beta.2
tormento
14th December 2016, 12:33
Yes, the default value of "wmode" is 1 for both version, but in v0.7.7, it indicates "Welsch weighting function", while in v1.0.0-beta.1, it indicates "Modified Bisquare weighting function", so what I have suggested you before to set it to 0 for v1.0.0-beta.1 is to return to use "Welsch weighting function".
Nope. Welsch is the default wmode with both even with different wmode numbers, i.e. 1 for 0.7.7 and 0 for 1.0.
Different noise treatment should be somewhere else. Khanattila, can you please tell us what is under the hood? :)
WolframRhodium
14th December 2016, 12:40
Nope. Welsch is the default wmode with both even with different wmode numbers, i.e. 1 for 0.7.7 and 0 for 1.0.
Different noise treatment should be somewhere else. Khanattila, can you please tell us what is under the hood? :)
khanattila just pushed the last commit of v1.0.0-beta.2, which is "Change default value of wmode" (https://github.com/Khanattila/KNLMeansCL/commit/0a1af6c9b1710f9a723adf0a03573bd0e5ccedf1)
Khanattila
14th December 2016, 13:08
Nope. Welsch is the default wmode with both even with different wmode numbers, i.e. 1 for 0.7.7 and 0 for 1.0.
Different noise treatment should be somewhere else. Khanattila, can you please tell us what is under the hood? :)
v0.7.7 wmode=1 -> Welsch
v1.0.0 beta1 wmode=1 (my fault) -> Bisquare
v1.0.0 beta2 wmode=0 -> Welsch
feisty2
14th December 2016, 13:14
https://www.mathworks.com/help/stats/robustfit.html
just in case if anyone's curious about the mathematic definition of each weighting function...
tormento
14th December 2016, 13:23
v0.7.7 wmode=1 -> Welsch
v1.0.0 beta1 wmode=1 (my fault) -> Bisquare
v1.0.0 beta2 wmode=0 -> Welsch
+3/5% bitrate difference from 0.7.7.
I invite other members to test some samples and report here.
WolframRhodium
14th December 2016, 13:27
I find strange stains at the border when using v1.0.0-beta.2, especially when "a" is large.
examples:
http://screenshotcomparison.com/comparison/193750
Just look at the top border of the filtered image. There are also some stains at the left/right border, but is nearly invisible.
The problems happens on both "channels".
tormento
14th December 2016, 13:35
How is possible to denoise a normal DGDecNV output on both Y and UV? If I left auto, it uses Y only, if I try YUV it tells me
error: KNLMeansCL: 'channels = YUV' require a YV24 pixel format!
Khanattila
14th December 2016, 13:41
I find strange stains at the border when using v1.0.0-beta.2, especially when "a" is large.
examples:
http://screenshotcomparison.com/comparison/193750
Just look at the top border of the filtered image. There are also some stains at the left/right border, but is nearly not visible.
The problems happens on both "channels".
I would say that the "Improved denoising image quality around edge" must be fixed :thanks:
Khanattila
14th December 2016, 13:56
How is possible to denoise a normal DGDecNV output on both Y and UV? If I left auto, it uses Y only, if I try YUV it tells me
error: KNLMeansCL: 'channels = YUV' require a YV24 pixel format!
As has always been...
a) Processes each channel independently.
b) Process "Y" and "UV" separately.
c) Converting to RGB, processing, and them back to YUV.
d) Other more elaborate methods.
feisty2
14th December 2016, 13:58
I would say that the "Improved denoising image quality around edge" must be fixed :thanks:
do some padding before the actual process, trivial to fix
tormento
14th December 2016, 14:01
As has always been...
a) Processes each channel independently.
b) Process "Y" and "UV" separately.
c) Converting to RGB, processing, and them back to YUV.
d) Other more elaborate methods.
e) ask kindly the programmer to add the feature :)
Khanattila
14th December 2016, 14:02
do some padding before the actual process, trivial to fix
It would be a step back, and that's what I want to avoid
real.finder
14th December 2016, 20:13
How is possible to denoise a normal DGDecNV output on both Y and UV? If I left auto, it uses Y only, if I try YUV it tells me
error: KNLMeansCL: 'channels = YUV' require a YV24 pixel format!
you can use SMDegrain_prefilters(4) and play with it settings ;)
tormento
15th December 2016, 14:49
you can use SMDegrain_prefilters(4) and play with it settings ;)
I was playing with plain beta before feeding it to SMDegrain.
real.finder
16th December 2016, 00:32
I was playing with plain beta before feeding it to SMDegrain.
even so
SMDegrain_prefilters =\\= SMDegrain
with SMDegrain_prefilters(4) you will get only KNLMeansCL output clip, and there is knlm_params to use other KNLMeansCL params
and you can feed that clip in SMDegrain if you want
like this
knlclip=SMDegrain_prefilters(4, knlm_params=", wmode=0")
SMDegrain(prefilter=knlclip)
WolframRhodium
16th December 2016, 03:04
Feature request:
Extra "mask" clip option
For each pixel in the output clip, if the value of corresponding pixel in "mask" is 0 (black), just copy the value from input clip; else, use NLM normally.
Hope this will reduce computation complexity a lot in some cases, althought the can also be achieved by mt_merge(source, KNLMeansCL(source), mask) but that's too slow when there's only few pixels need to be processed
tormento
16th December 2016, 13:43
knlclip=SMDegrain_prefilters(4, knlm_params=", wmode=0")
SMDegrain(prefilter=knlclip)
WOW! Never noticed SMDegrain_prefilters
feisty2
19th December 2016, 12:18
floating point support is corrupted in v1.0 beta2
Khanattila
19th December 2016, 13:11
Feature request:
Extra "mask" clip option
For each pixel in the output clip, if the value of corresponding pixel in "mask" is 0 (black), just copy the value from input clip; else, use NLM normally.
Hope this will reduce computation complexity a lot in some cases, althought the can also be achieved by mt_merge(source, KNLMeansCL(source), mask) but that's too slow when there's only few pixels need to be processed
It could be interesting.
floating point support is corrupted in v1.0 beta2
What kind of problem? Loss of precision or anything else?
feisty2
19th December 2016, 13:42
It could be interesting.
What kind of problem? Loss of precision or anything else?
an error message bitching about "input format not supported"
feisty2
4th January 2017, 08:36
can you fix the floating point support soon?
wanna give that new wmode a shot.
Khanattila
5th January 2017, 17:28
can you fix the floating point support soon?
wanna give that new wmode a shot.
Ok, I release the beta.3 in the next days.
dipje
5th January 2017, 21:12
@khanattila: What about the results of that 'benchmark only' build you did?
Are you going to put 'optimal' settings inside the plugin based on detected gpu / generation. are or you going to open up parameters like those so we can find our own optimal distribution with the final release?
Khanattila
6th January 2017, 15:26
@khanattila: What about the results of that 'benchmark only' build you did?
Are you going to put 'optimal' settings inside the plugin based on detected gpu / generation. are or you going to open up parameters like those so we can find our own optimal distribution with the final release?
Good point, the parameters will be already pre-calibrated, but you can overwrite them.
tormento
6th January 2017, 18:50
Good point, the parameters will be already pre-calibrated, but you can overwrite them.
I think a --preset value, such as in x264, with 4/5 max setting value groups would be nice and noob proof, better with too many parameters based on video card.
Speed is determined by total script, not only a plugin. I could trade some speed for better prefiltering or anything else.
dipje
6th January 2017, 20:05
But the parameters have nothing to do with quality or speed settings for the plugin. More a way to optimize the workload so it performs better for certain video cards.
Certain AMD generations need other parameters than other AMD cards or something. My otherwise speedy GTX 1060 needed really different (low) settings to gain maximum speed than the latest RX480 cards for instance.
This has nothing to do with quality or what the plugin does. More the way the plugin gives commands to the GPU as far as I get it .
hydra3333
17th January 2017, 15:35
Hello. A newbie type question, however worth asking since I find I am in need of guidance.
I wonder if you could clarify whether and when KNLMeansCL is appropriate to use as a plain denoiser by itself ? I noticed it's been used in SMDegrain however I am unclear if KNLMeansCL is appropriate for use as a denoiser in its own right, for example on a range of OTA TV captures for moderate denoising a la mdegrain1/2/3. Any advice or links to comparisons somewhere ?
Another objective is to attempt to identify GPU (eg OpenCL) based filters for the times when a fast workflow is OK, ie where some improved quality output is hoped for but not paramount and speed is valued. (Tools = ffmpeg and x264, portable vapoursynth_x64, win10_x64.)
So far I have only seen these GPU based filters
DGDecodeNV for GPU decoding / deinterlacing (nvidia PureVideo) / resizing - in vapoursynth
unsharp - an ffmpeg internal filter which uses OpenCL to sharpen
KNLMeansCL for denoising - OpenCL in vapoursynth
Do you know of any other GPU filters usable in vapoursynth, or ffmpeg, especially sharpeners ? Is there already a list somewhere ?
Thanks.
Khanattila
17th January 2017, 18:22
Hello. A newbie type question, however worth asking since I find I am in need of guidance.
I wonder if you could clarify whether and when KNLMeansCL is appropriate to use as a plain denoiser by itself ? I noticed it's been used in SMDegrain however I am unclear if KNLMeansCL is appropriate for use as a denoiser in its own right, for example on a range of OTA TV captures for moderate denoising a la mdegrain1/2/3. Any advice or links to comparisons somewhere ?
Another objective is to attempt to identify GPU (eg OpenCL) based filters for the times when a fast workflow is OK, ie where some improved quality output is hoped for but not paramount and speed is valued. (Tools = ffmpeg and x264, portable vapoursynth_x64, win10_x64.)
So far I have only seen these GPU based filters
DGDecodeNV for GPU decoding / deinterlacing (nvidia PureVideo) / resizing - in vapoursynth
unsharp - an ffmpeg internal filter which uses OpenCL to sharpen
KNLMeansCL for denoising - OpenCL in vapoursynth
Do you know of any other GPU filters usable in vapoursynth, or ffmpeg, especially sharpeners ? Is there already a list somewhere ?
Thanks.
I believe that my filter is the exception, not the rule.
Do not focus yourself on gpu based filters.
feisty2
17th January 2017, 19:02
Hello. A newbie type question, however worth asking since I find I am in need of guidance.
I wonder if you could clarify whether and when KNLMeansCL is appropriate to use as a plain denoiser by itself ? I noticed it's been used in SMDegrain however I am unclear if KNLMeansCL is appropriate for use as a denoiser in its own right, for example on a range of OTA TV captures for moderate denoising a la mdegrain1/2/3. Any advice or links to comparisons somewhere ?
Another objective is to attempt to identify GPU (eg OpenCL) based filters for the times when a fast workflow is OK, ie where some improved quality output is hoped for but not paramount and speed is valued. (Tools = ffmpeg and x264, portable vapoursynth_x64, win10_x64.)
KNLMeansCL itself is an "appropriate" and very high quality (theoretically better quality than motion compensation based filters like MDeGrain since motion compensation matches macroblocks in temporal dimension only and NLMeans does that in both spatial and temporal dimensions) denoiser, it has been misused to do other things thanks to folks like me, but that doesn't mean it has lost its original purpose, to work as a plain denoiser!
feisty2
17th January 2017, 19:09
Also it's a big mystery that how the hell NLMeans ended up acting as a "pre filter" for MDeGrain? You do realize that's like doing a motion compensation pre filtering for RemoveGrain, right?
EDIT: simple rule, the fancier filter gets to be the main filter, so MDeGrain should be the pre filter (rclip) and NLMeans should be the main filter.
real.finder
17th January 2017, 20:25
Also it's a big mystery that how the hell NLMeans ended up acting as a "pre filter" for MDeGrain? You do realize that's like doing a motion compensation pre filtering for RemoveGrain, right?
EDIT: simple rule, the fancier filter gets to be the main filter, so MDeGrain should be the pre filter (rclip) and NLMeans should be the main filter.
ask dogway, anyway maybe he want a pure temporal, and the knlmeans have blend artfact in temporal dimension
feisty2
17th January 2017, 21:08
ask dogway, anyway maybe he want a pure temporal, and the knlmeans have blend artfact in temporal dimension
I wouldn't be surprised about the "blending" artifacts since a lot of people that use this filter got an "a" value of 2 or 3 or so.
Apparently the term "Non-Local" is so rocket science and incomprehensible to them and ironically, it is the "Non-Local Means" filter they are using.
Set "a" to 32 and if you can still observe any blending artifacts, post a sample
Khanattila
18th January 2017, 11:26
https://github.com/Khanattila/KNLMeansCL/releases/tag/v1.0.0-beta.3
KNLMeansCL v1.0.0-beta.3
New:
* Improved performance with CPU.
* Improved performance with AMD GCN Architecture.
* Reduced CPU overload in some system.
* Two modified bisquare weighting functions.
* Advanced OpenCL parameters for fine tuning.
Changed:
* Replaced 'cmode' with 'channels' and added the options to only process the chroma.
* Increased the maximum 's' value to 8.
* Updated to VapourSynth R35.
Removed:
* Cauchy weighting function.
Fixed:
*Second clip 'rclip' in some circumstances.
It corrects the errors of the previous beta.
feisty2
19th January 2017, 10:12
http://i.imgur.com/MxVdYfp.png
something is still wrong..
feisty2
19th January 2017, 10:35
I located the error to "rclip", it will crash if rclip is not None
Khanattila
19th January 2017, 17:09
I located the error to "rclip", it will crash if rclip is not None
The bugs do not exist until someone discovers them, I am sure.
feisty2
19th January 2017, 17:33
The bugs do not exist until someone discovers them, I am sure.
I only test for floating point inputs, couldn't care less about all that integer crap.
http://i.imgur.com/rjGES9f.png
script works fine with v0.7.7
cork_OS
22nd January 2017, 11:17
Beta3 give this error (beta2 work ok):
OpenCL Platform
------------------------------------------------------------
CL_PLATFORM_VENDOR: Advanced Micro Devices, Inc.
CL_PLATFORM_NAME: AMD Accelerated Parallel Processing
CL_PLATFORM_VERSION: OpenCL 2.0 AMD-APP (2236.10)
CL_PLATFORM_PROFILE: FULL_PROFILE
OpenCL Device
------------------------------------------------------------
CL_DEVICE_VENDOR: Advanced Micro Devices, Inc.
CL_DEVICE_NAME: Pitcairn
CL_DRIVER_VERSION: 2236.10
CL_DEVICE_VERSION: OpenCL 1.2 AMD-APP (2236.10)
CL_DEVICE_PROFILE: FULL_PROFILE
CL_DEVICE_IMAGE_SUPPORT: 1
CL_DEVICE_IMAGE2D_MAX_WIDTH: 16384
CL_DEVICE_IMAGE2D_MAX_HEIGHT: 16384
CL_DEVICE_IMAGE_MAX_ARRAY_SIZE: 2048
Program Build
------------------------------------------------------------
CL_PROGRAM_BUILD_OPTIONS: -cl-single-precision-constant
-cl-denorms-are-zero
-cl-fast-relaxed-math
-Werror
-D NLM_CLIP_TYPE_UNORM
-D NLM_CLIP_REF_LUMA
-D NLM_WMODE_WELSCH
-D VI_DIM_X=720
-D VI_DIM_Y=480
-D HRZ_RESULT=1
-D VRT_RESULT=1
-D HRZ_BLOCK_X=32
-D HRZ_BLOCK_Y=8
-D VRT_BLOCK_X=32
-D VRT_BLOCK_Y=8
-D NLM_D=1
-D NLM_S=4
-D NLM_H=1.200000
-D NLM_WREF=1.000000
CL_PROGRAM_BUILD_LOG:
"C:\Users\cork_OS\AppData\Local\Temp\OCL7900T8.cl", line 19: error: global
variable declaration is corrected by the compiler to have addrSpace
constant
const sampler_t nne = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_NONE | CLK_FILTER_NEAREST;
^
"C:\Users\cork_OS\AppData\Local\Temp\OCL7900T8.cl", line 20: error: global
variable declaration is corrected by the compiler to have addrSpace
constant
const sampler_t clm = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP | CLK_FILTER_NEAREST;
^
2 errors detected in the compilation of "C:\Users\cork_OS\AppData\Local\Temp\OCL7900T8.cl".
Frontend phase failed compilation.
RETURN: 0
jmac698
24th January 2017, 12:12
Does this work with opencl 1.1? I have Fermi/Nvidia. Maybe before version 0.7?
Groucho2004
24th January 2017, 12:36
Does this work with opencl 1.1? I have Fermi/Nvidia. Maybe before version 0.7?
See here (https://github.com/Khanattila/KNLMeansCL/wiki/Requirements), last paragraph.
jmac698
24th January 2017, 12:51
Right, thanks. Testing.
Edit:
colorbars()
KNLMeansCL()
Plugin was designed for a later version of Avisynth
Am using Avisynth+ 0.1 (r1576, x86)
Also another question, if it did work with x64 version of Avs+, and I used 64bit version of plugin, would I then need 64bit version of vc2013?
Was hoping to use it with Avs+.
Will try to find a later version.
Edit 2:
Found latest build on page 145 of Avisynth+ thread.
http://www.mediafire.com/file/bazu8v58ab318j6/avsplus-r2397.7z
Edit 3:
Used Avs+ 0.1 (r2397, MT, i386)
KNLMeansCL: AviSynthCreate error (clBuildProgram)!
Please report Log-KNLMeansCL.txt
I can't find that .txt file.
Edit 4:
Got it to work :)
Avs 2.60
KNLMeansCL(device_type="GPU")
Also found the log file now (and maybe was previously) at same place as .avs file.
The errors were:
---------------------------------
*** Error in OpenCL compiler ***
---------------------------------
# Build Options
-cl-single-precision-constant -cl-denorms-are-zero -cl-fast-relaxed-math -Werror -D H_BLOCK_X=32 -D H_BLOCK_Y=4 -D V_BLOCK_X=32 -D V_BLOCK_Y=4 -D NLMK_TCLIP=76 -D NLMK_S=4 -D NLMK_WMODE=1 -D NLMK_TEMPORAL=0 -D NLMK_H2_INV_NORM=185.828175 -D NLMK_BIT_SHIFT=0
# Build Log
:119:47: error: double precision constant requires cl_khr_fp64, casting to single precision
:122:40: error: double precision constant requires cl_khr_fp64, casting to single precision
:125:43: error: double precision constant requires cl_khr_fp64, casting to single precision
So I had to set device type to GPU. Works with Nvidia Fermi and opencl 1.1.
Next: to test avs+ again, then benchmark.
jmac698
24th January 2017, 13:50
Tested by playing in media player, running at 30fps results in 97% GPU usage and 24% memory controller load. I had to stop quickly because GPU reached 105deg C and could cause thermal shutdown. I guess I need a laptop cooler to use this :(
Edit:
This is a known issue with my laptop, the heatsink does not physicall touch the Nvidia chip, so there is only a thermal pad. The Nvida chip isn't as tall as the CPU. The mod solution is to insert a 0.8mm copper shim, which reduces temp by 20deg C. So until I can make this mod, I can't use OpenCL :(
The intel hd3000 can use directcompute, but OpenCL is not supported, though there is 1.2 emulation on CPU. Have you looked into this? Does anyone use DirectCompute? It should be supported on any dx10.1 GPU.
kgrabs
25th January 2017, 18:39
I got a log file to report, too. First, the script (same thing happens regardless of the KNL settings tho):
LWLibavVideoSource(source="00001.m2ts")
Dither_convert_8_to_16()
KNLMeansCL(d=1, a=2, s=0, h=7, channels="UV", device_type="GPU", lsb_inout=true)
DitherPost(mode=8)
And the log:
OpenCL Platform
------------------------------------------------------------
CL_PLATFORM_VENDOR: Advanced Micro Devices, Inc.
CL_PLATFORM_NAME: AMD Accelerated Parallel Processing
CL_PLATFORM_VERSION: OpenCL 2.0 AMD-APP (1800.8)
CL_PLATFORM_PROFILE: FULL_PROFILE
OpenCL Device
------------------------------------------------------------
CL_DEVICE_VENDOR: Advanced Micro Devices, Inc.
CL_DEVICE_NAME: BeaverCreek
CL_DRIVER_VERSION: 1800.8 (VM)
CL_DEVICE_VERSION: OpenCL 1.2 AMD-APP (1800.8)
CL_DEVICE_PROFILE: FULL_PROFILE
CL_DEVICE_IMAGE_SUPPORT: 1
CL_DEVICE_IMAGE2D_MAX_WIDTH: 16384
CL_DEVICE_IMAGE2D_MAX_HEIGHT: 16384
CL_DEVICE_IMAGE_MAX_ARRAY_SIZE: 2048
Program Build
------------------------------------------------------------
CL_PROGRAM_BUILD_OPTIONS: -cl-single-precision-constant
-cl-denorms-are-zero
-cl-fast-relaxed-math
-Werror
-D NLM_CLIP_TYPE_STACKED
-D NLM_CLIP_REF_CHROMA
-D NLM_WMODE_WELSCH
-D VI_DIM_X=960
-D VI_DIM_Y=540
-D HRZ_RESULT=1
-D VRT_RESULT=1
-D HRZ_BLOCK_X=32
-D HRZ_BLOCK_Y=8
-D VRT_BLOCK_X=32
-D VRT_BLOCK_Y=8
-D NLM_D=1
-D NLM_S=0
-D NLM_H=7.000000
-D NLM_WREF=1.000000
CL_PROGRAM_BUILD_LOG:
Warnings being treated as errors
"C:\Users\mikeay\AppData\Local\Temp\OCL6E22.tmp.cl", line 19: error: global
variable declaration is corrected by the compiler to have addrSpace
constant
const sampler_t nne = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_NONE | CLK_FILTER_NEAREST;
^
"C:\Users\mikeay\AppData\Local\Temp\OCL6E22.tmp.cl", line 20: error: global
variable declaration is corrected by the compiler to have addrSpace
constant
const sampler_t clm = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP | CLK_FILTER_NEAREST;
^
"C:\Users\mikeay\AppData\Local\Temp\OCL6E22.tmp.cl", line 198: error: "val_x"
has already been declared in the current scope
float val_x = native_divide(num_y, den);
^
"C:\Users\mikeay\AppData\Local\Temp\OCL6E22.tmp.cl", line 199: error:
identifier "val_y" is undefined
write_imagef(U1_out, s, (float4) (val_x, val_y, 0.0f, 0.0f));
^
"C:\Users\mikeay\AppData\Local\Temp\OCL6E22.tmp.cl", line 199: error: not
enough initializer values
write_imagef(U1_out, s, (float4) (val_x, val_y, 0.0f, 0.0f));
^
"C:\Users\mikeay\AppData\Local\Temp\OCL6E22.tmp.cl", line 295: error:
identifier "u" is undefined
write_imageui(R_lsb, s, (uint4) (u & 0xFF, 0u, 0u, 0u));
^
"C:\Users\mikeay\AppData\Local\Temp\OCL6E22.tmp.cl", line 295: error: not
enough initializer values
write_imageui(R_lsb, s, (uint4) (u & 0xFF, 0u, 0u, 0u));
^
"C:\Users\mikeay\AppData\Local\Temp\OCL6E22.tmp.cl", line 296: error:
identifier "v" is undefined
write_imageui(G_lsb, s, (uint4) (v & 0xFF, 0u, 0u, 0u));
^
"C:\Users\mikeay\AppData\Local\Temp\OCL6E22.tmp.cl", line 296: error: not
enough initializer values
write_imageui(G_lsb, s, (uint4) (v & 0xFF, 0u, 0u, 0u));
^
9 errors detected in the compilation of "C:\Users\mikeay\AppData\Local\Temp\OCL6E22.tmp.cl".
Frontend phase failed compilation.
RETURN: 0
and my version: Avisynth+ 0.1 (r2172, MT, i386) x86
...aaand my computer jazz:
Windows 7 Home Premium 64 bit, Service Pack 1
HP Pavilion dv7 Notebook
AMD A6-3400M APU with Radeon HD Graphics 1.40 GHz
RAM: 6GB (5.48 usable)
Everything is 32 bit, excluding my OS, and possibly my OpenCL driver by proxy. Not sure how to check tbh
The previous beta seemed to have some weird quirks too. With chroma processing it had green bleeding in around the borders. Luma-only mode seemed fine. v0.7.7 had no apparent issues
tormento
25th January 2017, 19:59
Everything is 32 bit, excluding my OS, and possibly my OpenCL driver by proxy. Not sure how to check tbh
Try with a pure 64 bit environment.
KNLMeans gave me problems on Win10_x64 with 32 bit encoding environment.
johnmeyer
25th January 2017, 22:10
I cannot get KNLMeansCL to load.
This one-line script:
loadPlugin("C:\Program Files\AviSynth 2.5\plugins\KNLMeansCL.dll")
Generates this error message ("unable to load ... KNLMeansCL ... error 0x7f"):
http://i177.photobucket.com/albums/w208/johnmeyer/VD%20Error_zpsqwcpqedk.jpg
I ran AVSMeter and generated these two logs:
AVSInfo
Log created with: AVSMeter 2.4.7 (x86)
[OS/Hardware info]
Operating system: Windows XP (x86) Service Pack 3 (Build 2600)
CPU (brand string): Intel(R) Core(TM) i7 CPU 965 @ 3.20GHz
CPU (code name): Bloomfield (Core i7)
CPU instructions sets: MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2
CPU clock (measured): 3340 MHz
CPU cores / Logical cores: 4 / 8
[Avisynth core info]
VersionString: AviSynth 2.60, build:Mar 9 2013 [13:28:27]
VersionNumber: 2.60
File version: 2.6.0.3
Interface Version: 5
Multi-threading support: Yes
Linker/compiler version: 10.0
Avisynth.dll location: C:\WINDOWS\system32\avisynth.dll
Avisynth.dll time stamp: 2013-03-09, 08:28:48 (UTC)
PluginDir2_5 (HKLM, x86): C:\Program Files\AviSynth 2.5\plugins
[CPP 2.5 / 32 Bit plugins]
C:\Program Files\AviSynth 2.5\plugins\AGC.dll
C:\Program Files\AviSynth 2.5\plugins\Average.dll
C:\Program Files\AviSynth 2.5\plugins\avisynth_c.dll
C:\Program Files\AviSynth 2.5\plugins\aWarpSharp.dll
C:\Program Files\AviSynth 2.5\plugins\deblock.dll [1.2.0.0]
C:\Program Files\AviSynth 2.5\plugins\deflicker.dll [0.4.0.0]
C:\Program Files\AviSynth 2.5\plugins\defreq.dll
C:\Program Files\AviSynth 2.5\plugins\DePan.dll [1.10.1.0]
C:\Program Files\AviSynth 2.5\plugins\DePanEstimate.dll [1.9.2.0]
C:\Program Files\AviSynth 2.5\plugins\descratch.dll [0.9.0.0]
C:\Program Files\AviSynth 2.5\plugins\despot.dll [3.6.1.0]
C:\Program Files\AviSynth 2.5\plugins\DGAVCDecode.dll [1.0.9.0]
C:\Program Files\AviSynth 2.5\plugins\DGDecode.dll [1.4.9.0]
C:\Program Files\AviSynth 2.5\plugins\dvinfo.dll
C:\Program Files\AviSynth 2.5\plugins\FDecimate.dll
C:\Program Files\AviSynth 2.5\plugins\fft3dfilter.dll [2.1.1.0]
C:\Program Files\AviSynth 2.5\plugins\GamMac.dll
C:\Program Files\AviSynth 2.5\plugins\GetDups.dll [0.9.1.0]
C:\Program Files\AviSynth 2.5\plugins\GRunT.dll
C:\Program Files\AviSynth 2.5\plugins\GScript.dll
C:\Program Files\AviSynth 2.5\plugins\hotspot.dll [0.1.0.0]
C:\Program Files\AviSynth 2.5\plugins\LimitedSupport_09Jan06B.dll
C:\Program Files\AviSynth 2.5\plugins\LoadDll.dll
C:\Program Files\AviSynth 2.5\plugins\MaskTools.dll [1.5.1.0]
C:\Program Files\AviSynth 2.5\plugins\MPEGDecoder.dll
C:\Program Files\AviSynth 2.5\plugins\MT.dll [0.7.0.0]
C:\Program Files\AviSynth 2.5\plugins\mt_masktools-25.dll [2.0.48.0]
C:\Program Files\AviSynth 2.5\plugins\mt_masktools-26.dll [2.0.48.0]
C:\Program Files\AviSynth 2.5\plugins\MultiDecimate.dll
C:\Program Files\AviSynth 2.5\plugins\nnedi3.dll [0.9.2.0]
C:\Program Files\AviSynth 2.5\plugins\RemoveDirt.dll
C:\Program Files\AviSynth 2.5\plugins\RemoveDirtSSE2.dll
C:\Program Files\AviSynth 2.5\plugins\RoboCrop.dll
C:\Program Files\AviSynth 2.5\plugins\RT_Stats.dll
C:\Program Files\AviSynth 2.5\plugins\TCombMask.dll [0.9.4.0]
C:\Program Files\AviSynth 2.5\plugins\TCPDeliver.dll [1.0.0.6]
C:\Program Files\AviSynth 2.5\plugins\TDeint.dll [1.1.0.0]
C:\Program Files\AviSynth 2.5\plugins\Telecine.dll
C:\Program Files\AviSynth 2.5\plugins\TIVTC.dll [1.0.5.0]
C:\Program Files\AviSynth 2.5\plugins\warpsharp.dll
[CPP 2.6 / 32 Bit plugins]
C:\Program Files\AviSynth 2.5\plugins\AutoGain.dll [1.0.0.0]
C:\Program Files\AviSynth 2.5\plugins\DirectShowSource.dll [2.6.0.0]
C:\Program Files\AviSynth 2.5\plugins\KNLMeansCL.dll
C:\Program Files\AviSynth 2.5\plugins\masktools2.dll [2.1.0.0]
C:\Program Files\AviSynth 2.5\plugins\RoboCrop26.dll
C:\Program Files\AviSynth 2.5\plugins\RT_Stats26.dll
[Plugin errors/warnings]
------------------------------------------------------------------------------
"C:\Program Files\AviSynth 2.5\plugins\DGDecode.dll"
Dependencies that could not be loaded:
MSVCR80.dll
Note: "Visual Studio 2005 Runtime doesn't seem to be installed"
------------------------------------------------------------------------------
LoadPlugin: unable to load "C:\Program Files\AviSynth 2.5\plugins\KNLMeansCL.dll", error=0x7f
------------------------------------------------------------------------------
LoadPlugin: unable to load "C:\Program Files\AviSynth 2.5\plugins\masktools2.dll", error=0x7e
Dependencies that could not be loaded:
MSVCP110.dll
MSVCR110.dll
Note: "Visual Studio 2012 Runtime doesn't seem to be installed"
------------------------------------------------------------------------------
AVSDeps
[DLL dependencies (x86)]
"C:\WINDOWS\system32\avisynth.dll":
MSACM32.dll
AVIFIL32.dll
MSVFW32.dll
KERNEL32.dll
USER32.dll
GDI32.dll
ADVAPI32.dll
ole32.dll
msvcrt.dll
DevIL.dll
"C:\Program Files\AviSynth 2.5\plugins\AGC.dll":
KERNEL32.dll
USER32.dll
GDI32.dll
"C:\Program Files\AviSynth 2.5\plugins\Average.dll":
KERNEL32.dll
"C:\Program Files\AviSynth 2.5\plugins\avisynth_c.dll":
avisynth.dll
KERNEL32.dll
"C:\Program Files\AviSynth 2.5\plugins\aWarpSharp.dll":
KERNEL32.dll
"C:\Program Files\AviSynth 2.5\plugins\deblock.dll":
KERNEL32.dll
"C:\Program Files\AviSynth 2.5\plugins\deflicker.dll":
KERNEL32.dll
"C:\Program Files\AviSynth 2.5\plugins\defreq.dll":
KERNEL32.dll
fftw3.dll
"C:\Program Files\AviSynth 2.5\plugins\DePan.dll":
KERNEL32.dll
"C:\Program Files\AviSynth 2.5\plugins\DePanEstimate.dll":
KERNEL32.dll
fftw3.dll
"C:\Program Files\AviSynth 2.5\plugins\descratch.dll":
KERNEL32.dll
"C:\Program Files\AviSynth 2.5\plugins\despot.dll":
KERNEL32.dll
"C:\Program Files\AviSynth 2.5\plugins\DGAVCDecode.dll":
SHLWAPI.dll
WINMM.dll
KERNEL32.dll
"C:\Program Files\AviSynth 2.5\plugins\DGDecode.dll":
KERNEL32.dll
USER32.dll
GDI32.dll
MSVCR80.dll
"C:\Program Files\AviSynth 2.5\plugins\dvinfo.dll":
KERNEL32.dll
"C:\Program Files\AviSynth 2.5\plugins\FDecimate.dll":
KERNEL32.dll
MSVCRT.dll
"C:\Program Files\AviSynth 2.5\plugins\fft3dfilter.dll":
KERNEL32.dll
USER32.dll
fftw3.dll
"C:\Program Files\AviSynth 2.5\plugins\GamMac.dll":
KERNEL32.dll
"C:\Program Files\AviSynth 2.5\plugins\GetDups.dll":
KERNEL32.dll
MSVCRT.dll
"C:\Program Files\AviSynth 2.5\plugins\GRunT.dll":
KERNEL32.dll
"C:\Program Files\AviSynth 2.5\plugins\GScript.dll":
KERNEL32.dll
"C:\Program Files\AviSynth 2.5\plugins\hotspot.dll":
KERNEL32.dll
"C:\Program Files\AviSynth 2.5\plugins\LimitedSupport_09Jan06B.dll":
KERNEL32.dll
"C:\Program Files\AviSynth 2.5\plugins\LoadDll.dll":
KERNEL32.dll
"C:\Program Files\AviSynth 2.5\plugins\MaskTools.dll":
KERNEL32.dll
"C:\Program Files\AviSynth 2.5\plugins\MPEGDecoder.dll":
KERNEL32.dll
USER32.dll
ole32.dll
"C:\Program Files\AviSynth 2.5\plugins\MT.dll":
KERNEL32.dll
"C:\Program Files\AviSynth 2.5\plugins\mt_masktools-25.dll":
KERNEL32.dll
"C:\Program Files\AviSynth 2.5\plugins\mt_masktools-26.dll":
KERNEL32.dll
"C:\Program Files\AviSynth 2.5\plugins\MultiDecimate.dll":
KERNEL32.dll
MSVCRT.dll
"C:\Program Files\AviSynth 2.5\plugins\nnedi3.dll":
KERNEL32.dll
"C:\Program Files\AviSynth 2.5\plugins\RemoveDirt.dll":
KERNEL32.dll
MSVCR71.dll
"C:\Program Files\AviSynth 2.5\plugins\RemoveDirtSSE2.dll":
KERNEL32.dll
MSVCR71.dll
"C:\Program Files\AviSynth 2.5\plugins\RoboCrop.dll":
KERNEL32.dll
"C:\Program Files\AviSynth 2.5\plugins\RT_Stats.dll":
KERNEL32.dll
USER32.dll
comdlg32.dll
SHELL32.dll
"C:\Program Files\AviSynth 2.5\plugins\TCombMask.dll":
KERNEL32.dll
"C:\Program Files\AviSynth 2.5\plugins\TCPDeliver.dll":
KERNEL32.DLL
ADVAPI32.dll
COMCTL32.dll
comdlg32.dll
GDI32.dll
SHELL32.dll
USER32.dll
WINSPOOL.DRV
WS2_32.dll
"C:\Program Files\AviSynth 2.5\plugins\TDeint.dll":
KERNEL32.dll
"C:\Program Files\AviSynth 2.5\plugins\Telecine.dll":
KERNEL32.dll
MSVCR70.dll
"C:\Program Files\AviSynth 2.5\plugins\TIVTC.dll":
KERNEL32.dll
"C:\Program Files\AviSynth 2.5\plugins\warpsharp.dll":
USER32.dll
MSVCP71.dll
MSVCR71.dll
ole32.dll
OLEAUT32.dll
KERNEL32.dll
"C:\Program Files\AviSynth 2.5\plugins\AutoGain.dll":
KERNEL32.dll
USER32.dll
"C:\Program Files\AviSynth 2.5\plugins\DirectShowSource.dll":
KERNEL32.DLL
MSVCRT.dll
ole32.dll
OLEAUT32.dll
QUARTZ.dll
USER32.dll
WINMM.dll
"C:\Program Files\AviSynth 2.5\plugins\KNLMeansCL.dll":
OpenCL.dll
MSVCP140.dll
KERNEL32.dll
VCRUNTIME140.dll
api-ms-win-crt-locale-l1-1-0.dll
api-ms-win-crt-stdio-l1-1-0.dll
api-ms-win-crt-runtime-l1-1-0.dll
api-ms-win-crt-filesystem-l1-1-0.dll
api-ms-win-crt-string-l1-1-0.dll
api-ms-win-crt-heap-l1-1-0.dll
"C:\Program Files\AviSynth 2.5\plugins\masktools2.dll":
KERNEL32.dll
MSVCP110.dll
MSVCR110.dll
"C:\Program Files\AviSynth 2.5\plugins\RoboCrop26.dll":
KERNEL32.dll
"C:\Program Files\AviSynth 2.5\plugins\RT_Stats26.dll":
KERNEL32.dll
USER32.dll
comdlg32.dll
SHELL32.dll
Any clues or help would be appreciated.
Groucho2004
25th January 2017, 22:31
[Avisynth core info]
VersionString: AviSynth 2.60, build:Mar 9 2013 [13:28:27]
VersionNumber: 2.60
File version: 2.6.0.3
Interface Version: 5
Multi-threading support: Yes
Linker/compiler version: 10.0
Avisynth.dll location: C:\WINDOWS\system32\avisynth.dll
Avisynth.dll time stamp: 2013-03-09, 08:28:48 (UTC)
PluginDir2_5 (HKLM, x86): C:\Program Files\AviSynth 2.5\plugins
Any clues or help would be appreciated.
You should do what I suggested (https://forum.doom9.org/showthread.php?p=1794433#post1794433) in the other thread. The dependency issues will be resolved. Also, KNLMeansCL will not load with your version of Avisynth.
johnmeyer
25th January 2017, 22:43
You should do what I suggested (https://forum.doom9.org/showthread.php?p=1794433#post1794433) in the other thread. The dependency issues will be resolved. Also, KNLMeansCL will not load with your version of Avisynth.In that thread you suggested: Get the latest avisynth.dll from SEt (if you need MT).
Uninstall all "Microsoft Visual C++ 2xxx Runtimes/Redistributables"
Re-install the AIO
I did the second two things. I'll now try another version of AVISynth.
johnmeyer
26th January 2017, 00:10
Still no joy. I downloaded Set's 2015 version listed at the top of this long thread:
Avisynth 2.6 MT (https://forum.doom9.org/showthread.php?t=148782)
This is the actual link for the download:
https://www.dropbox.com/s/dckxoowjlzwku1s/avisynth_20150220.7z
I copied that to my System32 folder, and opened the script that does nothing except try to load KNLMeansCL. This time I got a different error message:
AVIsynth open failure:
LoadPlugin: unable to load ... KNLMeansCL.dll", Proc not found. Update library version?"
There is definitely a dependency that is not being picked up by AVSMeter. Whatever it is, it must be quite specific to this plugin because, as you could tell by the message I posted in that other thread, I originally had way more than 50 plugins in my plugins folder, and I've used them all, and they all work with my current setup.
I keep re-reading the KNLMeansCL documentation, but it doesn't mention much about libraries or DLLs that must be present.
Other people are running this without any problem, so I must be doing something very stupid.
I'm stumped.
(P.S. I went to my Windows 7 boot partition and tried it with that installation, but got the same results, so I don't think it is Windows XP Pro SP3 that is the cause).
StainlessS
26th January 2017, 07:25
Perhaps try Dependency Walker:- http://www.dependencywalker.com/
feisty2
26th January 2017, 09:41
In that thread you suggested:I did the second two things. I'll now try another version of AVISynth.
maybe your OpenCL driver is outdated, or OpenCL.dll was placed in the wrong directory.
johnmeyer
26th January 2017, 09:52
It's in the System32 folder. I too thought it might be the problem, but I can't find any link to a newer one. I think the one I was installed by the nVidia driver installer.
feisty2
26th January 2017, 10:13
the latest OpenCL driver should be shipped with the latest video card driver, download the latest video card driver and reinstall it.
and also the Intel OpenCL package for CPUs, https://software.intel.com/en-us/articles/opencl-drivers, no x86 version since that crap is obsolete and we're all on x64 now
after the driver reinstallation, copy Program Files\NVIDIA Corporation\OpenCL\OpenCL.dll to SysWOW64 folder and rename Program Files\NVIDIA Corporation\OpenCL\OpenCL64.dll to OpenCL.dll and copy it to System32
Groucho2004
26th January 2017, 11:15
(P.S. I went to my Windows 7 boot partition and tried it with that installation, but got the same results, so I don't think it is Windows XP Pro SP3 that is the cause).Maybe your graphics card is not supported. What card do you have?
dipje
26th January 2017, 16:31
It's in the System32 folder. I too thought it might be the problem, but I can't find any link to a newer one. I think the one I was installed by the nVidia driver installer.
just a reminder (and 'to be sure'). If you are on a 64 bit OS: 64bit DLLs go into c:\windows\system32, 32bit DLLs go into c:\windows\syswow64.
If you're still tring with 32bit avisynth and 32bit knlmeanscl, did you copy the 32bit opencl.dll to the right folder? (or at least first tried with the version already on your system, the supplied .dll file is only for troubleshooting).
johnmeyer
26th January 2017, 17:40
My graphic card is the Nvidia GeForce 9800GTX 512M PCIe2.0 16x.
My computer is dual boot, with WinXP Pro 32-bit on one drive and Win7 64-bit on a second drive. I have tried both installations, and they both behave the same. The XP installation has the OpenCL.DLL in the c:\windows\system32 folder. It is dated 7/9/2010. The Win7 installation has OpenCL.DLL in the c:\windows\SysWOW64 folder. It is dated 2/25/2013. There is also an nvopencl.dll in that folder as well as a IntelOpenCL32.DLL. The first two also appear in the c:\windows\system32 folder along with IntelOpenCL64.DLL.
The OpenCL.DLL in my XP installation is version 1.0.0 and is signed by the Khronos Group.
We are all focusing on this as the problem, and perhaps it is, but the fact that it exists and is in the correct folder makes me think I'd get a different error message than the one which says the KNLMeansCL.DLL won't load.
BTW, my NVidia drivers are not the latest for my older card because the newer drivers don't work with Sony Vegas, the NLE I use every day.
Groucho2004
26th January 2017, 17:52
My graphic card is the Nvidia GeForce 9800GTX 512M PCIe2.0 16x.
That card does only support OpenCL 1.1. You have to use an older version of KNLMeansCL, see here (https://github.com/Khanattila/KNLMeansCL/wiki/Requirements), last paragraph.
I'm not sure about the minimum required driver version but I think it has to be at least something like 3xx.xx.
Edit: Just googled - it should be at least 258.19 for OpenCL 1.1.
Edit2: As for the correct OpenCL.dll - There should be one in "Program Files\NVIDIA Corporation\OpenCL". This is in most cases the right one to use. If you have an older version in your system32 directory, make a backup of it and then overwrite it with the one from the NVIDIA directory.
johnmeyer
27th January 2017, 00:29
That card does only support OpenCL 1.1. You have to use an older version of KNLMeansCL, see here (https://github.com/Khanattila/KNLMeansCL/wiki/Requirements), last paragraph.Bingo!
The older version, coupled with the older redistributable works. Many thanks.
Groucho2004
27th January 2017, 10:11
Bingo!
The older version, coupled with the older redistributable works. Many thanks.
I'm glad you got it sorted. You should still clean up your plugin directory.
For example mixing old and new, 2.5 and 2.6 versions of plugins is not recommended:
[CPP 2.5 / 32 Bit plugins]
C:\Program Files\AviSynth 2.5\plugins\mt_masktools-25.dll [2.0.48.0]
C:\Program Files\AviSynth 2.5\plugins\mt_masktools-26.dll [2.0.48.0]
C:\Program Files\AviSynth 2.5\plugins\RoboCrop.dll
C:\Program Files\AviSynth 2.5\plugins\RT_Stats.dll
[CPP 2.6 / 32 Bit plugins]
C:\Program Files\AviSynth 2.5\plugins\masktools2.dll [2.1.0.0]
C:\Program Files\AviSynth 2.5\plugins\RoboCrop26.dll
C:\Program Files\AviSynth 2.5\plugins\RT_Stats26.dll
Also, your DGDecode.dll is very old, update it to the latest version unless you have a reason to stick with the old one.
johnmeyer
27th January 2017, 21:58
I don't use DGDecode except to troubleshoot other people's programs, but I definitely need to sort out the masktools conflicts/redundancies. Thanks!
StainlessS
28th January 2017, 15:01
Also these are conflicting, pick only one (SSE2).
C:\Program Files\AviSynth 2.5\plugins\RemoveDirt.dll
C:\Program Files\AviSynth 2.5\plugins\RemoveDirtSSE2.dll
mp3dom
28th January 2017, 15:49
Uhm, I don't know if it was already covered, but I'm getting the following problem:
OpenCL Platform
------------------------------------------------------------
CL_PLATFORM_VENDOR: Advanced Micro Devices, Inc.
CL_PLATFORM_NAME: AMD Accelerated Parallel Processing
CL_PLATFORM_VERSION: OpenCL 2.0 AMD-APP (2236.10)
CL_PLATFORM_PROFILE: FULL_PROFILE
OpenCL Device
------------------------------------------------------------
CL_DEVICE_VENDOR: GenuineIntel
CL_DEVICE_NAME: Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz
CL_DRIVER_VERSION: 2236.10 (sse2)
CL_DEVICE_VERSION: OpenCL 1.2 AMD-APP (2236.10)
CL_DEVICE_PROFILE: FULL_PROFILE
CL_DEVICE_IMAGE_SUPPORT: 1
CL_DEVICE_IMAGE2D_MAX_WIDTH: 8192
CL_DEVICE_IMAGE2D_MAX_HEIGHT: 8192
CL_DEVICE_IMAGE_MAX_ARRAY_SIZE: 2048
Program Build
------------------------------------------------------------
CL_PROGRAM_BUILD_OPTIONS: -cl-single-precision-constant
-cl-denorms-are-zero
-cl-fast-relaxed-math
-Werror
-D NLM_CLIP_TYPE_STACKED
-D NLM_CLIP_REF_LUMA
-D NLM_WMODE_WELSCH
-D VI_DIM_X=1440
-D VI_DIM_Y=1080
-D HRZ_RESULT=3
-D VRT_RESULT=3
-D HRZ_BLOCK_X=16
-D HRZ_BLOCK_Y=8
-D VRT_BLOCK_X=16
-D VRT_BLOCK_Y=8
-D NLM_D=1
-D NLM_S=4
-D NLM_H=1.200000
-D NLM_WREF=1.000000
Warnings being treated as errors
"C:\Users\usr\AppData\Local\Temp\OCL123264T1.cl", line 19: error: global
variable declaration is corrected by the compiler to have addrSpace
constant
const sampler_t nne = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_NONE | CLK_FILTER_NEAREST;
^
"C:\Users\usr\AppData\Local\Temp\OCL123264T1.cl", line 20: error: global
variable declaration is corrected by the compiler to have addrSpace
constant
const sampler_t clm = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP | CLK_FILTER_NEAREST;
Using latest AviSynth+ in both x86/x64.
Is the card not supported?
Thanks.
Khanattila
28th January 2017, 16:59
Uhm, I don't know if it was already covered, but I'm getting the following problem:
OpenCL Platform
------------------------------------------------------------
CL_PLATFORM_VENDOR: Advanced Micro Devices, Inc.
CL_PLATFORM_NAME: AMD Accelerated Parallel Processing
CL_PLATFORM_VERSION: OpenCL 2.0 AMD-APP (2236.10)
CL_PLATFORM_PROFILE: FULL_PROFILE
OpenCL Device
------------------------------------------------------------
CL_DEVICE_VENDOR: GenuineIntel
CL_DEVICE_NAME: Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz
CL_DRIVER_VERSION: 2236.10 (sse2)
CL_DEVICE_VERSION: OpenCL 1.2 AMD-APP (2236.10)
CL_DEVICE_PROFILE: FULL_PROFILE
CL_DEVICE_IMAGE_SUPPORT: 1
CL_DEVICE_IMAGE2D_MAX_WIDTH: 8192
CL_DEVICE_IMAGE2D_MAX_HEIGHT: 8192
CL_DEVICE_IMAGE_MAX_ARRAY_SIZE: 2048
Program Build
------------------------------------------------------------
CL_PROGRAM_BUILD_OPTIONS: -cl-single-precision-constant
-cl-denorms-are-zero
-cl-fast-relaxed-math
-Werror
-D NLM_CLIP_TYPE_STACKED
-D NLM_CLIP_REF_LUMA
-D NLM_WMODE_WELSCH
-D VI_DIM_X=1440
-D VI_DIM_Y=1080
-D HRZ_RESULT=3
-D VRT_RESULT=3
-D HRZ_BLOCK_X=16
-D HRZ_BLOCK_Y=8
-D VRT_BLOCK_X=16
-D VRT_BLOCK_Y=8
-D NLM_D=1
-D NLM_S=4
-D NLM_H=1.200000
-D NLM_WREF=1.000000
Warnings being treated as errors
"C:\Users\usr\AppData\Local\Temp\OCL123264T1.cl", line 19: error: global
variable declaration is corrected by the compiler to have addrSpace
constant
const sampler_t nne = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_NONE | CLK_FILTER_NEAREST;
^
"C:\Users\usr\AppData\Local\Temp\OCL123264T1.cl", line 20: error: global
variable declaration is corrected by the compiler to have addrSpace
constant
const sampler_t clm = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP | CLK_FILTER_NEAREST;
Using latest AviSynth+ in both x86/x64.
Is the card not supported?
Thanks.
Do not worry about this error.
The final version will work normally.
Khanattila
28th January 2017, 17:06
When the API has bugs: https://www.khronos.org/bugzilla/show_bug.cgi?id=397
mp3dom
28th January 2017, 17:31
Good to know that, thanks!
MysteryX
31st January 2017, 02:34
Does KNLMeans now support AVS+'s native 16-bit clips as input and output? I don't see such a feature in the change log.
Reel.Deel
31st January 2017, 02:42
Does KNLMeans now support AVS+'s native 16-bit clips as input and output? I don't see such a feature in the change log.
Not yet but:
@Khanattila
Thank you for the continued development on this excellent plugin. Any plans on adding native high bit-depth support for AVS+?
Yes, it requires no extra work for me.
Khanattila
31st January 2017, 16:39
Not yet but:
I'm thinking about what formats to support, probably the same as VapourSynth.
Greyscale: 8-bit, 16-bit, 32-bit
YUV: 8-bit, 10-bit, 16-bit, 32-bit
Packed RGB: 8-bit, 16-bit, 32-bit
All other formats are useless.
MysteryX
31st January 2017, 17:00
I was also considering the exact same question for AviSynthShader. Since the GPU processing is done with UINT16 and half-float data, converting to-from 10, 12 or 14 bits is useless. If the user wants 10-bit output, he'll get a 16-bit output from the GPU, then he can ditter it down to 10-bit.
feisty2
31st January 2017, 17:10
half precision is not meant for processing, it's meant for storing.
MysteryX
31st January 2017, 17:30
half precision is not meant for processing, it's meant for storing.
GPU does processing with half-float and can't work well with INT. CPU does processing with INT and can't work well with half-float.
feisty2
31st January 2017, 17:38
GPU does processing with half-float.
bullshit, GPU works with different sizes of floats, half is a very low precision one and should not be used for processing, it was designed to reduce the bandwidth of data transferring (storing, not processing, half precision arithmetics are not any faster than single precision arithmetics)
MysteryX
31st January 2017, 18:11
That's getting off-topic here.
feisty2
31st January 2017, 18:23
I was also considering the exact same question for AviSynthShader. Since the GPU processing is done with UINT16 and half-float data.
no it's not, you CANNOT process things with half precision, even if you do, it will be automatically promoted to single precision inside the hardware, and you lose precision for nothing.
be a good boy, use single precision.
Khanattila
31st January 2017, 18:44
Meanwhile I release this version here.
https://github.com/Khanattila/KNLMeansCL/releases/tag/v1.0.0
KNLMeansCL v1.0.0
* Improved performance with CPU.
* Improved performance with AMD GCN Architecture.
* Reduced CPU overhead in some system.
* Reduced memory usage in some system.
* Advanced OpenCL parameters for fine tuning.
* Replaced 'cmode' with 'channels' and added the options to only process the chroma.
* Two new modified bisquare weighting functions.
* Increased the maximum 's' value to 8.
* Updated to VapourSynth R36.
* Removed Cauchy weighting function.
* Fixed second clip 'rclip' in some circumstances.
MysteryX
31st January 2017, 18:45
How does this have anything to do with KNLMeans?
I believe Madshi experimented with 32-bit GPU float processing in madVR and told me it was dreadfully slow. Either way, I was talking about integer data vs floating point data, not about what precision of floating point would be best. When it comes to Avisynth support, we're not using any floating-point data anyway as Avisynth doesn't use that. I don't think there's anything else to say on this.
Edit: Thanks Khanattila!
feisty2
31st January 2017, 18:58
Wrong again
There's the single precision support in avisynth+
Reel.Deel
31st January 2017, 20:35
https://github.com/Khanattila/KNLMeansCL/releases/tag/v1.0.0
KNLMeansCL v1.0.0
* Improved performance with CPU.
* Improved performance with AMD GCN Architecture.
* Reduced CPU overhead in some system.
* Reduced memory usage in some system.
* Advanced OpenCL parameters for fine tuning.
* Replaced 'cmode' with 'channels' and added the options to only process the chroma.
* Two new modified bisquare weighting functions.
* Increased the maximum 's' value to 8.
* Updated to VapourSynth R36.
* Removed Cauchy weighting function.
* Fixed second clip 'rclip' in some circumstances.
Thanks! I guess we'll have to wait for the next version for native AVS+ high bit depth support. :(
When it comes to Avisynth support, we're not using any floating-point data anyway as Avisynth doesn't use that. I don't think there's anything else to say on this.
As feisty2 already pointed out, AVS+ supports 10-16 bit and 32-bit float. I mentioned that here (https://forum.doom9.org/showpost.php?p=1795309&postcount=2940)when I answered your question.
MysteryX
31st January 2017, 21:02
Wrong again
There's the single precision support in avisynth+
Yes you're right there is 32-bit float support
Khanattila
31st January 2017, 21:45
Thanks! I guess we'll have to wait for the next version for native AVS+ high bit depth support. :(
It is the first thing on the list, v1.1.0.
Khanattila
31st January 2017, 21:48
no it's not, you CANNOT process things with half precision, even if you do, it will be automatically promoted to single precision inside the hardware, and you lose precision for nothing.
be a good boy, use single precision.
The FP16 operations are twice faster than the FP32 operations.
But hardware manufacturers deliberately castrate it to push consumers to buy more expensive products.
For this reason, usually, all the operations are promoted to FP32.
As in my program. It works with FP32 (with some optimizations), but also the FP16 would be sufficient.
Atak_Snajpera
1st February 2017, 11:30
AMD VEGA will support 2xFP16
tormento
1st February 2017, 17:42
Meanwhile I release this version here.
Wow!
Eagerly waiting for full detailed docs!
Groucho2004
1st February 2017, 18:05
Eagerly waiting for full detailed docs!This (https://github.com/Khanattila/KNLMeansCL/wiki/Filter-description) is not good enough?
Khanattila
1st February 2017, 18:16
AMD VEGA will support 2xFP16
It would be a good news.
However, without charging a license to a PRO version of the program, I can not implement it.
Atak_Snajpera
1st February 2017, 19:06
It would be a good news.
However, without charging a license to a PRO version of the program, I can not implement it.
I see no problem here. If you can afford to buy VEGA then you should also have few spare bucks for PRO license.
Khanattila
1st February 2017, 19:37
I see no problem here. If you can afford to buy VEGA then you should also have few spare bucks for PRO license.
If I can get my hands on a device with cl_khr_fp16 extension, I think I'll do that.
feisty2
2nd February 2017, 12:56
the following script
import vapoursynth as vs
core = vs.get_core()
clp = core.std.BlankClip(format=vs.GRAYS)
clp = core.knlm.KNLMeansCL(clp, rclip=clp)
clp.set_output()
gives me instant crash with v1.0.0
Khanattila
2nd February 2017, 13:11
the following script
import vapoursynth as vs
core = vs.get_core()
clp = core.std.BlankClip(format=vs.GRAYS)
clp = core.knlm.KNLMeansCL(clp, rclip=clp)
clp.set_output()
gives me instant crash with v1.0.0
Okay, I will fix it again.
Now I know that it breaks again at the next change.
tuanden0
5th February 2017, 06:21
Okay, I will fix it again.
Now I know that it breaks again at the next change.
Hi Sir,
The filter ver 1.0 make my GPU (GTX 650Ti) crash with default filter setting :confused::confused:
I'm using avs+ r2397
Here's my script:
LWLibavVideoSource("E:\Test zone\test.mkv")
KNLMeansCL()
WolframRhodium
5th February 2017, 18:51
Can Pruned non-local means (https://arxiv.org/abs/1701.08280) further improve the existing KNLMeansCL denoising quality around edges?
I found at least from the information presented in this paper, subjective and objective quality of the algorithm are superior to the existing NLM algorithms, thought there's still a huge gap with respect to BM3D.
feisty2
5th February 2017, 19:03
Can Pruned non-local means (https://arxiv.org/abs/1701.08280) further improve the existing KNLMeansCL denoising quality around edges?
I found at least from the information presented in this paper, subjective and objective quality of the algorithm are superior to the existing NLM algorithms, thought there's still a huge gap with respect to BM3D.
the Bisquare weighting function (wmode=2) does that "pruning" thing exactly, reject a pixel within the search window if the inter-patch correlation (weight) goes below certain threshold, windowed weighting function.
WolframRhodium
6th February 2017, 00:13
the Bisquare weighting function (wmode=2) does that "pruning" thing exactly, reject a pixel within the search window if the inter-patch correlation (weight) goes below certain threshold, windowed weighting function.
I realize I said stupid words before...thx
Khanattila
6th February 2017, 11:49
Hi Sir,
The filter ver 1.0 make my GPU (GTX 650Ti) crash with default filter setting :confused::confused:
I'm using avs+ r2397
Here's my script:
This type of error is different.
What system are you using?
tuanden0
7th February 2017, 04:58
This type of error is different.
What system are you using?
I'm using windows 7 x64, avs+ x86 and AvsPmod to edit avs script :confused:
my GPU crashed everytime I try to preview my avs script and if I encode without preview avs, my PC crashed too :confused::confused:
burfadel
7th February 2017, 13:19
For me, wmode=3 causes the encode to typically crash at some point. wmode=2 seems stable, and wmode=0 (default?) has worked flawlessly. Just thought I'd try it out but the crashes put an end to doing a full encode :S!
Khanattila
7th February 2017, 19:05
For me, wmode=3 causes the encode to typically crash at some point. wmode=2 seems stable, and wmode=0 (default?) has worked flawlessly. Just thought I'd try it out but the crashes put an end to doing a full encode :S!
Thanks for your report, I will check if there is any problem.
Khanattila
7th February 2017, 19:08
I realize I said stupid words before...thx
However, what you say it is interesting.
I know if I do a previous estimate of the noise, the filter give better results.
But of course, it is slower.
Khanattila
7th February 2017, 19:09
I'm using windows 7 x64, avs+ x86 and AvsPmod to edit avs script :confused:
my GPU crashed everytime I try to preview my avs script and if I encode without preview avs, my PC crashed too :confused::confused:
I will check this.
burfadel
7th February 2017, 22:33
Thanks for your report, I will check if there is any problem.
wmode=2 is stable, has been running encodes since I made the post, so it seems only wmode=3 is problematic (at least for me).
burfadel
8th February 2017, 13:03
My mistake :) wmode=2 does also seem buggy, just not as noticeable as wmode=3.
Khanattila
9th February 2017, 19:38
https://github.com/Khanattila/KNLMeansCL/releases/tag/v1.0.1
KNLMeansCL v1.0.1
* Fixed wrong output with 'wmode' different to 0 in some circumstances.
* Fixed second clip 'rclip' in VapourSynth.
KNLMeansCL v1.0.0
* Improved performance with CPU.
* Improved performance with AMD GCN Architecture.
* Reduced CPU overhead in some system.
* Reduced memory usage in some system.
* Advanced OpenCL parameters for fine tuning.
* Replaced 'cmode' with 'channels' and added the options to only process the chroma.
* Two new modified bisquare weighting functions.
* Increased the maximum 's' value to 8.
* Updated to VapourSynth R36.
* Removed Cauchy weighting function.
* Fixed second clip 'rclip' in some circumstances.
If this time is rock solid I can move on.
hydra3333
10th February 2017, 00:36
Thank you. The 1.0.1 zip contains only one dll ... any chance of one for x32 and one for x64 ? :)
Khanattila
10th February 2017, 00:55
Thank you. The 1.0.1 zip contains only one dll ... any chance of one for x32 and one for x64 ? :)
:eek:, fixed
tuanden0
11th February 2017, 04:27
No crash anymore, :thanks: Khanattila
burfadel
11th February 2017, 05:09
No crash with wmode=3 here now either! Thanks :)
MysteryX
14th February 2017, 17:08
Benchmark test.
colorbars(width = 1920, height = 1080, pixel_type = "yv12").killaudio().assumefps(25, 1)
KNLMeansCL(d = 2, a = 2, device_id=0)
Old version
Intel HD 4000 (Intel i7-3630QM)
FPS (min | max | average): 1.304 | 1.345 | 1.340
Memory usage (phys | virt): 132 | 120 MiB
Thread count: 12
CPU usage (average): 11%
Radeon HD 7670M
FPS (min | max | average): 1.056 | 1.155 | 1.104
Memory usage (phys | virt): 51 | 41 MiB
Thread count: 12
CPU usage (average): 4%
New version
Intel HD 4000 (Intel i7-3630QM)
FPS (min | max | average): 1.328 | 1.393 | 1.346
Memory usage (phys | virt): 137 | 180 MiB
Thread count: 14
CPU usage (average): 12%
Radeon HD 7670M
FPS (min | max | average): 1.101 | 1.153 | 1.120
Memory usage (phys | virt): 55 | 99 MiB
Thread count: 14
CPU usage (average): 4%
Khanattila
14th February 2017, 19:41
Benchmark test.
colorbars(width = 1920, height = 1080, pixel_type = "yv12").killaudio().assumefps(25, 1)
KNLMeansCL(d = 2, a = 2, device_id=0)
Old version
Intel HD 4000 (Intel i7-3630QM)
FPS (min | max | average): 1.304 | 1.345 | 1.340
Memory usage (phys | virt): 132 | 120 MiB
Thread count: 12
CPU usage (average): 11%
Radeon HD 7670M
FPS (min | max | average): 1.056 | 1.155 | 1.104
Memory usage (phys | virt): 51 | 41 MiB
Thread count: 12
CPU usage (average): 4%
New version
Intel HD 4000 (Intel i7-3630QM)
FPS (min | max | average): 1.328 | 1.393 | 1.346
Memory usage (phys | virt): 137 | 180 MiB
Thread count: 14
CPU usage (average): 12%
Radeon HD 7670M
FPS (min | max | average): 1.101 | 1.153 | 1.120
Memory usage (phys | virt): 55 | 99 MiB
Thread count: 14
CPU usage (average): 4%
Everything normal.
MysteryX
14th February 2017, 23:03
Everything normal.
Wrong. I mixed up the DLLs and was still running the old version.
Correct results:
Intel HD 4000
FPS (min | max | average): 1.314 | 11.02 | 1.420
Memory usage (phys | virt): 177 | 199 MiB
Thread count: 14
CPU usage (average): 11%
AMD Radeon 7670M
FPS (min | max | average): 1.418 | 9.768 | 1.489
Memory usage (phys | virt): 62 | 100 MiB
Thread count: 15
CPU usage (average): 4%
That's a 6% improvement on Intel HD 4000 and 33% improvement on Radeon 7670M. Not bad!
Khanattila
14th February 2017, 23:10
Good for you
feisty2
15th February 2017, 19:38
I found the results(with the same parameters) between v0.7.7 and v1.0.1 are noticeably different, v1.0.1 left more residual noise than v0.7.7
like something algorithmic has changed?
I prefer the result of v0.7.7
MysteryX
16th February 2017, 00:52
I confirm a notable difference between versions.
v6.11
https://s20.postimg.org/cjr1i30gp/Knl_Means_Old.png (https://postimg.org/image/cjr1i30gp/)
v1.0.1
https://s20.postimg.org/3ng9e59uh/Knl_Means_New.png (https://postimg.org/image/3ng9e59uh/)
feisty2
16th February 2017, 06:58
to have similar results, "h" in v1.0.1 should be around 1.6 ~ 1.8 x "h" in v0.7.7
@Khanattila
is there an explanation for what's happening here?
did you switch from SSE to SAD?
Khanattila
16th February 2017, 11:07
Mathematics is the same, there will be a bug somewhere.
feisty2
16th February 2017, 11:29
@Khanattila
That doesn't sound good...
Are you planning on fixing it?
Khanattila
16th February 2017, 11:38
@Khanattila
That doesn't sound good...
Are you planning on fixing it?
I already found the problem...
You can consider it a side effect of the new channels mode.
The result is correct, I might add an internal multiplier to maintain compatibility with the older versions.
PS. It is more correct the new version instead of the old.
feisty2
16th February 2017, 12:33
I did my tests on GRAYS clips...
So that channel thing, will affect GRAY stuff as well?
Khanattila
16th February 2017, 12:36
I did my tests on GRAYS clips...
So that channel thing, will affect GRAY stuff as well?
All modes are affected.
As a temporary fix using ~1,732 (square root of 3) as a multiplier for h.
burfadel
16th February 2017, 14:59
All modes are affected.
As a temporary fix using ~1,732 (square root of 3) as a multiplier for h.
Just be aware that a comma is also a thousand separator in half the world. Basically, to many people out there, you said to set h to one thousand seven hundred thirty two (1732) :).
Yes it's Wikipedia, but it's good enough:
https://en.wikipedia.org/w/index.php?title=Decimal_mark
Basically it's the exact opposite, where you use commas' as a decimal separator as in your usage, a decimal is used, and where we would use a comma, you use a decimal as a thousands separator.
Makes it confusing when there are multiple different systems (more than just these) around the world. The correct form in Australia for 1,732 is 1 732, although a comma is typically used. Not to confuse things with the comma at the end there for a sentence break! Many people would also write 1 732 as 1,732, but if the number were much larger as in 92,345,764 they would use spaces. The spaces are used as part of the SI system I believe to avoid confusion between the various systems used around the world.
Khanattila
16th February 2017, 16:32
Just be aware that a comma is also a thousand separator in half the world. Basically, to many people out there, you said to set h to one thousand seven hundred thirty two (1732) :).
Yes it's Wikipedia, but it's good enough:
https://en.wikipedia.org/w/index.php?title=Decimal_mark
Basically it's the exact opposite, where you use commas' as a decimal separator as in your usage, a decimal is used, and where we would use a comma, you use a decimal as a thousands separator.
Makes it confusing when there are multiple different systems (more than just these) around the world. The correct form in Australia for 1,732 is 1 732, although a comma is typically used. Not to confuse things with the comma at the end there for a sentence break! Many people would also write 1 732 as 1,732, but if the number were much larger as in 92,345,764 they would use spaces. The spaces are used as part of the SI system I believe to avoid confusion between the various systems used around the world.
I thank you, but really, I know the difference.
I live in the limbo in which I program using '.' and in the lives of everyday I use ','. :p
MysteryX
16th February 2017, 16:55
I thank you, but really, I know the difference.
I live in the limbo in which I program using '.' and in the lives of everyday I use ','. :p
Modern programming languages have no issue with that (as long as you set the right parameters for formatting) but this used to be a major source of frustration with old programming languages. A program would run 100% fine, then on another computer, it would totally crash on every comma.
KingLir
21st February 2017, 10:52
I am getting the following error when running on macOS with latest versions (vapoursynth R36 and KNLMeansCL built from master - commit 08755c5). Anyone got an idea how to fix ?
Script evaluation failed:
Python exception: knlm.KNLMeansCL: build programm error!
Please report Log-KNLMeansCL.txt.
Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 1712, in vapoursynth.vpy_evaluateScript (src/cython/vapoursynth.c:34991)
File "VIVTC_with_TComb_script.vpy", line 11, in <module>
clip = core.knlm.KNLMeansCL(clip=clip)
File "src/cython/vapoursynth.pyx", line 1604, in vapoursynth.Function.__call__ (src/cython/vapoursynth.c:33131)
vapoursynth.Error: knlm.KNLMeansCL: build programm error!
script:
import vapoursynth as vs
core = vs.get_core()
core.max_cache_size = 12000
clip = core.ffms2.Source(source=filename)
clip = core.knlm.KNLMeansCL(clip=clip)
Khanattila
21st February 2017, 10:59
I am getting the following error when running on macOS. Anyone got an idea how to fix ?
Script evaluation failed:
Python exception: knlm.KNLMeansCL: build programm error!
Please report Log-KNLMeansCL.txt.
Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 1712, in vapoursynth.vpy_evaluateScript (src/cython/vapoursynth.c:34991)
File "VIVTC_with_TComb_script.vpy", line 11, in <module>
clip = core.knlm.KNLMeansCL(clip=clip)
File "src/cython/vapoursynth.pyx", line 1604, in vapoursynth.Function.__call__ (src/cython/vapoursynth.c:33131)
vapoursynth.Error: knlm.KNLMeansCL: build programm error!
script:
clip = core.knlm.KNLMeansCL(clip=clip)
> Please report Log-KNLMeansCL.txt
KingLir
21st February 2017, 11:27
> Please report Log-KNLMeansCL.txt
Sure, but where can I find it on macOS ? I searched and haven't found it.
Khanattila
21st February 2017, 16:58
Sure, but where can I find it on macOS ? I searched and haven't found it.
It is in the script folder.
KingLir
21st February 2017, 19:32
It is in the script folder.
Thanks, sorry I missed it.
Here:
OpenCL Platform
------------------------------------------------------------
CL_PLATFORM_VENDOR: Apple
CL_PLATFORM_NAME: Apple
CL_PLATFORM_VERSION: OpenCL 1.2 (Jan 4 2017 22:35:59)
CL_PLATFORM_PROFILE: FULL_PROFILE
OpenCL Device
------------------------------------------------------------
CL_DEVICE_VENDOR: AMD
CL_DEVICE_NAME: AMD Radeon R9 M395X Compute Engine
CL_DRIVER_VERSION: 1.2 (Jan 10 2017 22:25:08)
CL_DEVICE_VERSION: OpenCL 1.2
CL_DEVICE_PROFILE: FULL_PROFILE
CL_DEVICE_IMAGE_SUPPORT: 1
CL_DEVICE_IMAGE2D_MAX_WIDTH: 16384
CL_DEVICE_IMAGE2D_MAX_HEIGHT: 16384
CL_DEVICE_IMAGE_MAX_ARRAY_SIZE: 2048
Program Build
------------------------------------------------------------
CL_PROGRAM_BUILD_OPTIONS:
CL_PROGRAM_BUILD_LOG:
RETURN: 0
KingLir
22nd February 2017, 14:40
Any ideas ?
Khanattila
24th February 2017, 18:25
Any ideas ?
v1.0.2, definitely
Khanattila
24th February 2017, 19:01
@ KingLir
https://github.com/Khanattila/KNLMeansCL/archive/master.zip
Can you test this version and report log?
KingLir
26th February 2017, 17:22
@ KingLir
https://github.com/Khanattila/KNLMeansCL/archive/master.zip
Can you test this version and report log?
Thanks and sorry for the late reply.
Here is the new output:
Script evaluation failed:
Python exception: knlm.KNLMeansCL: build programm error!
Please report Log-KNLMeansCL.txt.
Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 1712, in vapoursynth.vpy_evaluateScript (src/cython/vapoursynth.c:34991)
File "VIVTC_with_TComb_script.vpy", line 16, in <module>
clip = core.knlm.KNLMeansCL(clip=clip)
File "src/cython/vapoursynth.pyx", line 1604, in vapoursynth.Function.__call__ (src/cython/vapoursynth.c:33131)
vapoursynth.Error: knlm.KNLMeansCL: build programm error!
And the new log:
OpenCL Platform
------------------------------------------------------------
CL_PLATFORM_VENDOR: Apple
CL_PLATFORM_NAME: Apple
CL_PLATFORM_VERSION: OpenCL 1.2 (Jan 4 2017 22:35:59)
CL_PLATFORM_PROFILE: FULL_PROFILE
OpenCL Device
------------------------------------------------------------
CL_DEVICE_VENDOR: AMD
CL_DEVICE_NAME: AMD Radeon R9 M395X Compute Engine
CL_DRIVER_VERSION: 1.2 (Jan 10 2017 22:25:08)
CL_DEVICE_VERSION: OpenCL 1.2
CL_DEVICE_PROFILE: FULL_PROFILE
CL_DEVICE_IMAGE_SUPPORT: 1
CL_DEVICE_IMAGE2D_MAX_WIDTH: 16384
CL_DEVICE_IMAGE2D_MAX_HEIGHT: 16384
CL_DEVICE_IMAGE_MAX_ARRAY_SIZE: 2048
Program Build
------------------------------------------------------------
CL_PROGRAM_BUILD_ERROR: CL_INVALID_BUILD_OPTIONS
CL_PROGRAM_BUILD_OPTIONS:
CL_PROGRAM_BUILD_LOG:
RETURN: 0
Khanattila
28th February 2017, 17:07
Thanks and sorry for the late reply.
Here is the new output:
Script evaluation failed:
Python exception: knlm.KNLMeansCL: build programm error!
Please report Log-KNLMeansCL.txt.
Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 1712, in vapoursynth.vpy_evaluateScript (src/cython/vapoursynth.c:34991)
File "VIVTC_with_TComb_script.vpy", line 16, in <module>
clip = core.knlm.KNLMeansCL(clip=clip)
File "src/cython/vapoursynth.pyx", line 1604, in vapoursynth.Function.__call__ (src/cython/vapoursynth.c:33131)
vapoursynth.Error: knlm.KNLMeansCL: build programm error!
And the new log:
OpenCL Platform
------------------------------------------------------------
CL_PLATFORM_VENDOR: Apple
CL_PLATFORM_NAME: Apple
CL_PLATFORM_VERSION: OpenCL 1.2 (Jan 4 2017 22:35:59)
CL_PLATFORM_PROFILE: FULL_PROFILE
OpenCL Device
------------------------------------------------------------
CL_DEVICE_VENDOR: AMD
CL_DEVICE_NAME: AMD Radeon R9 M395X Compute Engine
CL_DRIVER_VERSION: 1.2 (Jan 10 2017 22:25:08)
CL_DEVICE_VERSION: OpenCL 1.2
CL_DEVICE_PROFILE: FULL_PROFILE
CL_DEVICE_IMAGE_SUPPORT: 1
CL_DEVICE_IMAGE2D_MAX_WIDTH: 16384
CL_DEVICE_IMAGE2D_MAX_HEIGHT: 16384
CL_DEVICE_IMAGE_MAX_ARRAY_SIZE: 2048
Program Build
------------------------------------------------------------
CL_PROGRAM_BUILD_ERROR: CL_INVALID_BUILD_OPTIONS
CL_PROGRAM_BUILD_OPTIONS:
CL_PROGRAM_BUILD_LOG:
RETURN: 0
Apple... why not follow the standard?
Khanattila
28th February 2017, 18:04
@ KingLir
https://github.com/Khanattila/KNLMeansCL/archive/master.zip
now, it should work for you.
KingLir
28th February 2017, 19:59
@ KingLir
now, it should work for you.
Thanks! Now I am getting:
Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 1712, in vapoursynth.vpy_evaluateScript (src/cython/vapoursynth.c:34991)
File "VIVTC_with_TComb_script.vpy", line 16, in <module>
clip = core.knlm.KNLMeansCL(clip=clip)
File "src/cython/vapoursynth.pyx", line 1604, in vapoursynth.Function.__call__ (src/cython/vapoursynth.c:33131)
vapoursynth.Error: knlm.KNLMeansCL: build programm error!
And the new log:
OpenCL Platform
------------------------------------------------------------
CL_PLATFORM_VENDOR: Apple
CL_PLATFORM_NAME: Apple
CL_PLATFORM_VERSION: OpenCL 1.2 (Jan 4 2017 22:35:59)
CL_PLATFORM_PROFILE: FULL_PROFILE
OpenCL Device
------------------------------------------------------------
CL_DEVICE_VENDOR: AMD
CL_DEVICE_NAME: AMD Radeon R9 M395X Compute Engine
CL_DRIVER_VERSION: 1.2 (Jan 10 2017 22:25:08)
CL_DEVICE_VERSION: OpenCL 1.2
CL_DEVICE_PROFILE: FULL_PROFILE
CL_DEVICE_IMAGE_SUPPORT: 1
CL_DEVICE_IMAGE2D_MAX_WIDTH: 16384
CL_DEVICE_IMAGE2D_MAX_HEIGHT: 16384
CL_DEVICE_IMAGE_MAX_ARRAY_SIZE: 2048
Program Build
------------------------------------------------------------
CL_PROGRAM_BUILD_ERROR: CL_BUILD_PROGRAM_FAILURE
CL_PROGRAM_BUILD_OPTIONS: -cl-denorms-are-zero
-cl-fast-relaxed-math
-Werror
-D NLM_CLIP_TYPE_UNORM
-D NLM_CLIP_REF_LUMA
-D NLM_WMODE_WELSCH
-D VI_DIM_X=720
-D VI_DIM_Y=480
-D HRZ_RESULT=1
-D VRT_RESULT=1
-D HRZ_BLOCK_X=32
-D HRZ_BLOCK_Y=8
-D VRT_BLOCK_X=32
-D VRT_BLOCK_Y=8
-D NLM_D=1
-D NLM_S=4
-D NLM_H=1.200000f
-D NLM_WREF=1.000000f
CL_PROGRAM_BUILD_LOG:
<program source>:227:9: error: unused variable 'p'
int4 p = (int4) (x, y, t, 0);
^
<program source>:281:9: error: unused variable 's'
int2 s = (int2) (x, y);
^
RETURN: 0
Khanattila
28th February 2017, 20:50
Thanks for your report.
Still a few small changes and it should work.
KingLir
1st March 2017, 20:16
Thanks for your report.
Still a few small changes and it should work.
Thanks, can't wait :)
Is it something specific with my GPU ?
Khanattila
2nd March 2017, 17:43
Thanks, can't wait :)
Is it something specific with my GPU ?
No really, your GPU has nothing to do about it.
https://github.com/Khanattila/KNLMeansCL/releases/tag/v1.0.2
KNLMeansCL v1.0.2
* Tuned 'h' strength for backward compatibility.
* Fixed VapourSynth OSX version.
KNLMeansCL v1.0.1
* Fixed wrong output with 'wmode' different to 0 in some circumstances.
* Fixed second clip 'rclip' in VapourSynth.
KNLMeansCL v1.0.0
* Improved performance with CPU.
* Improved performance with AMD GCN Architecture.
* Reduced CPU overhead in some system.
* Reduced memory usage in some system.
* Advanced OpenCL parameters for fine tuning.
* Replaced 'cmode' with 'channels' and added the options to only process the chroma.
* Two new modified bisquare weighting functions.
* Increased the maximum 's' value to 8.
* Updated to VapourSynth R36.
* Removed Cauchy weighting function.
* Fixed second clip 'rclip' in some circumstances.
http://www.svethardware.cz/benchmarky-1700x-a-specialni-chladice-pro-95w-ryzen/43920/img/body-18.41DA.jpg
KingLir
2nd March 2017, 18:21
KNLMeansCL v1.0.2
* Tuned 'h' strength for backward compatibility.
* Fixed VapourSynth OSX version.
Thanks! It runs now, but the output is plagued with strange flickering and artifacts.
Before:
https://mega.nz/#!ggxF0bxA!IksjCkXKATd1VOS3ps4NrgV91p1k6YdQIRYcyvIyowY
After:
https://mega.nz/#!00JVgbDJ!J0wOYWTOBbtt3wMuTXQ3Hl0O-7wFh3wAqkZqvuUuRcA
Khanattila
2nd March 2017, 19:09
Thanks! It runs now, but the output is plagued with strange flickering and artifacts.
Before:
https://mega.nz/#!ggxF0bxA!IksjCkXKATd1VOS3ps4NrgV91p1k6YdQIRYcyvIyowY
After:
https://mega.nz/#!00JVgbDJ!J0wOYWTOBbtt3wMuTXQ3Hl0O-7wFh3wAqkZqvuUuRcA
http://www.parolacce.org/wp-content/uploads/2015/06/shutterstock_140158075-250x175.jpg
I do not have a Mac, so I'll make several attempts.
https://github.com/Khanattila/KNLMeansCL/archive/osx.zip
KingLir
2nd March 2017, 19:24
I do not have a Mac, so I'll make several attempts.
OK. New build doesn't run:
OpenCL Platform
------------------------------------------------------------
CL_PLATFORM_VENDOR: Apple
CL_PLATFORM_NAME: Apple
CL_PLATFORM_VERSION: OpenCL 1.2 (Jan 4 2017 22:35:59)
CL_PLATFORM_PROFILE: FULL_PROFILE
OpenCL Device
------------------------------------------------------------
CL_DEVICE_VENDOR: AMD
CL_DEVICE_NAME: AMD Radeon R9 M395X Compute Engine
CL_DRIVER_VERSION: 1.2 (Jan 10 2017 22:25:08)
CL_DEVICE_VERSION: OpenCL 1.2
CL_DEVICE_PROFILE: FULL_PROFILE
CL_DEVICE_IMAGE_SUPPORT: 1
CL_DEVICE_IMAGE2D_MAX_WIDTH: 16384
CL_DEVICE_IMAGE2D_MAX_HEIGHT: 16384
CL_DEVICE_IMAGE_MAX_ARRAY_SIZE: 2048
Program Build
------------------------------------------------------------
CL_PROGRAM_BUILD_ERROR: CL_BUILD_PROGRAM_FAILURE
CL_PROGRAM_BUILD_OPTIONS: -cl-single-precision-constant
-cl-denorms-are-zero
-cl-fast-relaxed-math
-Werror
-D NLM_CLIP_TYPE_UNORM
-D NLM_CLIP_REF_LUMA
-D NLM_WMODE_WELSCH
-D VI_DIM_X=720
-D VI_DIM_Y=480
-D HRZ_RESULT=1
-D VRT_RESULT=1
-D HRZ_BLOCK_X=32
-D HRZ_BLOCK_Y=8
-D VRT_BLOCK_X=32
-D VRT_BLOCK_Y=8
-D NLM_D=1
-D NLM_S=4
-D NLM_H=1.200000
-D NLM_WREF=1.000000
CL_PROGRAM_BUILD_LOG:
Error returned by cvms_element_build_from_source
RETURN: 0
Khanattila
2nd March 2017, 19:34
OK. New build doesn't run:
OpenCL Platform
------------------------------------------------------------
CL_PLATFORM_VENDOR: Apple
CL_PLATFORM_NAME: Apple
CL_PLATFORM_VERSION: OpenCL 1.2 (Jan 4 2017 22:35:59)
CL_PLATFORM_PROFILE: FULL_PROFILE
OpenCL Device
------------------------------------------------------------
CL_DEVICE_VENDOR: AMD
CL_DEVICE_NAME: AMD Radeon R9 M395X Compute Engine
CL_DRIVER_VERSION: 1.2 (Jan 10 2017 22:25:08)
CL_DEVICE_VERSION: OpenCL 1.2
CL_DEVICE_PROFILE: FULL_PROFILE
CL_DEVICE_IMAGE_SUPPORT: 1
CL_DEVICE_IMAGE2D_MAX_WIDTH: 16384
CL_DEVICE_IMAGE2D_MAX_HEIGHT: 16384
CL_DEVICE_IMAGE_MAX_ARRAY_SIZE: 2048
Program Build
------------------------------------------------------------
CL_PROGRAM_BUILD_ERROR: CL_BUILD_PROGRAM_FAILURE
CL_PROGRAM_BUILD_OPTIONS: -cl-single-precision-constant
-cl-denorms-are-zero
-cl-fast-relaxed-math
-Werror
-D NLM_CLIP_TYPE_UNORM
-D NLM_CLIP_REF_LUMA
-D NLM_WMODE_WELSCH
-D VI_DIM_X=720
-D VI_DIM_Y=480
-D HRZ_RESULT=1
-D VRT_RESULT=1
-D HRZ_BLOCK_X=32
-D HRZ_BLOCK_Y=8
-D VRT_BLOCK_X=32
-D VRT_BLOCK_Y=8
-D NLM_D=1
-D NLM_S=4
-D NLM_H=1.200000
-D NLM_WREF=1.000000
CL_PROGRAM_BUILD_LOG:
Error returned by cvms_element_build_from_source
RETURN: 0
The old version 0.7.7 works well for you?
KingLir
2nd March 2017, 19:59
The old version 0.7.7 works well for you?
Haven't tried until now:
(clCreateImage(d.mem_in[0]): CL_IMAGE_FORMAT_NOT_SUPPORTED)
Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 1712, in vapoursynth.vpy_evaluateScript (src/cython/vapoursynth.c:34991)
File "VIVTC_with_TComb_script.vpy", line 22, in <module>
clip = core.knlm.KNLMeansCL(clip=clip)
File "src/cython/vapoursynth.pyx", line 1604, in vapoursynth.Function.__call__ (src/cython/vapoursynth.c:33131)
vapoursynth.Error: knlm.KNLMeansCL: fatal error!
(clCreateImage(d.mem_in[0]): CL_IMAGE_FORMAT_NOT_SUPPORTED)
Khanattila
3rd March 2017, 16:54
Haven't tried until now:
(clCreateImage(d.mem_in[0]): CL_IMAGE_FORMAT_NOT_SUPPORTED)
Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 1712, in vapoursynth.vpy_evaluateScript (src/cython/vapoursynth.c:34991)
File "VIVTC_with_TComb_script.vpy", line 22, in <module>
clip = core.knlm.KNLMeansCL(clip=clip)
File "src/cython/vapoursynth.pyx", line 1604, in vapoursynth.Function.__call__ (src/cython/vapoursynth.c:33131)
vapoursynth.Error: knlm.KNLMeansCL: fatal error!
(clCreateImage(d.mem_in[0]): CL_IMAGE_FORMAT_NOT_SUPPORTED)
Another job for you
https://github.com/Khanattila/KNLMeansCL/archive/osx.zip
KingLir
3rd March 2017, 23:32
Another job for you
https://github.com/Khanattila/KNLMeansCL/archive/osx.zip
Builds a bit differently:
http://pastebin.com/fcCQ9bG5
Runs with a bit different output (but still with flickering and artifacts):
https://mega.nz/#!d5hTmTIL!cAV9dh_IW8rX5ec0qs5bjnWQQbYDFrZ8ATUrLY5OF1Y
Khanattila
5th March 2017, 16:28
Builds a bit differently:
http://pastebin.com/fcCQ9bG5
Runs with a bit different output (but still with flickering and artifacts):
https://mega.nz/#!d5hTmTIL!cAV9dh_IW8rX5ec0qs5bjnWQQbYDFrZ8ATUrLY5OF1Y
https://github.com/Khanattila/KNLMeansCL/archive/osx.zip
I removed some optimizations, try it.
KingLir
5th March 2017, 17:14
https://github.com/Khanattila/KNLMeansCL/archive/osx.zip
I removed some optimizations, try it.
Seems better but now with different artifacts. Maybe you can compare to what you get on Windows with my input ?
Here is the new output:
https://mega.nz/#!Nthh1L4T!H4K7ziB5rFmp9k2r_vDHA78xXYn4-nbnyVddjry4d5M
And here my script:
clip = core.ffms2.Source(source=filename)
clip = core.bifrost.Bifrost(clip, interlaced=True) # Remove rainbows
clip = core.tcomb.TComb(clip=clip, mode=0) # Remove dotcrawl
clip = core.vivtc.VFM(clip=clip, order=1) # IVTC part 1
clip = core.vivtc.VDecimate(clip=clip) # IVTC part 2
clip = core.knlm.KNLMeansCL(clip=clip)
clip.set_output()
and again the input:
https://mega.nz/#!ggxF0bxA!IksjCkXKATd1VOS3ps4NrgV91p1k6YdQIRYcyvIyowY
Khanattila
5th March 2017, 17:24
Seems better but now with different artifacts. Maybe you can compare to what you get on Windows with my input ?
Here is the new output:
https://mega.nz/#!Nthh1L4T!H4K7ziB5rFmp9k2r_vDHA78xXYn4-nbnyVddjry4d5M
And here my script:
clip = core.ffms2.Source(source=filename)
clip = core.bifrost.Bifrost(clip, interlaced=True) # Remove rainbows
clip = core.tcomb.TComb(clip=clip, mode=0) # Remove dotcrawl
clip = core.vivtc.VFM(clip=clip, order=1) # IVTC part 1
clip = core.vivtc.VDecimate(clip=clip) # IVTC part 2
clip = core.knlm.KNLMeansCL(clip=clip)
clip.set_output()
and again the input:
https://mega.nz/#!ggxF0bxA!IksjCkXKATd1VOS3ps4NrgV91p1k6YdQIRYcyvIyowY
https://github.com/Khanattila/KNLMeansCL/archive/osx.zip
There is always a precision problem
KingLir
5th March 2017, 19:53
There is always a precision problem
New version with artifacts:
https://mega.nz/#!N5Q3DIjD!Umhy-DFb0DcNGR5CX15sBs8UQeGyWt7YYHPuZ-uvLhs
KingLir
7th March 2017, 11:30
Also, when I tried to run Plum I am getting errors that may help you track the issue/s. Running with the latest build you posted here - I haven't tried the previous builds.
https://forum.doom9.org/showthread.php?p=1799964#post1799964
Khanattila
8th March 2017, 18:18
Also, when I tried to run Plum I am getting errors that may help you track the issue/s. Running with the latest build you posted here - I haven't tried the previous builds.
https://forum.doom9.org/showthread.php?p=1799964#post1799964
Maybe it's a problem of the AMD driver, because you have strange problems.
I do not know if I can work around it.
https://github.com/Khanattila/KNLMeansCL/archive/osx.zip
KingLir
8th March 2017, 19:07
Maybe it's a problem of the AMD driver, because you have strange problems.
I do not know if I can work around it.
https://github.com/Khanattila/KNLMeansCL/archive/osx.zip
Thanks for trying!
It's almost certainly not the AMD driver since, on macOS, there is only the official Apple-supplied driver and millions use it with many different OpenCL software.
It's probably just some different variation of one of your code lines that is needed when running on macOS' OpenCL.
With latest version, failed on run:
http://pastebin.com/tLzEmvqm
KingLir
12th March 2017, 19:54
No new ideas for me to try ?
MysteryX
20th March 2017, 02:48
Why does KNLMeans runs slower on VapourSynth than on Avisynth?
https://github.com/Khanattila/KNLMeansCL/wiki/Benchmark
TheFluff
20th March 2017, 02:58
Why does KNLMeans runs slower on VapourSynth than on Avisynth?
https://github.com/Khanattila/KNLMeansCL/wiki/Benchmark
They run at almost exactly the same speed (less than 0.05 fps difference in my tests) if Avs+ is run single threaded. If you run Avs+ with prefetch(4) at the end of the script you get a completely trivial speed increase of like 1 fps over VS (in which KNLMeansCL runs in mode fmParallelRequests, so there's only one instance of it) at the expense of eating almost four times as much memory. A guess pulled out of my ass says that the extra fps in Avs+ comes from the extra threads getting to use the GPU during the time when a filter instance that just finished processing a frame is busy copying buffers, or something like that.
See also https://forum.doom9.org/showthread.php?t=174437
Khanattila
20th March 2017, 18:11
For benchmarking I'm using old fashioned AviSynth v2.6.0 32-bit.
Otherwise I would have writen AviSynth+
MysteryX
20th March 2017, 22:54
For benchmarking I'm using old fashioned AviSynth v2.6.0 32-bit.
Otherwise I would have writen AviSynth+
So what could cause such difference?
Running AVS+ with 2 threads would most likely further result in slightly higher performance.
Groucho2004
20th March 2017, 23:55
Running AVS+ with 2 threads would most likely further result in slightly higher performance.
Not my experience. Using Prefetch() with 2 or 4 threads on my 4 core CPU actually lowers performance slightly and obviously increases GPU (and CPU) memory usage.
MysteryX
23rd April 2017, 04:43
...
With this simple code, it produces random results and mixes frames together. I can't believe I went to long without realizing it.
It fails when running as MT_SERIALIZED. The only MT mode that works is MT_MULTI_INSTANCE -- which isn't ideal for this type of filter.
AviSource("Preview.avi")
KNLMeansCL(D=1, A=1, h=1.5, device_type="GPU")
Prefetch(4)
For example, I opened the same script 3 times at the same frame and got this
https://s22.postimg.org/d8nochfgd/img1.png (https://postimg.org/image/d8nochfgd/) https://s22.postimg.org/5h6ydxbb1/img2.png (https://postimg.org/image/5h6ydxbb1/) https://s22.postimg.org/nl9yyk8zh/img3.png (https://postimg.org/image/nl9yyk8zh/)
TheFluff
23rd April 2017, 14:02
#2 there looks kinda like h264 decoder error recovery. Are you sure this is all KNLMeans?
MysteryX
23rd April 2017, 14:19
Changing KNLMeans to MT_MULTI_INSTANCE fixes the issue -- and in this code I'm loading an AVI file, no H264.
Khanattila
25th April 2017, 19:06
Changing KNLMeans to MT_MULTI_INSTANCE fixes the issue -- and in this code I'm loading an AVI file, no H264.
The new branch v1.* has changed some things.
MysteryX
2nd May 2017, 19:19
I'll be waiting, in the rain, for your return... with AVS+ native high-bit-depth support and fix to this MT bug
Are there any more requirements to use KNLMeansCL release v1.0.2 (https://github.com/Khanattila/KNLMeansCL/releases) under AviSynth+ MT r2455?
I put KNLMeansCL-v1.0.2.zip:KNLMeansCL.dll into ...\AviSynth 2.5\plugins; AVSMeter reports Windows system error 127 (ERROR_PROC_NOT_FOUND).
I put KNLMeansCL-v1.0.2.zip:x64/KNLMeansCL.dll into ...\AviSynth+\plugins64; AVSMeter64 reports Windows system error 127 (ERROR_PROC_NOT_FOUND).
OpenCL.dll exists in Windows\system32 and in Windows\SysWoW64 (Windows 7 SP1, GeForce 9600, Nvidia driver 342.01; Windows Device Manager lists Nvidia OpenCL drivers among display drivers).
Groucho2004
4th May 2017, 14:43
I put KNLMeansCL-v1.0.2.zip:x64/KNLMeansCL.dll into ...\AviSynth+\plugins64; AVSMeter64 reports Windows system error 127 (ERROR_PROC_NOT_FOUND).
OpenCL.dll exists in Windows\system32 and in Windows\SysWoW64 (Windows 7 SP1, GeForce 9600, Nvidia driver 342.01; Windows Device Manager lists Nvidia OpenCL drivers among display drivers).Look at the requirements (https://github.com/Khanattila/KNLMeansCL/wiki/Requirements). GT9600 does not support OpenCL 1.2, neither does driver version 342.01. You have to downgrade to KNLMeansCL 0.6.11.
OK, that explains some ... I wish the ZIP file included at least a small README with a summary or link to these requirements. I promise to read README's, at least in case of issues, if there are any.
So I guess I should avoid QTGMC with options which would try to access KNLMeansCL on this machine. Fortunately, it's optional for this use.
Khanattila
4th May 2017, 16:54
...
With this simple code, it produces random results and mixes frames together. I can't believe I went to long without realizing it.
It fails when running as MT_SERIALIZED. The only MT mode that works is MT_MULTI_INSTANCE -- which isn't ideal for this type of filter.
AviSource("Preview.avi")
KNLMeansCL(D=1, A=1, h=1.5, device_type="GPU")
Prefetch(4)
For example, I opened the same script 3 times at the same frame and got this
https://s22.postimg.org/d8nochfgd/img1.png (https://postimg.org/image/d8nochfgd/) https://s22.postimg.org/5h6ydxbb1/img2.png (https://postimg.org/image/5h6ydxbb1/) https://s22.postimg.org/nl9yyk8zh/img3.png (https://postimg.org/image/nl9yyk8zh/)
#2 there looks kinda like h264 decoder error recovery. Are you sure this is all KNLMeans?
Changing KNLMeans to MT_MULTI_INSTANCE fixes the issue -- and in this code I'm loading an AVI file, no H264.
I'm completing the latest checks, but MT_NICE_FILTER seems to work properly
PS. Forget it, the design of the new version is not really compatible.
Khanattila
4th May 2017, 17:52
https://github.com/Khanattila/KNLMeansCL/releases/tag/v1.1.0
KNLMeansCL v1.1.0
* Added AviSynth MT support (MT_MULTI_INSTANCE).
* Added AviSynth+'s high bit depth support.
* Replaced 'lsb_inout' with 'stacked'.
* Info now display 'Bits per sample'.
Dreamland
4th May 2017, 19:05
Thx a lot new version of KNLMeansCL
excuse me for my bad english
I have an issue
https://t9.pixhost.org/thumbs/385/39811504_appunti01.png (https://pixhost.org/show/385/39811504_appunti01.png)
my smdegrain is v. 3.1.2.92s mod
my QTGMC is v. 3.357 ( i think last version)
older version of KNLMeansCL work very well
Help me Khanattila
thx
MysteryX
4th May 2017, 19:29
so... MT_NICE_FILTER works or not?
AFAIK MT_MULTI_INSTANCE was already working; but the only mode giving consistent results.
@Dreamland: SMDegrain needs to be changed to the newer KNLMeans versions it seems.
If you want to try fixing it yourself, search and replace in your SMDegrain script, replace all occurances of 'lsb_inout' with 'stacked'
Dreamland
4th May 2017, 21:57
ok..I can do..hope it works
thanks a lot!
Khanattila
4th May 2017, 22:03
so... MT_NICE_FILTER works or not?
AFAIK MT_MULTI_INSTANCE was already working; but the only mode giving consistent results.
MT_NICE_FILTER works only with Prefetch(1)... so basically, it doesn't work.
@Khanattila:
A bit off topic, but on your Github I see an old project KPassFilterCL. Do I see correctly that it's Avisynth only? I tried using it in Vapoursynth through the core.avs.LoadPlugin stuff, and it appears to be working. I use fmtconv routines to convert 16bit Vapoursynth to avisynth's "stacked" format, then use the routines from KPassFilterCL with their 'lsb_inout' set to True. This works OK (I guess) for 'mode = magnitude' but seems to only produce black output when 'mode = phase' ? If I switch to 8bit I do suddenly get output.
Can you explain a bit of it? I'm trying to separate an image into multiple images based on frequeny content (or wavelets maybe?), to apply different filtering to different frequency-ranges and then merge it all back into a single image. KPassFilterCL seems to be made for that but I'm not sure if that's going to work or if I'm using it wrong.
With the 'low pass' routine I'm trying to get, well, only low-frequency content, which I expect to be a very blurry picture (I'm talking about a grayscale luminance only clip BTW), but in brightness / contrast / levels to be pretty much the same as the starting image.
But I only seem to get very dark output, when I change the 'cutoff' parameter the image starts to look more like the original in brightness / contrast, but also less blurry, so more high-freq content is getting in :(.
Is it normal that the cutoff parameter seems to require very high values (as in over 250000.0) to do something?
And if I would want to split an image into three parts, very blurry parts (almost no details, low-frequency), course details (mid-frequency) and small (micro) details (high frequency) can I do that with this plug? If so, could you give an example?
BakaProxy
7th May 2017, 01:21
@Khanatila, I think I found a(n edge case) bug.
http://screenshotcomparison.com/comparison/209076
(If it's not obvious, check the black smudge at the top.)
This happens with bigger a values (9 on this example on a 480p clip) and If I recall correctly knlmeanscl internally pads the video clip, so I think that this is just the black padding leaking into the image. (if so, maybe you could mirror instead?)
Though this is just my hypothesis, feel free and I'd love you to prove me wrong.
As for the data on this specific scenario they're in the screenshot using info=true, if more is necessary I'm ready to provide such.
Logan9778
12th May 2017, 23:01
Hey guys, I'm new to all this GitHub stuff. How would you compile the code for KNLMeansCL to get the .dll file in Windows 10 ( I use AviSynth )?
Groucho2004
12th May 2017, 23:17
Hey guys, I'm new to all this GitHub stuff. How would you compile the code for KNLMeansCL to get the .dll file in Windows 10 ( I use AviSynth )?Why do you feel the need to compile it if there are perfectly adequate releases (https://github.com/Khanattila/KNLMeansCL/releases)?
Khanattila
12th May 2017, 23:36
@Khanattila:
A bit off topic, but on your Github I see an old project KPassFilterCL. Do I see correctly that it's Avisynth only? I tried using it in Vapoursynth through the core.avs.LoadPlugin stuff, and it appears to be working. I use fmtconv routines to convert 16bit Vapoursynth to avisynth's "stacked" format, then use the routines from KPassFilterCL with their 'lsb_inout' set to True. This works OK (I guess) for 'mode = magnitude' but seems to only produce black output when 'mode = phase' ? If I switch to 8bit I do suddenly get output.
Can you explain a bit of it? I'm trying to separate an image into multiple images based on frequeny content (or wavelets maybe?), to apply different filtering to different frequency-ranges and then merge it all back into a single image. KPassFilterCL seems to be made for that but I'm not sure if that's going to work or if I'm using it wrong.
With the 'low pass' routine I'm trying to get, well, only low-frequency content, which I expect to be a very blurry picture (I'm talking about a grayscale luminance only clip BTW), but in brightness / contrast / levels to be pretty much the same as the starting image.
But I only seem to get very dark output, when I change the 'cutoff' parameter the image starts to look more like the original in brightness / contrast, but also less blurry, so more high-freq content is getting in :(.
Is it normal that the cutoff parameter seems to require very high values (as in over 250000.0) to do something?
And if I would want to split an image into three parts, very blurry parts (almost no details, low-frequency), course details (mid-frequency) and small (micro) details (high frequency) can I do that with this plug? If so, could you give an example?
Sorry if I did not answer you first but that filter was born almost for fun and I never optimized or improved its effectiveness.
If you really want to use it for something I have to check it for a moment, because I really do not remember what all the functions do.
Khanattila
12th May 2017, 23:40
@Khanatila, I think I found a(n edge case) bug.
http://screenshotcomparison.com/comparison/209076
(If it's not obvious, check the black smudge at the top.)
This happens with bigger a values (9 on this example on a 480p clip) and If I recall correctly knlmeanscl internally pads the video clip, so I think that this is just the black padding leaking into the image. (if so, maybe you could mirror instead?)
Though this is just my hypothesis, feel free and I'd love you to prove me wrong.
As for the data on this specific scenario they're in the screenshot using info=true, if more is necessary I'm ready to provide such.
Ok, this is bug maybe. I have to check. Or maybe I did it, since the version you use is old.
Logan9778
13th May 2017, 00:21
Why do you feel the need to compile it if there are a perfectly adequate releases (https://github.com/Khanattila/KNLMeansCL/releases)?
Ahh, thanks, I didn't see the zip had the .dll inside it.
MysteryX
27th May 2017, 16:48
With this simple code, it produces random results and mixes frames together. I can't believe I went to long without realizing it.
It fails when running as MT_SERIALIZED. The only MT mode that works is MT_MULTI_INSTANCE -- which isn't ideal for this type of filter.
For the records, this is probably due to this bug in Avisynth+ with MT_SERIALIZE
https://forum.doom9.org/showthread.php?p=1807903#post1807903
MysteryX
9th June 2017, 00:03
This doesn't work in 16-bit
ConvertToYV24()
ConvertBits(16)
KNLMeansCL(D=2, A=2, h=1.5, channels="YUV")
KNLMeansCL: 'channels = YUV' require a YV24 pixel format!
Khanattila
13th June 2017, 17:54
This doesn't work in 16-bit
ConvertToYV24()
ConvertBits(16)
KNLMeansCL(D=2, A=2, h=1.5, channels="YUV")
KNLMeansCL: 'channels = YUV' require a YV24 pixel format!
I am very busy so I do not have time now, but I notice your reports :goodpost:
goorawin
17th June 2017, 06:52
I have been using KNLMeansCL 64bit for sometime without problems on windows10 pro with a GeForce GTX 650 graphics card.
Now after some major windows updates, it no longer works in 64 bit. It will not load the plugin and comes up with the error “there is no function named KNLMeansCL”. I have tried a number of versions of KNLMeansCL (including v1.1.0) but all have the same problem. All other 64bit plugin work as they should. Even xnlmeans works which I assume is not much different to KNLMeansCL except for GPU usage.
Interestingly the32 bit version of KNLMeansCL works just fine, so what's the difference?.
The other interesting thing is that, on another windows 10 pro computer with an on board Intel HD Graphics 630 card which has also had the same updates, everything work as it should in 64bit.
So what are the dependencies of KNLMeansCL in 64bit?
Any help would be appreciated.
Groucho2004
17th June 2017, 08:25
So what are the dependencies of KNLMeansCL in 64bit?Run AVSMeter64 (https://forum.doom9.org/showthread.php?t=173259) with the switch "-avsinfo", it will report any missing dependencies.
goorawin
18th June 2017, 01:00
From my experence reinstalling GeForce driver after Win10 major updates solves this issue. YMMV.
That did the trick thank you. Interesting that it only caused an issue with 64bit scripts.
SaurusX
30th June 2017, 19:14
Great filter, khanatilla. Non-local means is an excellent noise reduction theory and with OpenCL its actually usable in my computer. Thanks for your hard work!
SaurusX
25th July 2017, 15:51
Well, I found a way to break the filter while encoding some cartoons. Here's the pseudo-script:
MPEG2SOURCE("myclip")
TComb(mode=0, blah, blah) #for dot-crawl removal
TFM()
TDecimate()
the masked and motion-compensating derainbowing procedure found here (http://forum.doom9.org/showthread.php?t=171715)
Bifrost(interlaced=false) #1.1 version for final de-rainbowing
KNLMeansCL(d=2,a=3,h=1.2,device_type="GPU") #Using Intel HD4000 graphics
maa2() #anti-alias
msharpen() #resharpen
dehalo_alpha() #de-halo
awarpsharp2() #sharpen chroma
It seems like too much temporal analysis will cause mask pops, frame flashing, and mistimed chroma in the final encode. I can remove TComb or remove Bifrost or change the d parameter to 1 and the problems disappear. This may not be a specific problem to KNLMeansCL, but I thought you'd like to know about it.
MysteryX
1st August 2017, 18:22
This doesn't work in 16-bit
ConvertToYV24()
ConvertBits(16)
KNLMeansCL(D=2, A=2, h=1.5, channels="YUV")
KNLMeansCL: 'channels = YUV' require a YV24 pixel format!
I am very busy so I do not have time now, but I notice your reports :goodpost:
This one is an easy bug, any plans to fix it soon?
tuanden0
10th August 2017, 12:39
Sorry Sir, but after update my VGA card driver, the KNLMeansCL fillter make my PC reboot because the GPU load over 100%.
I tried to reinstall old driver but the issue still there.
I'm using NVIDIA GeForce GTX 650Ti.
Ben_Nicholls
24th August 2017, 18:32
Sorry Sir, but after update my VGA card driver, the KNLMeansCL fillter make my PC reboot because the GPU load over 100%.
I tried to reinstall old driver but the issue still there.
I'm using NVIDIA GeForce GTX 650Ti.
Have you confirmed that your GPU is 100% stable?
Running MSI Kombustor (http://www.geeks3d.com/20150710/msi-kombustor-v3-5-2-64-bit-v2-6-0-32-bit-download-gpu-stress-test-benchmark/) or FurMark (http://www.ozone3d.net/benchmarks/fur/) should let you know: if either one crashes, your GPU isn't stable and probably needs replacing.
tuanden0
27th August 2017, 10:45
Have you confirmed that your GPU is 100% stable?
Running MSI Kombustor (http://www.geeks3d.com/20150710/msi-kombustor-v3-5-2-64-bit-v2-6-0-32-bit-download-gpu-stress-test-benchmark/) or FurMark (http://www.ozone3d.net/benchmarks/fur/) should let you know: if either one crashes, your GPU isn't stable and probably needs replacing.
Thank for your reply,
My problem solved, my VGA card is dirty, so they crashed because it's too hot :mad:
I cleaned my VGA so it's OK :p
MysteryX
27th August 2017, 18:21
Thank for your reply,
My problem solved, my VGA card is dirty, so they crashed because it's too hot :mad:
I cleaned my VGA so it's OK :p
Just cleaned my laptop too. Removing dust fixes a few things :)
Khanattila
18th September 2017, 10:34
Roughly what does NLMeansCL2(h=radius*1.5,u=3,v=3) convert to for KNLMeansCL()?
KNLMeansCL(d=0), but the results are different.
NLMeansCL2 worked on a smaller image.
Ben_Nicholls
23rd September 2017, 21:18
KNLMeansCL(d=0), but the results are different...
Thanks :)
tuanden0
1st October 2017, 10:51
I tried to use KNLMeansCL to denoise all luma and chroma but I get this error and the screen preview is black
knlm.KNLMeansCL: fatal error!
My test script:
clip = core.lsmas.LWLibavSource(r"E:\Download\testsc.mkv", format="YUV420P8")
clip = core.std.AssumeFPS(clip, fpsnum=24000, fpsden=1001)
clip = core.knlm.KNLMeansCL(clip, h=0.4, channels="YUV")
clip.set_output()
Khanattila
1st October 2017, 11:31
I tried to use KNLMeansCL to denoise all luma and chroma but I get this error and the screen preview is black
My test script:
"YUV" requires 4:4:4, aka no chroma subsampling.
clip = core.knlm.KNLMeansCL(clip, h=0.4, channels="Y")
clip = core.knlm.KNLMeansCL(clip, h=0.4, channels="UV")
or
#convert to rgb
clip = core.knlm.KNLMeansCL(clip, h=0.4, channels="RGB")
#convert to YUV again
tuanden0
1st October 2017, 14:05
"YUV" requires 4:4:4, aka no chroma subsampling.
clip = core.knlm.KNLMeansCL(clip, h=0.4, channels="Y")
clip = core.knlm.KNLMeansCL(clip, h=0.4, channels="UV")
or
#convert to rgb
clip = core.knlm.KNLMeansCL(clip, h=0.4, channels="RGB")
#convert to YUV again
It's work, :thanks:
SaurusX
6th October 2017, 19:05
Can someone give me a primer as to what various settings of D and A result in? Such as what effect is to be expected, say, when D=1 and A=3, D=2 and A=1, etc? Maybe something like "X type of noise responds best with Y settings". It could be too broad of a question, but since this is such a time-expensive filter I'm looking for the best bang for the buck.
Currently I've settled on using knlmeanscl(D=1, A=3, h=??, S=1) for almost everything. I can push the D up to 2, but that increases encoding time on my GTX750 Ti by 40%. Also, on my system pushing up the D parameter can cause encoding errrors when combined with too many other temporal filters (I feel like I mention that a lot).
lansing
7th October 2017, 02:55
Can someone give me a primer as to what various settings of D and A result in? Such as what effect is to be expected, say, when D=1 and A=3, D=2 and A=1, etc? Maybe something like "X type of noise responds best with Y settings". It could be too broad of a question, but since this is such a time-expensive filter I'm looking for the best bang for the buck.
Currently I've settled on using knlmeanscl(D=1, A=3, h=??, S=1) for almost everything. I can push the D up to 2, but that increases encoding time on my GTX750 Ti by 40%. Also, on my system pushing up the D parameter can cause encoding errrors when combined with too many other temporal filters (I feel like I mention that a lot).
Filter description here
https://github.com/Khanattila/KNLMeansCL/wiki/Filter-description
In short, D and A are for temporal size and spatial size. For temporal, unless you have some crazy dancing grain, D=2 (5 frames) should be enough for your needs, I just use D=1.
For A, S and H you'll have to tweak it according to your source. First bump H (strength) high enough to a point where it removes all noises or where it stopped removing more noise. Then work on A and S one at a time to remove noise that H haven't. At the same time gradually slide down H without introducing more noise.
A is the speed killer of the filter, on my GTX 650 ti boost, setting A from 1 to 5 had my speed dropped from 36fps to 2.97fps on a 1440x1080 clip...
clip = core.knlm.KNLMeansCL(clip, d=1, a=5, s=4, h=8)
I really want to know how the newer graphic cards do with a higher A value, because 3fps is just way too slow to me.
Khanattila
13th October 2017, 23:28
A is the speed killer of the filter, on my GTX 650 ti boost, setting A from 1 to 5 had my speed dropped from 36fps to 2.97fps on a 1440x1080 clip...
clip = core.knlm.KNLMeansCL(clip, d=1, a=5, s=4, h=8)
I really want to know how the newer graphic cards do with a higher A value, because 3fps is just way too slow to me.
RX 480 ~8.5 fps
edcrfv94
14th October 2017, 06:29
Filter description here
https://github.com/Khanattila/KNLMeansCL/wiki/Filter-description
In short, D and A are for temporal size and spatial size. For temporal, unless you have some crazy dancing grain, D=2 (5 frames) should be enough for your needs, I just use D=1.
For A, S and H you'll have to tweak it according to your source. First bump H (strength) high enough to a point where it removes all noises or where it stopped removing more noise. Then work on A and S one at a time to remove noise that H haven't. At the same time gradually slide down H without introducing more noise.
A is the speed killer of the filter, on my GTX 650 ti boost, setting A from 1 to 5 had my speed dropped from 36fps to 2.97fps on a 1440x1080 clip...
clip = core.knlm.KNLMeansCL(clip, d=1, a=5, s=4, h=8)
I really want to know how the newer graphic cards do with a higher A value, because 3fps is just way too slow to me.
SetMemoryMax(3000)
colorbars(width=1440, height=1080, pixel_type="yv12").killaudio().assumefps(25, 1)
KNLMeansCL(d=1, a=5, s=4, h=8, device_type="GPU")
MSI GTX 1080 Ti GAMING X @1961MHz ~93% GPU load
15.37fps
SetMemoryMax(3000)
colorbars(width=1920, height=1080, pixel_type="yv12").killaudio().assumefps(25, 1)
KNLMeansCL(d=2, a=4, s=4, device_type="GPU")
MSI GTX 1080 Ti GAMING X @1961MHz ~95% GPU load
10.07fps
lansing
14th October 2017, 20:34
So the newest card is 5x my speed, scaled reasonable base on the years both card came out.
And why is your card at 2G? The inform at newegg said that it has 11G.
Groucho2004
14th October 2017, 21:56
And why is your card at 2G? The inform at newegg said that it has 11G.Methinks you're confusing video memory with clock speed.
lansing
15th October 2017, 00:27
Methinks you're confusing video memory with clock speed.
Ok I saw it now.
Khanattila
15th October 2017, 12:25
In theory you can use multiple graphics card. Actually it doesn't work because second GPU is waiting but it would be something like that:
function mGPU(clip source, int d, int a, int s) {
clipWdt = Width(source) / 2
clipHgh = Height(source)
halo = a + s
clipA = Crop(source, 0, 0, clipWdt + halo, clipHgh)
clipB = Crop(source, clipWdt - halo, 0, clipWdt + halo, clipHgh)
clipA = KNLMeansCL(clipA, d, a, s, device_id = 0)
clipB = KNLMeansCL(clipB, d, a, s, device_id = 1)
clipA = Crop(clipA, 0, 0, clipWdt, clipHgh)
clipB = Crop(clipB, halo, 0, clipWdt, clipHgh)
return StackHorizontal(clipA, clipB)
}
johnmeyer
5th November 2017, 00:19
I am getting AviSynthGetFrame errors any time I try to set d>0 or a>1 using AVISynth+ on WinXP Pro 32-bit.
Here is what avsmeter reports:
E:\Documents\My Videos\AVISynth\AVISynth Plugins\plugins>avsmeter "E:\Documents\
My Videos\AVISynth\Scripts\KNL_Means Interlaced Denoising.avs"
AVSMeter 2.4.7 (x86) - Copyright (c) 2012-2017, Groucho2004
AviSynth+ 0.1 (r2508, MT, i386) (0.1.0.0)
KNLMeansCL: AviSynthGetFrame error!
I tried going back to my earlier version of AVISynth, but Groucho's swtiching batch file, unfortunately, doesn't change enough things, and I get a whole new set of errors, so I don't want to compound the troubleshooting by trying to go back to 5.8 or 6.0.
AVISynth+ seems to be better in almost every way, so I'd like to stick with it, if I can.
I am using the non-GPU version of KNLMeans, although before I did that, I went to the Intel site and downloaded and installed the latest version of OpenCL and then used the most recent version of KNLMeansCL. Since I have an older GPU (GeForce 9800 GT), I don't think I can use the GPU, even with updated drivers.
The problem I am reporting here is with KNLMeansCL-v0.6.11 (9/23/2015).
I can get the plugin to work fine if I set d=0, but unfortunately, the denoising isn't very good without using adjacent fields.
Here is the script I'm using:
loadPlugin("E:\Documents\My Videos\AVISynth\AVISynth Plugins\plugins\KNLMeansCL.dll")
#setmemorymax(1024)
d_input=0 #number of past/future frames default=1; 0=1 frame; 1=3 frames
a_input=1 #radius of search window; default=2; 0=1 pixel; 1=9 pixels
s_input=4 #radius of similarity; default=4
h_input=15.0 #filter strength
wmode_input=2 #weighting function (choose which one); default=0
source=AVISource("E:\fs.avi").KillAudio().requestlinear()
#source=AVISource("E:\fs.avi").KillAudio()
separatefields(source)
even=selecteven()
odd=selectodd()
den_even=KNLMeansCL(even,d=d_input,a=a_input,s=s_input,h=h_input,wmode=wmode_input)
del_odd=KNLMeansCL(odd,d=d_input,a=a_input,s=s_input,h=h_input,wmode=wmode_input)
interleave(den_even,del_odd)
output=weave()
#output = KNLMeansCL(source,d=d_input,a=a_input,s=s_input,h=h_input)
#return output
#return source
#stackhorizontal(source,output)
#/*
return Interleave(
\ source
\ , output
\ )
#*/
# Enable MT!
Prefetch(5)
I read a few posts earlier in this massively long thread that people had problems using this on interlaced video. Perhaps I should re-write this a little to see if I can use it on dumb bobbed video because that way I'd only have one call to the DLL. [edit]I just did that, and the bobbed version freezes in exactly the same way. Two calls is not the problem. [/end edit]
I've killed a lot of time on this, and am just going to have to use a lesser denoiser (MDegrain2) so I can finish the project. However, when I use the settings I want with KNLMeansCL, I can get a few dozen frames done before it crashes, and those are absolutely spectacular. Really good stuff.
It feels like a memory issue because it seems to fail at earlier or later frames, depending on what SetMemoryMax values I use. It is as though some data area is filling up.
Just as I was getting ready to post this, I ran it again, and my computer completely locked up and froze, like the old DOS days of the 1980s. I've had this computer for seven years, and I don't think it ever locked up like that. There is definitely something squirrely (technical term) going on under the covers.
Any hints or ideas would be greatly appreciated.
LigH
5th November 2017, 00:26
I remember that I can't use a current KNLMeansCL with a GeForce 9800, not even with a GTS 450. It requires a more recent OpenCL API version.
Groucho2004
5th November 2017, 09:48
@John
First of all, your card does support OpenCL 1.1 which works with KNLMeansCL 0.6.11. As for drivers, all you need is the latest Nvidia driver that works for your card (340.52 (http://www.nvidia.com/Download/index.aspx?lang=en-us)). No Intel driver required.
It's most likely a memory issue. Your 9800 probably doesn't have enough memory for 2 KNLMeansCL calls and running this in 5 threads. Reduce the number of threads or run KNLMeansCL single-threaded (add "SetFilterMTMode("knlmeanscl", MT_SERIALIZED)" at the beginning of your script).
You can monitor GPU memory usage by running AVSMeter with the "-gpu" switch. GPU-Z (https://www.techpowerup.com/download/gpu-z/) must be running in this case.
johnmeyer
5th November 2017, 17:02
Groucho,
Many thanks! I'll do everything you recommended and report back. I actually don't know what driver version I'm running. I'm running AVISynth+ at this point, so I don't know if SetFilterMTMode will do the same thing in that environment. With AVISynth "SetMTMode" isn't used.
LigH
5th November 2017, 17:08
Groucho2004 already mentioned SetFilterMTMode because it is an AviSynth+ feature. You can control the parallelizability per AviSynth filter function automatically for every occurence. Legacy AviSynth MT does not support that globally, you would have to switch the MT mode before and after such restricted functions.
johnmeyer
5th November 2017, 19:37
Thanks for the help but it looks like I'll have to try another avenue. I tried to install the 340.52 driver and it wouldn't install (I got an error message from the nVidia installer that it could not install). I did a little research and found that this is a common problem, so I manually installed the driver. Unfortunately I ended up with a 4-bit 640x480 display using the generic Windows driver. So I backed out of that, and as I was waiting for System Restore to complete I remembered that I'd been through this loop before a few years ago and that's why I'm stuck with the 258.96 drivers.
Also, I did try adding the
SetFilterMTMode("knlmeanscl", MT_SERIALIZED)
line to the beginning of the script, but it did not change the crash behavior at all.
So, since this a dual boot computer, I'll use this as an excuse to install AVISynth+ on my Windows 7 Pro 64-bit installation, and see if I get any better results there.
Thanks again for the help.
DJATOM
5th November 2017, 20:01
Try 'SetFilterMTMode("knlmeanscl", MT_SERIALIZED, true)'.
johnmeyer
5th November 2017, 20:05
I'm working on the Win7 64-bit boot drive, using the same computer. At the moment I'm using AVISynth 2.60 (2/20/2015) because that's what was already installed. I am using the script without any multi-threading (on this older version of AVISynth, all I have to do is omit the SetMTMode statements).
I've found a few interesting bugs, although since these are with the older legacy KNLMeansCL, it probably doesn't make sense to waste people's time describing them. The short version is that with wmode_input set to default ("0"), even if you set the denoiser strength to 0.01, and set "d" and "a" to zero, it still does all sorts of filtering.
It still crashes in the exact same manner as under Win XP 32-bit, and I still am not able to load any of the modern KNLMeansCL versions.
I'll keep working through this.
Groucho2004
5th November 2017, 22:11
Thanks for the help but it looks like I'll have to try another avenue. I tried to install the 340.52 driver and it wouldn't install (I got an error message from the nVidia installer that it could not install). I did a little research and found that this is a common problem, so I manually installed the driver. Unfortunately I ended up with a 4-bit 640x480 display using the generic Windows driver.
I bet you used the "Express Install". Bad idea since it installs a pile of crap (with .NET 4 dependencies) that you don't need.
1. Uninstall your old driver
2. Start the 340.52 installer and select "Custom".
3. De-select everything except the display driver
4. Install
johnmeyer
5th November 2017, 22:32
Groucho,
Yup, that's what I did. I did think of unchecking all that other stuff, because I never use it.
When I get back to the XP boot drive, I'll do as you suggest.
Back to my main problem. I've made real progress. I've switched over to the Win7 64-bit boot drive and after a lot of stupidity (forgot to copy the MT AVISynth+ version after installation of the old 2014 version), I have AVISynth+ running and KNLMeansCL is working without crashing. I've tuned the parameters and like the results.
However ...
My one remaining problem is that I can't get MT to work. I have all the SetMT calls in an AVSI file that is loading at startup, and I have the Prefetch(4) at the end of the script. I've used MT many times in the month since I first installed AVISynth+ on my XP partition, so I'm getting somewhat familiar with the syntax. I'm not sure what is going on. I only get 2 fps without it (I have to use d=3 to get decent noise reduction on this 1981 VHS dub of someone's wedding inside a dark church, which I've brightened to within an inch of its life). The result is remarkably good, far better than I've seen with the old fft3dfilter, MDegrain2, and other spatial, temporal, and fft denoisers I've used.
But because of the multiple frames that must be processed, it is pretty slow.
So, I am now really close and all I have to do is figure out how to speed it up. I've tried the script with and without the "requestlinear" statement. I don't think it is needed in my script.
Here's the script I'm using. For troubleshooting, I've temporarily removed the MtModes.avsi file and since there is only one plugin, I'm setting the MT mode explicitly within the script.
[edit]I just did a quick test, and MT is not working for any script. So, it is not this script and it is not KNLMeansCL. [/end edit]
loadPlugin("E:\Documents\My Videos\AVISynth\AVISynth Plugins\plugins\KNLMeansCL.dll")
setmemorymax(1200)
SetFilterMTMode("knlmeanscl", MT_SERIALIZED, true)
d_input=3 #number of past/future frames default=1; 0=1 frame; 1=3 frames
a_input=1 #radius of search window; default=2; 0=1 pixel; 1=9 pixels
s_input=4 #radius of similarity; default=4
h_input=10.0 #filter strength
wmode_input=0 #weighting function; default=0
source=AVISource("E:\fs.avi").KillAudio().Requestlinear()
separatefields(source)
even=selecteven()
odd=selectodd()
den_even = KNLMeansCL(even,d=d_input,a=a_input,s=s_input,h=h_input,wmode=wmode_input)
del_odd = KNLMeansCL(odd, d=d_input,a=a_input,s=s_input,h=h_input,wmode=wmode_input)
interleave(den_even,del_odd)
output=weave()
return output
#Enable MT
Prefetch(5)
Groucho2004
5th November 2017, 22:40
return output
#Enable MT
Prefetch(5)
Try placing the Prefetch call before "return output" (everything after a return statement is ignored).
johnmeyer
6th November 2017, 00:36
Try placing the Prefetch call before "return output" (everything after a return statement is ignored).Well, if anyone would know, it would be you. However, that sure isn't what the AVISynth+ doc says, which is why my script is written that way. Here's the quote from the AVISynth+ Wiki:
"You enable MT by placing a single call to Prefetch(X) at the *end* of your script, where X is the number of threads to use."
I didn't put the asterisks on either side of "end," so whoever wrote that really want to emphasize, I thought, that it should be the very last statement in the script, period.
I'll try it when I get back to the Win7 boot partition and let you know (I'm back into the XP partition to try your suggestion about how to update the GPU driver). Thanks!
johnmeyer
6th November 2017, 01:28
I followed the directions exactly for installing just the nVidia driver, but the installatio program gave me the same error message. I'm not going to waste anymore of either my time, or anyone elses' time on this. While I still use XP a lot, it obviously isn't supported any more, not just by MS, but by any other company. Add to that the general incompetence of video graphic software programmers (I can't believe that the bugs and installation nonsense that started back in the 1980s is still going on today), and its a quagmire not worth entering.
However, thanks once again for the help.
No to go back to the Win7 64-bit and see if I can get MT to work.
johnmeyer
6th November 2017, 01:57
Moving prefetch to the line before the return statement did not do anything.
I'm going to take a break and see if I can figure out the error in my ways ...
[edit]Actually, I'm going to give up trying to get it to use MT. I just read through a huge portion of this thread, especially the long discussion between Groucho and MysteryX about using MT with this filter, with the KNLMeansCL author also making posts. My take from that is that MT may not even be possible with this filter, and at best, it is only going to provide a few percent improvement, not a 2x or 3x speed-up.
Groucho2004
6th November 2017, 02:19
Moving prefetch to the line before the return statement did not do anything.How do you determine this? Did you compare the number of threads used?
The script you posted above uses very few CPU cycles so depending on how you measured you may not have noticed a difference.
johnmeyer
6th November 2017, 03:33
How do you determine this? Did you compare the number of threads used?
The script you posted above uses very few CPU cycles so depending on how you measured you may not have noticed a difference.I viewed the AVISynth script output in VirtualDub. I used VD's "Run Video Analysis Pass" and watched the fps readout. I then moved the Prefetch call to a place both before and after the return statement. There was 0.00% difference: I got 2.04 fps for 30 seconds in both cases (I aborted after that amount of time). I also tried different thread settings from 2 all the way up to 8 (my computer's number of cores). No difference.
Groucho2004
6th November 2017, 08:14
I viewed the AVISynth script output in VirtualDub. I used VD's "Run Video Analysis Pass" and watched the fps readout. I then moved the Prefetch call to a place both before and after the return statement. There was 0.00% difference: I got 2.04 fps for 30 seconds in both cases (I aborted after that amount of time). I also tried different thread settings from 2 all the way up to 8 (my computer's number of cores). No difference.
Using your script, I get these results:
"Prefetch(5)" placed after "return output":
FPS (min | max | average): 22.66 | 23.51 | 23.41
Memory usage (phys | virt): 79 | 97 MiB
Thread count: 23
CPU usage (average): 25%
"Prefetch(5)" placed before "return output":
FPS (min | max | average): 22.65 | 23.52 | 23.41
Memory usage (phys | virt): 80 | 97 MiB
Thread count: 28
CPU usage (average): 25%
As I mentioned, the CPU load is very low and the GPU filter is the bottleneck.
If you use a filter that's heavy on the CPU such as MDegrain you will see a difference in speed and CPU usage.
Groucho2004
6th November 2017, 08:19
[edit]Actually, I'm going to give up trying to get it to use MT. I just read through a huge portion of this thread, especially the long discussion between Groucho and MysteryX about using MT with this filter, with the KNLMeansCL author also making posts. My take from that is that MT may not even be possible with this filter, and at best, it is only going to provide a few percent improvement, not a 2x or 3x speed-up.
As I mentioned several times, multi-threading a GPU filter makes little sense. That doesn't mean that you can't multi-thread the rest of your filters. That of course only makes sense if you're using filters that are heavy on the CPU.
Khanattila
6th November 2017, 08:31
As I mentioned several times, multi-threading a GPU filter makes little sense. That doesn't mean that you can't multi-thread the rest of your filters. That of course only makes sense if you're using filters that are heavy on the CPU.Really, this is a topic that we have really talked about many times.
TheFluff
6th November 2017, 10:09
Moving prefetch to the line before the return statement did not do anything.
I'm going to take a break and see if I can figure out the error in my ways ...
Well. You explicitly set the KNLMeansCL MT mode to MT_SERIALIZED at the top of the script, which means that it - and everything upstream of it up to and including the source filter - will run single-threaded and synchronously, just like in vanilla Avisynth. You've thereby intentionally bottlenecked the script, so what are you expecting to see here, really? The only filters that are running multithreaded in your script are interleave() and weave().
You can definitely multithread KNLMeansCL by running multiple instances of it (MT_MULTI_INSTANCE, and I hope you have a ton of RAM) but the main benefit of this isn't that it improves the performance of KNLMeansCL itself, but that it allows filters upstream of it to run in parallel. Avisynth's parallelism is brain damaged, news at 11.
johnmeyer
6th November 2017, 21:01
Well. You explicitly set the KNLMeansCL MT mode to MT_SERIALIZED at the top of the script, which means that it - and everything upstream of it up to and including the source filter - will run single-threaded and synchronously, just like in vanilla Avisynth. You've thereby intentionally bottlenecked the script, so what are you expecting to see here, really? The only filters that are running multithreaded in your script are interleave() and weave().
You can definitely multithread KNLMeansCL by running multiple instances of it (MT_MULTI_INSTANCE, and I hope you have a ton of RAM) but the main benefit of this isn't that it improves the performance of KNLMeansCL itself, but that it allows filters upstream of it to run in parallel. Avisynth's parallelism is brain damaged, news at 11.You are right that in post #1232 I did include MT_SERIALIZE, but in my earlier post (#1223), I didn't have that. Believe me, I've tried all the various MT modes.
Your idea of MT_MULTI_INSTANCE is very intriguing. I didn't know about that. I'll pursue that and see what happens. I do happen to have a "ton of RAM," although whether AVISynth+ running KNLMeansCL will use it, or not, I don't know. It should be fun to try it and find out. Thanks!
RieGo
8th November 2017, 19:17
i'd like to share a little story in case you got the same problem.
so lately my knlmeanscl didn't work. it always threw some missing dependency errors.
i tried everything mostly reinstalling ms vs runtimes, but i couldn't figure out the problem.
my graphics driver was up to date - that's what i thought.
here's what actually happened: i got a new Win 10 Upgrade lately. what i didn't expect/know is that it replaces my graphics driver with a worse one - which doesn't have opencl support(?)
completely reinstalling the nvidia driver fixed everything and KNLMeansCL is working great again :)
johnmeyer
8th November 2017, 21:59
i'd like to share a little story in case you got the same problem.
so lately my knlmeanscl didn't work. it always threw some missing dependency errors.
i tried everything mostly reinstalling ms vs runtimes, but i couldn't figure out the problem.
my graphics driver was up to date - that's what i thought.
here's what actually happened: i got a new Win 10 Upgrade lately. what i didn't expect/know is that it replaces my graphics driver with a worse one - which doesn't have opencl support(?)
completely reinstalling the nvidia driver fixed everything and KNLMeansCL is working great again :)I think you are right about the graphics driver, and a few posts further up, Groucho tried to help me upgrade my XP driver, but the nVidia installer failed and I eventually gave up. My Win7 installation (same computer, different boot drive) has the last nVidia driver for Win7 and it will run KNLMeansCL.
As for having something replaced by a background upgrade that I don't authorize, I turn off ALL upgrades for everything, including Windows. Neither my Win XP or Win7 installation has been updated in seven years. As a result, I never have had the pleasure of turning on the computer, only to find that it doesn't behave like it did yesterday. As a result, I get a lot of work done because I don't spend any time in the "care and feeding" of my computer.
I partition my hard drives so that only the O/S and programs are on the boot partition. I can do an image backup in less than five minutes. So, if something bad does happen (people always worry that I'll get a virus or something like that, especially since I don't run any anti-virus programs), I can restore the computer in less than ten minutes. I've had to do this a few times when I've installed a new program that screws things up.
So: no background updates; no anti-virus software; no background programs (task manager only lists three processes in XP after I boot); and partition the boot drive. I highly recommend this to anyone who wants a fast, trouble-free computer.
edcrfv94
15th November 2017, 22:50
The result is different, which one is correct?
SetMemoryMax(3000)
ImageSource("1.png", end=0).Dither_convert_rgb_to_yuv(lsb=true,output="YV12").DitherPost(mode=6)
ConvertBits(bits=16)
KNLMeansCL(d=2, a=4, s=4, h=0.4, channels="Y", stacked=false, device_type="GPU")
ConvertToStacked().DitherPost(mode=6, ampo=1)
SetMemoryMax(3000)
ImageSource("1.png", end=0).Dither_convert_rgb_to_yuv(lsb=true,output="YV12").DitherPost(mode=6)
ConvertBits(bits=16)
ConvertToStacked()
KNLMeansCL(d=2, a=4, s=4, h=0.4, channels="Y", stacked=true, device_type="GPU")
DitherPost(mode=6, ampo=1)
yup
22nd November 2017, 06:47
Hi Khanattila!
Please give me link for original paper. I want understand how work all parameters (mainly a and s) Your plugin.
yup.
videoFred
22nd November 2017, 14:33
I realy would like to test this filter. Unfortunately I'm getting the following error message:
no compatible opencl platforms available
My graphics card is Nvidia GeForce GT 420, drivers are updated.
I'm on Win10, opencl.dll is there, both in system32 and in syswow64.
Any suggestions please?
Fred.
Atak_Snajpera
22nd November 2017, 14:42
I realy would like to test this filter. Unfortunately I'm getting the following error message:
My graphics card is Nvidia GeForce GT 420, drivers are updated.
I'm on Win10, opencl.dll is there, both in system32 and in syswow64.
Any suggestions please?
Fred.
Your GPU does not support OpenCL 1.2 !
https://www.geforce.com/hardware/notebook-gpus/geforce-gt-420m/specifications
Groucho2004
22nd November 2017, 14:52
My graphics card is Nvidia GeForce GT 420, drivers are updated.
I'm on Win10, opencl.dll is there, both in system32 and in syswow64.
Any suggestions please?
Fred.
As mentioned, your card does not support OpenCL 1.2. However, you can use an older version of KNLMeansCL (0.6.11 (https://github.com/Khanattila/KNLMeansCL/releases/tag/v0.6.11)).
videoFred
22nd November 2017, 15:25
Thank you both for the fast advice!
Will try 0.6.11 as suggested by Groucho! :thanks:
Fred.
johnmeyer
22nd November 2017, 22:01
I realy would like to test this filter. Unfortunately I'm getting the following error message:
My graphics card is Nvidia GeForce GT 420, drivers are updated.
I'm on Win10, opencl.dll is there, both in system32 and in syswow64.
Any suggestions please?I had the same problem, but now have everything working on Win7 64-bit, with AVISynth+ (r2504) and the 11/5/2017 version of KNLMeansCL. I went back to my notes to see what changes I made to get it to work, but cannot remember what I did (sorry!). I most definitely could NOT get it to work under XP where, for various reasons, I've been unable to install a later driver for my old nVidia GeForce 9800GT. Under Windows 7 I did not have that problem and have what I think is the last supported driver for that O/S, version 341.44.
My opinion of the filter is quite varied: on some material it performs brilliantly, clearly doing a better job than MDegrain2. This is especially true for "blotchy noise" that results from brightening really dark video. However, on other material, despite several people's claims that it doesn't destroy details, it absolutely ruined the video. This wasn't minor, but was really bad. The problems were most apparent on things like water glasses on a banquet table, where the subtle shadings on the glass disappeared. On another video, the wavy folds on a dress shirt also disappeared. So, take a hard look at any contoured surfaces that have no "high frequency" detail and instead simply have subtle changes in shading.
The filter is also dog slow without any GPU assist, and MT doesn't seem to do much (several people have said in this thread that MT and GPU end up working at odds, although without a GPU, I would think MT could still do something, but what do I know).
For me, any filter that cannot get above 1 fps is a unusable. I simply don't have multiple days to devote to any individual film or video. Life is full of "engineering trade-offs," and performance does matter.
Khanattila
23rd November 2017, 13:54
Hi Khanattila!
Please give me link for original paper. I want understand how work all parameters (mainly a and s) Your plugin.
yup.
B. Goossens, H.Q. Luong, J. Aelterman, A. Pizurica, and W. Philips,
"A GPU-Accelerated Real-Time NLMeans Algorithm for Denoising Color Video Sequences",
in Proc. ACIVS (2), 2010, pp.46-57.
VS_Fan
23rd November 2017, 17:18
B. Goossens, H.Q. Luong, J. Aelterman, A. Pizurica, and W. Philips,
"A GPU-Accelerated Real-Time NLMeans Algorithm for Denoising Color Video Sequences",
in Proc. ACIVS (2), 2010, pp.46-57.
You could also find useful the papers referred by Kevin Stone (aka ‘Tritical’) when he released 'TNLMeans' 10 years ago. Those are still available at the AviSynth Wiki (http://avisynth.nl/index.php/TNLMeans)
EDIT: A functional snapshot (http://web.archive.org/web/20100411094229/http://web.missouri.edu/~kes25c/) from 2010 of tritical's web page, provided by wayback machine, where you will find the referred papers.
There are some other references at Wikipedia (https://en.wikipedia.org/wiki/Non-local_means)
Groucho2004
24th November 2017, 18:45
However, on other material, despite several people's claims that it doesn't destroy details, it absolutely ruined the video. This wasn't minor, but was really bad. The problems were most apparent on things like water glasses on a banquet table, where the subtle shadings on the glass disappeared. On another video, the wavy folds on a dress shirt also disappeared.
Could you share the KNLMeansCL settings you used in these cases and possibly a clip to reproduce?
pcroland
25th November 2017, 01:17
Hi!
I recently find knlmeanscl and it works pretty great but I have some questions:
Why do I get glitches at the start of the video sometimes? And how should I get rid of them?
Here's an example: https://mega.nz/#F!mUpyTIII!IXp43ePL1PETUGyVMYNUUg (source and encode are both ~1min long)
DirectShowSource("D:\raccoons\DVD1\VIDEO_TS\VTS_01_1.VOB")
QTGMC(Preset="Fast")
SelectOdd()
Crop(14,2,-16,-0)
FillMargins(1,0,1,1)
bbmod(0,2,4,6)
knlmeanscl(D=2, A=3, h=3, device_type="GPU")
DeHalo_Alpha(rx=2.0, ry=2.0, darkstr=0.4, brightstr=1, lowsens=50, highsens=50, ss=1.5)
GradFun3(thr=0.35, radius=12, elast=3, mask=2, mode=0, smode=0, debug=0, lsb=False, lsb_in=False, staticnoise=False, y=3, u=3, v=3)
Spline36ResizeMod(688,538,1,0,-1,-1)
The other question is how can I speed up the encodeing process? knlmeanscl is the bottleneck right now. I have an i7-4790 but I don't have a dedicated GPU but knlmeanscl still runs faster with device_type="GPU". Should I get a GPU? :D
Thanks in advance,
pcroland.
Shirtfull
25th November 2017, 18:12
Hi!
Why do I get glitches at the start of the video sometimes? And how should I get rid of them?
Could be your source filter, try dgmpgdec
Groucho2004
25th November 2017, 18:43
Why do I get glitches at the start of the video sometimes? And how should I get rid of them?
Here's an example: https://mega.nz/#F!mUpyTIII!IXp43ePL1PETUGyVMYNUUg (source and encode are both ~1min long)
DirectShowSource("D:\raccoons\DVD1\VIDEO_TS\VTS_01_1.VOB")
QTGMC(Preset="Fast")
SelectOdd()
Crop(14,2,-16,-0)
FillMargins(1,0,1,1)
bbmod(0,2,4,6)
knlmeanscl(D=2, A=3, h=3, device_type="GPU")
DeHalo_Alpha(rx=2.0, ry=2.0, darkstr=0.4, brightstr=1, lowsens=50, highsens=50, ss=1.5)
GradFun3(thr=0.35, radius=12, elast=3, mask=2, mode=0, smode=0, debug=0, lsb=False, lsb_in=False, staticnoise=False, y=3, u=3, v=3)
Spline36ResizeMod(688,538,1,0,-1,-1)
There are a bunch of potential culprits for the glitches. First and foremost, DirectShowSource is the worst choice for your source. Use DGIndex/DGDecode for VOB.
If that doesn't solve the glitch problem, test each of the filters/functions separately.
The other question is how can I speed up the encodeing process? knlmeanscl is the bottleneck right now. I have an i7-4790 but I don't have a dedicated GPU but knlmeanscl still runs faster with device_type="GPU". Should I get a GPU? :DYes, get a decent card (GTX1060/70/80).
pcroland
25th November 2017, 18:49
There are a bunch of potential culprits for the glitches. First and foremost, DirectShowSource is the worst choice for your source. Use DGIndex/DGDecode for VOB.
If that doesn't solve the glitch problem, test each of the filters/functions separately.
Yes, get a decent card (GTX1060/70/80).
I tried DGIndex but there were still some glitches, for example the luma frame changed as it should but the chroma frames remained the same. I got an ASUS 1050 2GB, the encoding time is now 8fps and for some reason the glitches disappeared also :)
videoh
25th November 2017, 23:34
Earlier versions of the nVidia driver had a relevant MPEG2 bug. Maybe when you installed the 1050 you upgraded to the new driver, which has been fixed.
Still, there shouldn't be any problem with DGIndex. I'll have a look with your stream.
videoh
26th November 2017, 13:40
The source file you linked is an MKV but your script shows you opening a VOB and you said you get issues with DGIndex but it cannot open MKV. So can't help you with this.
Sharc
26th November 2017, 15:34
I tried DGIndex but there were still some glitches, for example the luma frame changed as it should but the chroma frames remained the same. I got an ASUS 1050 2GB, the encoding time is now 8fps and for some reason the glitches disappeared also :)
What do you mean by glitches? Your source.mkv has badly blended even and odd fields. I doubt that you can get anything useful out of this ....
pcroland
26th November 2017, 20:58
The source file you linked is an MKV but your script shows you opening a VOB and you said you get issues with DGIndex but it cannot open MKV. So can't help you with this.
I used mkvtoolnix to cut out a 1min sample, sorry :D
What do you mean by glitches? Your source.mkv has badly blended even and odd fields. I doubt that you can get anything useful out of this ....
I know there's a terrible fieldblend, the glitches that I was talking about: in the encode.mkv file you can see frames flipping upside-down randomly in the first 5 sec. But now it's fixed, thanks for the help.
Khanattila
27th November 2017, 11:00
There are a bunch of potential culprits for the glitches. First and foremost, DirectShowSource is the worst choice for your source. Use DGIndex/DGDecode for VOB.
If that doesn't solve the glitch problem, test each of the filters/functions separately.
Yes, get a decent card (GTX1060/70/80).
Or a Vega card, when I can buy one.
lordsmurf
7th December 2017, 12:28
For me, any filter that cannot get about 1 fps is a unusable. I simply don't have multiple days to devote to any individual film or video. Life is full of "engineering trade-offs," and performance does matter.
This was my same conclusion. It has a lot of potential -- but in the next decade sometime, when CPU and/or GPU is faster. I've already been through this -- 90s filtering not usable until 2000s, 00s filter not until 10s. Right now, it's little more than a tease.
Goodbye KNLmeansCL, may we meet again! :)
TheFluff
7th December 2017, 12:35
it was a while since I used knlmeanscl but I believe last time I tried it, it was pushing somewhere around 25 fps, and that was on a computer that is now five years old (i5-3570k, gtx... 670? I think?)
you can be in the next decade right now if you want to, is what I'm sayin'
Groucho2004
7th December 2017, 12:46
it was a while since I used knlmeanscl but I believe last time I tried it, it was pushing somewhere around 25 fps, and that was on a computer that is now five years old (i5-3570k, gtx... 670? I think?)
you can be in the next decade right now if you want to, is what I'm sayin'
Talking about decades - Even my old GT240 which I bought almost a decade ago delivers reasonable speed with KNLMeansCL if the parameters are set to sane values.
If you're getting < 5fps you're either using unreasonable settings or you should consider updating your hardware. Otherwise just forget about GPU filters.
By the way - Intel integrated graphics are utterly useless for OpenCL.
Sharc
7th December 2017, 13:22
Those with a NVIDIA GPU may also want to try DGDenoise(), as an alternative to KNLmeansCL
lordsmurf
7th December 2017, 15:17
it was a while since I used knlmeanscl but I believe last time I tried it, it was pushing somewhere around 25 fps, and that was on a computer that is now five years old (i5-3570k, gtx... 670? I think?)
you can be in the next decade right now if you want to, is what I'm sayin'
You're not going to get 25fps from this:
SetFilterMTMode("DEFAULT_MT_MODE", 2)
AVISource("BadToonSample.avi")
ConvertToYV16(interlaced=true)
orig=last
ev=orig.assumetff().separatefields().selecteven()
od=orig.assumetff().separatefields().selectodd()
ev
ue_chroma = UToY(ev).blur(0,1.5).binomialblur(5).ttempsmooth(maxr=6,lthresh=150, strength=6).KNLMeansCL(d=3,
\ a=8, h=6, device_type = "GPU", device_id = 1, channels="Y")
ve_chroma = VToY(ev).blur(0,1.5).binomialblur(5).ttempsmooth(maxr=6,lthresh=150, strength=6).KNLMeansCL(d=3,
\ a=8, h=6, device_type = "GPU", device_id = 1, channels="Y")
YToUV(ue_chroma, ve_chroma)
MergeLuma(ev)
ev_filtered=last
od
uo_chroma = UToY(od).blur(0,1.5).binomialblur(5).ttempsmooth(maxr=6,lthresh=150, strength=6).KNLMeansCL(d=3,
\ a=8, h=6, device_type = "GPU", device_id = 1, channels="Y")
vo_chroma = VToY(od).blur(0,1.5).binomialblur(5).ttempsmooth(maxr=6,lthresh=150, strength=6).KNLMeansCL(d=3,
\ a=8, h=6, device_type = "GPU", device_id = 1, channels="Y")
YToUV(uo_chroma, vo_chroma)
MergeLuma(od)
od_filtered=last
interleave(ev_filtered,od_filtered)
assumefieldbased().assumetff().weave()
Prefetch(6)
KNLMeansCL will make the script crawl at about 1fps.
It's an ugly nth gen video with horrible chroma errors. I wrote a script that will suffice, with about 10fps, but the above is better -- but only in quality, not speed. The 1-hour video would take 165+ hours to process, which is not reasonable.
you should consider updating your hardware. Otherwise just forget about GPU filters.
My i7-6700K with 16gb RAM doesn't need updating. I'm not a gamer, and have no need for expensive graphics cards. Furthermore, all those cards do is add room heat, as well as fan noise.
I can borrow a card, but I don't think it's going to give a usable performance boost. This is just a slow filter, GPU or not.
Feel free to test the above script, share your fps results. :)
Can anything replace KNLmeansCL for the sake of speed?
Groucho2004
7th December 2017, 16:03
KNLMeansCL will make the script crawl at about 1fps.Hardly surprising with 4 calls to the filter and d=3, a=8. Even a GTX1080 would struggle.
Not to mention that you're running it in 6 threads which just consumes GPU memory and probably slows it down even further.
Groucho2004
7th December 2017, 16:10
Furthermore, all those cards do is add room heat, as well as fan noise.Do you think if you offload your filtering needs to the CPU it will create less heat?
lordsmurf
7th December 2017, 16:42
Hardly surprising with 4 calls to the filter and d=3, a=8. Even a GTX1080 would struggle.
Not to mention that you're running it in 6 threads which just consumes GPU memory and probably slows it down even further.
Correct. Sometimes filters need to be stacked to be useful. Doing so makes them unusable. Been there, done that. But time changes that, and eventually stacking is negligible. Been there, done that too.
I deal with videos that others consider impossible. But sometimes "impossible" is merely a temporary state.
Do you think if you offload your filtering needs to the CPU it will create less heat?
Since I'd rarely use the card's GPU, yes. The CPU isn't running 100% 24/7/365, as I'm not encoding constantly. But a video card would be on 24/7/365, thus heat and noise, neither of which are needed or wanted.
lansing
7th December 2017, 16:43
KNLMeansCL will make the script crawl at about 1fps.
It's an ugly nth gen video with horrible chroma errors. I wrote a script that will suffice, with about 10fps, but the above is better -- but only in quality, not speed. The 1-hour video would take 165+ hours to process, which is not reasonable.
You may look at my short tutorial (https://forum.doom9.org/showthread.php?p=1820984#post1820984) to how to tweak the settings. Your D and A settings are insane. Not even the dragon ball z level set need that high of an A.
Groucho2004
7th December 2017, 16:57
The CPU isn't running 100% 24/7/365, as I'm not encoding constantly. But a video card would be on 24/7/365, thus heat and noise, neither of which are needed or wanted.What do you mean by "a video card would be on 24/7/365"? What applies to the CPU also applies to the graphics card. If they're idle (at least with modern devices), they consume very little power. Your logic is flawed.
Khanattila
7th December 2017, 17:59
This was my same conclusion. It has a lot of potential -- but in the next decade sometime, when CPU and/or GPU is faster. I've already been through this -- 90s filtering not usable until 2000s, 00s filter not until 10s. Right now, it's little more than a tease.
Goodbye KNLmeansCL, may we meet again! :)
A. Buades, B. Coll and J.-M. Morel,
"A non-local algorithm for image denoising",
2005 IEEE Computer Society Conference on Computer Vision and Pattern Recognition.
johnmeyer
7th December 2017, 18:00
I agree that the D & A settings are a major contributor to the slow speed. I've done a lot of performance checks, and setting either of these much above the defaults will slow things to a crawl. Setting them both above the defaults, and you definitely are going to be taking the proverbial slow boat to China.
lordsmurf
7th December 2017, 18:25
What do you mean by "a video card would be on 24/7/365"? What applies to the CPU also applies to the graphics card. If they're idle (at least with modern devices), they consume very little power. Your logic is flawed.
The computer is on 24/7/365, thus so would be a graphics card.
I have no graphics card, and am using the Intel 530 HD graphics built into i7-6700 using Asrock motherboard.
The CPU is extremely cool when idle -- much lower than graphics cards. Right now, it has mild load, and is only at 25. I have a Noctua on it. I think the TDP of an average fancy graphics card is something like 2x-3x that of a CPU. At best, a graphics card would be in the 30s or 40s when "idle", maybe higher. And I put that in quotes because there's really no "idle" on graphics cards, compared to CPUs, it just gets hot or hotter.
It gets worse when you pay extra for a graphics card to heat the room, then pay again to have the AC cool the room, plus all the fan noise from BOTH the graphics card fan and the AC. When I built this rig, cooling and noise was the priority, with an i7-6700K being required for horsepower.
BTW: The Intel 530 does seem to use GPU on KNLmeansCL, even if the OpenCL must be 0 in the script. The GPU is still 3x faster than pure CPU with the above script. GPU is about 15% CPU on 4 threads, while 100% CPU on 8 threads is 3x slower.
You may look at my short tutorial (https://forum.doom9.org/showthread.php?p=1820984#post1820984) to how to tweak the settings. Your D and A settings are insane. Not even the dragon ball z level set need that high of an A.
Insane values for insanely bad nth gen VHS. That wasn't my script, but I'll continue to play with it. So far, trying to lower values would just disable the good it was doing on the video.
Not sure what the Dragonball reference is to.
Groucho2004
7th December 2017, 18:39
Right now, it has mild load, and is only at 25. I have a Noctua on it. I think the TDP of an average fancy graphics card is something like 2x-3x that of a CPU. At best, a graphics card would be in the 30s or 40s when "idle", maybe higher. And I put that in quotes because there's really no "idle" on graphics cards, compared to CPUs, it just gets hot or hotter.
TDP is mostly irrelevant for the idle/load power consumption, it just tells you how much the chip can handle.
Idle consumption of a 1060/70 for example is about 5-7 W, see here (https://www.techpowerup.com/reviews/EVGA/GTX_1070_Ti_FTW2/26.html).
Anyway, I give up. I suggest you try to gather some facts before posting.
lordsmurf
7th December 2017, 18:54
TDP is mostly irrelevant for the idle/load power consumption
I disagree. It's a pretty good guide for what temperatures you can expect, both at idle and 100%. Again, I get 25 from a CPU with mild load, but an "idle" GPU would easily be in the 30s-40s or more, at least doubling my system heat output. TDP suggested it. TDP of that CPU is about 90, while TDP of most fancy graphics cards are well into the 100s-200s.
Groucho2004
7th December 2017, 19:14
I disagree. It's a pretty good guide for what temperatures you can expect, both at idle and 100%. Again, I get 25 from a CPU with mild load, but an "idle" GPU would easily be in the 30s-40s or more, at least doubling my system heat output. TDP suggested it. TDP of that CPU is about 90, while TDP of most fancy graphics cards are well into the 100s-200s.
I can see that measurements and facts are not your thing. Good luck with your future endeavours.
lansing
7th December 2017, 20:00
The CPU is extremely cool when idle -- much lower than graphics cards. Right now, it has mild load, and is only at 25. I have a Noctua on it. I think the TDP of an average fancy graphics card is something like 2x-3x that of a CPU. At best, a graphics card would be in the 30s or 40s when "idle", maybe higher. And I put that in quotes because there's really no "idle" on graphics cards, compared to CPUs, it just gets hot or hotter.
It gets worse when you pay extra for a graphics card to heat the room, then pay again to have the AC cool the room, plus all the fan noise from BOTH the graphics card fan and the AC. When I built this rig, cooling and noise was the priority, with an i7-6700K being required for horsepower.
If your computer can cook a room so hot that you need an AC to counter it, there's something wrong with your cooling solution. My computer sits right next to my mouse-using hand and my hand was ice cold during winter time.
TDP are more correlated to watt usage, it has no relationship whatsoever as to temperature Celsius, your information is wrong. Running 100% of a 250 TDP graphic card does not mean the card goes to 250 degrees Celsius. Most modern cards stayed in the 70s on full loaded.
Insane values for insanely bad nth gen VHS. That wasn't my script, but I'll continue to play with it. So far, trying to lower values would just disable the good it was doing on the video.
Not sure what the Dragonball reference is to.
Something like this (https://i.imgur.com/rxFYf2M.png).
lordsmurf
7th December 2017, 20:18
If your computer can cook a room so hot that you need an AC to counter it, there's something wrong
You must not live in the south, where it's hot almost year round. It was 80 F just 2 days ago, and the AC started running (thermostat set to 79). When you have a computer pumping out heat, and heat outside, life is miserable. A computer does make the AC kick on, and run so much that it can seize. So the goal is to limit heat output as much as possible. A computer can make a room a good 5 degrees hotter minimum, and I've seen it as much as 10 in years past.
TDP are more correlated to watt usage, it has no relationship whatsoever as to temperature
Direct correlation, no. But indirect, yes, absolutely. TDP is a statement about thermal output. There is data to extrapolate there. It's not 100% divorced from heat output.
Running 100% of a 250 TDP graphic card does not mean the card goes to 250 degrees Celsius.
I never said it did.
Most modern cards stayed in the 70s on full loaded.
I've seen cards run well in the 80s or 90s.
I think you're missing my point: Whether it's 70 or even 35, it's more than 0, which is what the computer has now. And I'm better for it. The atypical GPU video filter won't sway me on iota into "upgrading". If really needed, I can borrow one from a gamer I know.
This filter looks great, but no amount of GPU will really give it a usable boost if the filter is being pushed beyond default minimums.
Something like this (https://i.imgur.com/rxFYf2M.png).
That video is absolutely flawless compared to the mess I'm working on.
2005 IEEE Computer Society Conference on Computer Vision and Pattern Recognition.
I refer to the Avisynth filter, not the algorithm. You've made a great filter, ahead of its time. But we lack the horsepower to really push it. Please take that as the compliment it is.
TheFluff
8th December 2017, 00:01
I disagree. It's a pretty good guide for what temperatures you can expect, both at idle and 100%. Again, I get 25 from a CPU with mild load, but an "idle" GPU would easily be in the 30s-40s or more, at least doubling my system heat output. TDP suggested it. TDP of that CPU is about 90, while TDP of most fancy graphics cards are well into the 100s-200s.
I realize that historically I have had absolutely zero success in convincing the various doom9 forums nutjobs I've encountered over the years of anything, but for the record... I currently have, in the computer right next to me, a top of the line graphics card powering my 4k monitor. It's 300mm long, it's got 8GB VRAM, it's got three big honking fans on it, and it'll clock up to somewhere north of 1.9GHz if it needs to. It's got more than twice the TDP of my CPU, at an impressive 180W. As you can see, this monster is turning the room into a sauna even when idling:
https://i.imgur.com/5a9i6t1.png
oh. uh. well.
The fan readout isn't bugged by the way, the card has a ginormous heatsink on it and the fans are intentionally stopped when the GPU is near idle.
Compare this to the old faithful i5 CPU which is actually using more power (almost a whole watt more! what a waste!) and running its fan at a few hundred RPM:
https://i.imgur.com/0MZCgaN.png
Also, lol at the idea of even trying to measure the heating effect the dissipation of these monstrous 30-ish watts of energy has on an entire room. An oldschool light bulb in a desk lamp would put out more heat! Even 300 watts is pretty much peanuts when it comes to space heating. It's an absolutely trivial amount of heat in relation to the thermal inertia of even a small apartment.
real.finder
8th December 2017, 00:20
what about new high-end laptops? it will not use the dedicated gpu and use the one in the cpu when idle or even using light things
lordsmurf
8th December 2017, 00:49
heating effect the dissipation of these monstrous 30-ish watts of energy has on an entire room. An oldschool light bulb in a desk lamp would put out more heat!
It's all additive. This is a main reason we keep lights off when possible, quiet ceiling fans on low/silent. The CFL are supposedly cooler, but some bulbs seem to output just as much heat. Replacing TVs with LCD in the past decade has helped.
After I built this Skylake, it was the first winter where the room actually got chilly a few times.
The 47-C vs 39-C somewhat illustrates my point. It's 20% hotter, even understanding the older Intels weren't all that cool (though AMD was worse). Additively speaking, it's 120% hotter, for both CPU and GPU. With no graphic cards, it'd be 50% cooler. Newer CPU would probably cool that even more, especially if using a Noctua.
TDP of that GPU = 180
TDP of that CPU = 77
Not direct correlation for heat output, but not unrelated. Give both mild load, and that GPU will be curve up far quicker than the CPU. At some point in the graph, it probably will run almost twice as hot.
GPUs would probably run a bit cooler at idle if fans didn't stop at idle, which I've never understood.
It's just a penalty of having a card. I don't need one. I don't need to upgrade for video encoding. Almost nothing takes advantage of GPU encoding, and never did, and has mostly been hype to date.
It is what it is.
what about new high-end laptops? it will not use the dedicated gpu and use the one in the cpu when idle or even using light things
I like stuff like this. There when needed, not when not. That's the future. We have V8s that cut off 4 cylinders (Chargers), and it'd be nice to see desktop have similar switching abilities. No idea how that'd be engineered.
Another neat item for next decade. :)
TheFluff
8th December 2017, 01:11
I don’t think you understand how any of this works. Thermodynamically speaking almost all the electrical energy going into the computer will be converted to thermal energy. If the GPU and the CPU are using the same amount of energy but one is hotter than the other because it’s not running its fans, then that means it’s actually transferring less energy to the surrounding air (and by extension, heating your room less). The temperature of the silicon really isn’t interesting at all here. An incandescent 40W light bulb has a wire heated to over 2000 degrees Kelvin in it, and yet it’s sure as heck not putting out more than 40W of heat. Physics!
Here’s a topical but completely pointless bit of trivia: an average human body dissipates an average of around 100W of energy as heat. Slow your metabolism and eat less to make your room less hot!
lordsmurf
8th December 2017, 01:52
You may look at my short tutorial (https://forum.doom9.org/showthread.php?p=1820984#post1820984) to how to tweak the settings. Your D and A settings are insane. Not even the dragon ball z level set need that high of an A.
Update: :D
So I pulled back KNLmeansCL settings as much as possible, attacking only the worst of the video. It still needs a lot of work, but I'm getting about 10fps using the Intel GPU with MT in x64 Avisynth+.
I can attack the remaining issues with faster filters. None are as good as the pure KNLmeansCL in terms of end result quality, but will suffice.
Thanks for the tips.
I don’t think you understand how any of this works. Thermodynamically speaking almost all the electrical energy going into the computer will be converted to thermal energy.
As far as TDP/heat/etc:
A 40W bulb also has no fan, but the heat emanates into the room. The computer has ventilation, the computer is a conductor, the card has ventilation, heat emanates out the card, thus into the room. Also science.
And you're still missing my point. Having no card = 0, any card = more than 0. The card will expel heat, be it passively or actively (fan). I want a compute to compute, not double as a room heater in the summer. Because it does raise a room by at least 5 degrees here, if not more. If you're in New York or Colorado or Canada or somewhere, you may not run into that problem.
Again, TDP isn't a direct measure of heat expelled by a given system. But it's also not a measurement of mere power consumption. For example, given the TDP numbers against your heat measurement, I have to wonder if the CPU heatsink is inadequate, or needs a re-seat/re-paste. That's what the numbers tell me. It also tells me to expect the GPU to run hotter, though probably not 2x hotter realistically. Those are why the numbers exist.
Anyway, whatever... I have encoding to do now. :)
yup
8th December 2017, 12:44
lordsmurf!
Some time ago I am spoken author about paper also. After some test and try I am found that for interlaced source (fields) better value for s=1, for s=2 (default value) filtered image will be more softer.
Decreasing s from 2 to 1 increasing speed. Also for color planes (not luma) can using easy setting.
yup.
pinterf
8th December 2017, 13:10
The 47-C vs 39-C somewhat illustrates my point. It's 20% hotter,
Never divide temperature values in Celsius, if necessary, do it in Kelvins. You'll get a 2,5% instead. (But what really counts, the excessive heat, it is the deltaT)
lordsmurf
8th December 2017, 16:13
lordsmurf!
Some time ago I am spoken author about paper also. After some test and try I am found that for interlaced source (fields) better value for s=1, for s=2 (default value) filtered image will be more softer.
Decreasing s from 2 to 1 increasing speed. Also for color planes (not luma) can using easy setting.
yup.
Thanks. I'll remember that.
Unfortunately, this time, it didn't make any noticeable difference on quality or speed. It may simply be due to this clip and the longer 4x call script.
Never divide temperature values in Celsius, if necessary, do it in Kelvins. You'll get a 2,5% instead. (But what really counts, the excessive heat, it is the deltaT)
:goodpost:
TheFluff
8th December 2017, 21:26
Again, TDP isn't a direct measure of heat expelled by a given system. But it's also not a measurement of mere power consumption. For example, given the TDP numbers against your heat measurement, I have to wonder if the CPU heatsink is inadequate, or needs a re-seat/re-paste. That's what the numbers tell me. It also tells me to expect the GPU to run hotter, though probably not 2x hotter realistically. Those are why the numbers exist.
That's not how TDP works. That's not how any of this works!
Clearly, it's time for
Thermodynamics 101
with T. Fluff, PhD
(I hold a doctorate in The Science of Telling People they are Wrong on the Internet)
Let's review the fundamentals first, yeah? This is all high school physics, so you should probably know this. The laws of thermodynamics tell us two important things relevant to this discussion, namely that
a) energy can never be created or destroyed (so if we put some energy into a system we must get the same amount of energy out), and
b) entropy tends to increase, so if you have two bodies with different temperatures in thermic contact with each other energy will flow from the hotter one to the colder one until they reach equilibrium.
Now on to what this means in practice. In a computer, we input electrical energy. Some of this energy is converted to kinetic energy (to spin harddrive platters and fans), and some is converted to electromagnetic radiation mainly in the form of visible light (in LED's and in the monitor), but the vast majority of it eventually decays to thermal energy after being used to push some electrons around through a bunch of transistors. This heat has to go somewhere, and that somewhere eventually ends up being the air of the room. In a moment, we will calculate the magnitude of this effect, but first we need to clear up a misconception.
The TDP of a processor is an estimated ballpark number of the amount of thermal energy it generates in a given fictive scenario that's supposed to represent a typical peak workload. In any other scenario (such as most scenarios you'll find in reality), the actual amount of heat generated is different - the TDP is only supposed to be a rough estimate of the maximum sustained heat generation possible. The TDP number has absolutely nothing to do with any of the following:
- amount of heat generated at idle
- amount of electrical power consumed at idle
- temperature of the silicon in any given situation
In practice, the amount of thermal energy generated by a processor is pretty much equivalent to its electrical power consumption because almost all of the electrical energy quickly decays to heat. The first law of thermodynamics also tells us that we cannot possibly get more thermal energy out of a processor than the amount of electrical energy we put into it. If you look at the processor's power consumption then, you will have a good idea of how much heat it's producing. Modern CPU's and GPU's are very good at clocking down (and more importantly, reducing the voltage) at idle and so you'll see a typical idle power consumption of 10-20 watts. The power consumption - and by extension, thermal energy generation - still doesn't have anything to do with the temperature of the chip, though. See, temperature is a measure of energy, but it's a measure of stored energy. Two chips consuming the same amount of electrical energy will heat your room exactly the same, even if one is twice as hot as the other. The only thing that's different in the hotter chip is that the energy stays in it for longer before dissipating into the room.
Speaking of energy storage, to calculate the heating effect of an idling CPU we first need to discuss specific heat capacity. Different substances can store different amounts of thermal energy, and the specific heat capacity is a measure of how much energy a substance can store per unit mass. Or, in more practical terms - heating one kilogram of water by one degree Kelvin takes about four times as much energy as heating one kilogram of air by one degree Kelvin. Many metals have very low specific heat capacity, meaning it takes little energy to heat them up, but conversely that also means they're bad at retaining that energy and they quickly cool down again. For example, copper (commonly used in heatsinks because of its excellent thermal conductivity) has a specific heat capacity of 0.385 J/gK (joules per gram kelvin difference - it takes 0.385 joules of energy to heat one gram of copper by one degree kelvin). Air at typical indoor conditions has a specific heat capacity of about 1.01 J/gK.
If we then assume a spherical CPU in a vacuum... uh, no, I mean, a small 30 square meter studio apartment with the minimum indoor ceiling height of 2.4 meters allowed by the building code in these parts, we can easily calculate that the 72 cubic meters of air inside weighs around 92 kilograms. Given the previously discussed specific heat capacity, heating 92 kilograms of air by one degree kelvin (or equivalently in this case, one degree celsius) takes 92.9 kilojoules of energy. Now, a watt is a joule per second, so an idling CPU consuming 10 watts of energy would take 9290 seconds (or close to 2 hours and 35 minutes) to heat the apartment by one degree kelvin. Do note though that this of course assumes completely unrealistic conditions, for example that the apartment is perfectly thermally insulated against the outside world, so it is of course necessary for there to be no ventilation whatsoever. The building code here demands that the ventilation of private dwellings should change the indoor air at least once every two hours, making the job of that idling CPU a Sisyphean task.
So, in conclusion, no, my heatsink isn't inadequately fastened, and the TDP has nothing to do with this at all. I could easily transfer the heat out of the CPU quicker and thereby making it cooler by running the CPU fan faster, but why on earth would I? There's absolutely no reason to.
cork_OS
8th December 2017, 22:10
In other words, TDP is just requirement for cooling system.
Note that modern CPUs (and GPUs) could easily exceed TDP index under heavy load (AVX-512 etc.), but integrated current/power meters and forced clock drop won't let them do so.
lordsmurf
9th December 2017, 10:38
And yet, you can't explain why a computer left on 24/7/365, using components with high TDP, will raise room ambient temperature by at least 5 degrees. Whereas components with low TDP will not do so, a mild 1 degree bump at most.
Please, Dr. Physics, explain that one.
TheFluff
9th December 2017, 14:38
And yet, you can't explain why a computer left on 24/7/365, using components with high TDP, will raise room ambient temperature by at least 5 degrees. Whereas components with low TDP will not do so, a mild 1 degree bump at most.
Please, Dr. Physics, explain that one.
lol
One weird trick, discovered by a Doom9 forums poster, lets you violate the laws of thermodynamics. Physicists HATE him!
f'in tdp's, how do they work???
lordsmurf
9th December 2017, 15:36
lol
One weird trick, discovered by a Doom9 forums poster, lets you violate the laws of thermodynamics. Physicists HATE him!
f'in tdp's, how do they work???
Yeah, I thought as much. No answer.
As I said, TDP has a very obvious correlation to actual heat output. TDP isn't a measure of it, but it must be closely related. Accumulated TDP can be a good guide to how hot your computer will be, specifically monitoring an increase in ambient temperature in the room.
If I can lower room temps by a few degrees, simply by NOT buying an expensive/fancy graphics card, I'm better for it. If watching the TDPs help me make smarter/cooler purchases, then that's what I'll do. So far, that's worked perfectly. Not everybody live in Canada or wherever, where years-round temps are measured in snowfall inches. We must pay close attention to how a computer heats the dwelling.
This is a thread about KNLmeansCL, not TDP.
I've stripped KNL down to base settings, am getting 10fps now, and have moved on. I suggest you do the same.
TheFluff
9th December 2017, 23:44
I'm amused how the "experts" of this Doom9 thread just won't let this go. It's a thread about KNLmeansCL. I've stripped it down to base settings, am getting 10fps now, and have moved. I suggest you do the same.
No dude, you don't get to pretend to be the bigger man here and move on while rolling your eyes at these silly "experts" with their "science". You went spouting off nonsense in an authoritative tone and now you're trying to weasel out of being dumb on the internet. I won't stand for it.
I'm not trying to hurt you, I'm not trying to sell you a GPU, I'm not trying to convince you to use KNLMeans, I'm not even trying to dispute your apartment temperature numbers. I only want you to understand why nothing you're saying makes any sense. I will not accept you claiming that you'd prefer to believe in literal magic because you don't understand basic physics. I also really doubt you've made the ambient temperature experiment under controlled conditions, so I really don't think you're getting much mileage out of "thinking for yourself".
As I said, TDP has a very obvious correlation to actual heat output. TDP isn't a measure of it, but it must be closely related. Accumulated TDP can be a good guide to how hot your computer will be, specifically monitoring an increase in ambient temperature in the room.
See, you're so close and yet you are a galaxy away. The TDP number is a quite good measure of the actual heat output! AT MAX LOAD, that is. Back in the bad old days with Pentium 4's and such things, it actually kinda did tell you something about idle power consumption (and therefore heat output - as I have previously shown, they are effectively the same) as well, because processors in those days were really bad at clocking down and if you were lucky they could cut their power consumption in half while idling, maybe. Today this is no longer the case and everything clocks down to use like 10-15 watts at idle. A high TDP processor has the potential to put out more heat, but at idle there's no difference - see my screenshots above that are showing the same power consumption (and therefore heat output) of two different chips where one has more than twice the TDP of the other.
You can plug in a watt meter into the wall socket and then plug the computer into that if you're actually curious about this. They're like 25 bucks on Amazon. You will then notice that your power consumption at idle is a lot more than just the CPU's idling power consumption (because there's other stuff using power in the computer as well, and the PSU is only about 80-90% efficient at converting wall socket AC to low voltage DC), but also that if you actually put your computer under load, power consumption will immediately increase significantly, and there's the difference between idle power and TDP. In practice you can see the computer as an electrical space heater; effectively all of the electrical energy it is using gets turned into thermal energy.
I think you're suffering from the misconception that the temperature of the components is interesting for some reason. It's not. It is true that a higher temperature difference between a hot thing and the ambient air increases the rate at which energy is transferred from one to the other, but in this case we're talking about a steady state situation: we're inputting a constant amount of energy per second into the chip, and it's transferring exactly that much energy into the surrounding air per second. If it was transferring less energy out than it was receiving, it would become hotter, because it would be storing more energy.
- If you can explain this, great! I'm all ears.
- If not, STFU.
Of course I can't explain the conditions in your apartment with your computer without any details about it. For all I know you might have turned off the CPU power saving features in the BIOS and are always running at full power consumption.
LigH
9th December 2017, 23:53
And yet, you can't explain why a computer left on 24/7/365, using components with high TDP, will raise room ambient temperature by at least 5 degrees. Whereas components with low TDP will not do so, a mild 1 degree bump at most.
Please, Dr. Physics, explain that one.
Maybe because the walls of the room cool it down faster than the PC can heat it up?
lordsmurf
9th December 2017, 23:54
now you're trying to weasel out of being dumb on the internet.
Sigh. No. I came to the KNLmeansCL threads to talk about the filter, not this BS. I've mostly resolved that encoding speed issue. You're the one that keeps harping on TDP, and my statement of not wanting a graphics card because it add 5 degrees of heat to the room.
Back in the bad old days with Pentium 4's and such things
TDP is somewhat gamed like megapixels in cameras, and has been for years. CPUs can get hotter than the TDP, and TDP doesn't reflect maximum heat output. But it is a gauge of heat nonetheless. And that heat goes somewhere (ie, the room with the computer). A hotter TDP item rarely outputs less heat than lower TDP item, even at idle.
your apartment
Not where I live. You're assuming too much.
you might have turned off the CPU power saving features in the BIOS and are always running at full power consumption.
More assumptions.
Maybe because the walls of the room cool it down faster than the PC can heat it up?
Huh?
LigH
9th December 2017, 23:58
Please, please, concentrate more on technical than personal topics.
Some of our moderators here are quite strict when it comes to violating the Netiquette.
lordsmurf
10th December 2017, 00:15
Please, please, concentrate more on technical than personal topics.
Gladly! :)
One thing I noticed when trying to cut down the KNL settings (for speed) was that adjusting A=2 to A=1 seems to massively cut down on it's effectiveness, yet encoding speed remained almost unchanged. I didn't see why that would happen.
Also, the s=1 syntax suggestion from default s=2 did nothing.
I'm partially assuming it's related to the 4x calls from the script, or the horrible video where it was used.
TheFluff
10th December 2017, 00:38
You're the one that keeps harping on TDP, and my statement of not wanting a graphics card because it add 5 degrees of heat to the room.
If you don't want a GPU, fine! I'm not a GPU salesman. I'm not trying to say it's wrong to not have a GPU. Claiming an idling GPU will add five degrees (are we even talking Celsius here or what?) to your room temperature is physically possible but I'd call it extremely goddamn unlikely to be true.
TDP is somewhat gamed like megapixels in cameras, and has been for years. CPUs can get hotter than the TDP, and TDP doesn't reflect maximum heat output. But it is a gauge of heat nonetheless. And that heat goes somewhere (ie, the room with the computer).
It's not "gamed" - it's an engineering classification, not an empirically measured number. Maximum heat output is exactly what it reflects, although again it's not an exact measurement but rather a nice round ballpark number intended for estimating how much cooler you'll need.
A hotter TDP item rarely outputs less heat than lower TDP item, even at idle.
This statement is exactly what I'm taking issue with. A processor will output not output even a milliwatt more thermal energy than the electrical energy it is consuming, and I've already shown you exact power consumption numbers at idle. This is fundamental thermodynamics. If you refuse to accept this you are rejecting physics as a whole and effectively believe in magic.
Please, please, concentrate more on technical than personal topics.
Some of our moderators here are quite strict when it comes to violating the Netiquette.
lol this forum is barely moderated at all
tebasuna51
10th December 2017, 11:18
lol this forum is barely moderated at all
Well, it is amusing that kind of discussions, seems you have enough time in your lifes.
BTW if Khanattila (thread owner) want I can delete some off topic posts (or create a new thread about temperature).
Khanattila
16th December 2017, 16:00
Well, it is amusing that kind of discussions, seems you have enough time in your lifes.
BTW if Khanattila (thread owner) want I can delete some off topic posts (or create a new thread about temperature).
I do not care.
Groucho2004
16th December 2017, 16:04
I can delete some off topic posts (or create a new thread about temperature).Either option would probably be appreciated by most users. Just my 2c.
real.finder
16th December 2017, 17:28
create a new thread about temperature is better in my opinion
Atak_Snajpera
17th December 2017, 18:42
Why does KNLMeansCL v1.1 throw this error (i'm using avisynth+MT)
http://i.cubeupload.com/7wHX3w.png
script
video=FFVideoSource("E:\_Video_Samples\mp4\Sony_4K_HDR_Camp.mp4") //420p10 source
video=ConvertToYUV444(video)
video=KNLMeansCL(video,d=1, a=2, s=4, h=4, device_type="CPU", device_id=0)
http://i.cubeupload.com/SDu15t.png
Khanattila
19th December 2017, 18:27
Another bug? Possible.
Khanattila
3rd January 2018, 17:56
First of all, happy new year :)
Good, let's get back to release updates.
Contrary to what I had planned the v1.1.* branch will have update (bugfixes) because the main changes that I would like to implement are really taking me longer than expected.
Let's make a list of known bugs:
- clc compile error with OCL 1.2 (fixed);
- Broken frame on first request (Bug don't happen when running with d=0, without rclip or inside MP_Pipeline);
- Low values of ref clip cause dimmed borders;
- Don't work with AMD RX Vega GPU;
- Wrong message with YUV444P10 input (fixed)(Atak_Snajpera)
- AviSynth+ YV24 native format bug (fixed)(MysteryX)
Khanattila
29th January 2018, 16:32
https://github.com/Khanattila/KNLMeansCL/releases/tag/v1.1.1
KNLMeansCL v1.1.1
* Added more check of rclip.
* Fixed build programm error in some circumstances.
* Fixed Avisynth YUV444P10 video format.
* Fixed Vapoursynth RGB30 video format.
* Fixed clip processing with higher resolution than 4K.
Enjoi.
tormento
29th January 2018, 17:58
KNLMeansCL v1.1.1
First of all, thanks.
I use it as prefilter with SMDegrain.
Any idea of why video output size changed?
From changelog, nothing gives hints. :confused:
Khanattila
29th January 2018, 18:03
First of all, thanks.
I use it as prefilter with SMDegrain.
Any idea of why video output size changed?
From changelog, nothing gives hints. :confused:
Hi... size changed? More info?
tormento
29th January 2018, 18:34
Hi... size changed? More info?
I am encoding a movie right now. After that I will give you some comparison.
tormento
30th January 2018, 11:21
Ok, first time I try this with some method. It could sound picky, but I am curious about deterministic influence of programming over a algorithm, that in theory should give always same results.
I used these (https://forum.doom9.org/showthread.php?p=1832139#post1832139) clips that I already uploaded. The first one has a very low bitrate, the second one is full of movement.
First of all a very simple script:
SetMemoryMax(8000)
SetFilterMTMode("DEFAULT_MT_MODE", 2)
SetFilterMTMode("ChangeFPS", 3)
SetFilterMTMode("DGSource", 3)
LoadPlugin("D:\eseguibili\media\DGDecNV\x64\DGDecodeNV.dll")
DGSource("E:\in\1_58 Hitman's bodyguard\hitman01.dgi")
ChangeFPS(last,last,true)
KNLMeansCL()
Results:
hitman01_KNL-1.1.0.mkv 1.465.303
hitman01_KNL-1.1.1.mkv 1.464.935
hitman04_KNL-1.1.0.mkv 11.701.482
hitman04_KNL-1.1.1.mkv 11.694.121
Then I tried to use KNLMeansCL as a prefilter, with this script (and these (https://forum.doom9.org/showthread.php?p=1832208#post1832208) modifications):
SetMemoryMax(8000)
SetFilterMTMode("DEFAULT_MT_MODE", 2)
SetFilterMTMode("ChangeFPS", 3)
SetFilterMTMode("DGSource", 3)
LoadPlugin("D:\eseguibili\media\DGDecNV\x64\DGDecodeNV.dll")
DGSource("E:\in\1_58 Hitman's bodyguard\hitman04.dgi")
ChangeFPS(last,last,true)
SMDegrain (tr=4,PreFilter=4,thSAD=400,contrasharp=false,refinemotion=false,truemotion=true,plane=4,chroma=true,lsb=true,mode=0)
Prefetch(6)
Results:
hitman04_SMD-1.1.0.mkv 7.828.657
hitman04_SMD-1.1.1.mkv 7.794.803
And the question is: why has output size changed?
Shouldn't be the applied algorithm always the same?
LigH
30th January 2018, 11:34
Why are you surprised? Obviously, KNLMeansCL alone filters the video in a different way than SMDegrain as a whole.
And is it even a different clip? (hitman01 vs. hitman04)
BTW, an algorithm has no rhythm.
tormento
30th January 2018, 12:13
Why are you surprised? Obviously, KNLMeansCL alone filters the video in a different way than SMDegrain as a whole
Comparison is between two versions of KNLMeansCL about same clip.
Do you think I would really ask why two different filters have different output sizes? :confused:
P.S: Thanks for english corrections.
jmartinr
30th January 2018, 15:08
hitman04_SMD-1.1.0.mkv 7.828.657
hitman04_SMD-1.1.1.mkv 7.794.803
And the question is: why has output size changed?
Shouldn't be the applied algorithm always the same?
7828657 / 7794803 = 1.0043
That's still a very small difference.
Khanattila
30th January 2018, 15:24
Comparison is between two versions of KNLMeansCL about same clip.
Do you think I would really ask why two different filters have different output sizes? :confused:
P.S: Thanks for english corrections.
Different approximations in some calculations in the kernel code.
KNLMeansCL/commit (https://github.com/Khanattila/KNLMeansCL/commit/f05be07cb907db8ec50a2ae385c5b26de49ed007#diff-f0e737d9f8d126b6e49cf6f7c52e7171)
tormento
30th January 2018, 19:23
Different approximations in some calculations in the kernel code.
That wasn't in changelog :D
Thanks.
LigH
30th January 2018, 20:03
Sorry, tormento, I thought you compared another pair of files... :o
Atak_Snajpera
30th January 2018, 21:23
What does this mean?
http://i.cubeupload.com/TlYuha.png
video=ConvertToYUV444(video).KNLMeansCL(d=1, a=2, s=4, h=4, device_type="CPU", device_id=0).ConvertToYUV420
Khanattila
30th January 2018, 22:00
What does this mean?
http://i.cubeupload.com/TlYuha.png
video=ConvertToYUV444(video).KNLMeansCL(d=1, a=2, s=4, h=4, device_type="CPU", device_id=0).ConvertToYUV420
add channels="YUV"
Atak_Snajpera
30th January 2018, 22:15
http://i.cubeupload.com/pGWnUp.png
video=ConvertToYUV444(video).KNLMeansCL(d=1, a=2, s=4, h=4, device_type="CPU", device_id=0,channels="YUV").ConvertToYUV420
Why CPU device does not support this mode?
Khanattila
30th January 2018, 23:04
http://i.cubeupload.com/pGWnUp.png
video=ConvertToYUV444(video).KNLMeansCL(d=1, a=2, s=4, h=4, device_type="CPU", device_id=0,channels="YUV").ConvertToYUV420
Why CPU device does not support this mode?
Implementation-defined, however, it is difficult for the CPUs to support that mode.
The program is GPU oriented, and GPU work well with INT8, INT16, INT32, HALF and FLOAT.
So it makes sense not to support intermediate precision like INT9, INT12 or INT14.
However, there is a special format INT_101010, where the channels of each element (10 bits per channel) are packed into a single INT32.
Unfortunately, it is not very supported.
Atak_Snajpera
31st January 2018, 12:35
Ok. No problem. I was just curious...
Khanattila
2nd February 2018, 10:51
Ok. No problem. I was just curious...
You are welcome
littlepox
12th February 2018, 15:41
Hi all, need some help with KNLMeansCL on AMD RX Vega64:
denoised Y clip comes with broken data (mostly zero, very few times random output). This is a known issue (https://github.com/Khanattila/KNLMeansCL/issues/26) and we will await the patch.
Meanwhile, we would like to know whether using RGB is a safe workaround or not(assume we don't want to touch UV planes) :
a = "your file with YUV-8bit format.m2ts"
src8 = core.lsmas.LWLibavSource(a,threads=1)
src16 = core.fmtc.bitdepth(src8, bits=16)
Y = core.std.ShufflePlanes(src16, 0, vs.GRAY)
nr16y = core.resize.Bicubic(Y, format=vs.RGB48,matrix_in_s="709")
nr16y = core.knlm.KNLMeansCL(nr16y, d=1, a=2, s=3, h=1.3, channels="RGB", device_type="GPU")
nr16y = core.resize.Bicubic(nr16y, format=vs.GRAY16,matrix_s="709")
nr16y.set_output()
It looks OK for a few samples but we would like to know whether it is indeed unaffected by the same issue. Thanks for help!
Khanattila
12th February 2018, 16:38
Hi all, need some help with KNLMeansCL on AMD RX Vega64:
denoised Y clip comes with broken data (mostly zero, very few times random output). This is a known issue (https://github.com/Khanattila/KNLMeansCL/issues/26) and we will await the patch.
Meanwhile, we would like to know whether using RGB is a safe workaround or not(assume we don't want to touch UV planes) :
a = "your file with YUV-8bit format.m2ts"
src8 = core.lsmas.LWLibavSource(a,threads=1)
src16 = core.fmtc.bitdepth(src8, bits=16)
Y = core.std.ShufflePlanes(src16, 0, vs.GRAY)
nr16y = core.resize.Bicubic(Y, format=vs.RGB48,matrix_in_s="709")
nr16y = core.knlm.KNLMeansCL(nr16y, d=1, a=2, s=3, h=1.3, channels="RGB", device_type="GPU")
nr16y = core.resize.Bicubic(nr16y, format=vs.GRAY16,matrix_s="709")
nr16y.set_output()
It looks OK for a few samples but we would like to know whether it is indeed unaffected by the same issue. Thanks for help!
Hi littlepox, thanks for your report.
The main problem is I do not have a Vega GPU. In the country where I live the cost is very high, over 800€!
I also tried AMD's CodeXL, but for now, I do not see something strange. Future investigations are required.
I do not know if the workaround you suggest works or not, there is a problem with the new AMD OpenCL compiler for Vega.
There are probably some optimizations in place that are not clear.
fadedmaple
25th February 2018, 12:14
Hi,i`m use KNLMeansCL in vapoursynth with GTX1060 .
The system is Win10 and driver 390.77.
I found the GPU performance can not be fully realized.
the vpy script like this
src = core.lsmas.LWLibavSource(r'E:\OB\MEET_THE_FOCKERS_HDCLUB\BDMV\STREAM\00372.m2ts')
src = core.knlm.KNLMeansCL(src,d = 3,a = 6, h = 1.2,channels="Y",device_type = "gpu" )
src = core.knlm.KNLMeansCL(src,d = 3,a = 6, h = 1.2,channels="UV",device_type = "gpu" )
Only 0.3 fps ,And take up 10%-30% GPU usage。
Is it unable to run out of GPU or is it my own problem?
Khanattila
25th February 2018, 15:56
Hi,i`m use KNLMeansCL in vapoursynth with GTX1060 .
The system is Win10 and driver 390.77.
I found the GPU performance can not be fully realized.
the vpy script like this
src = core.lsmas.LWLibavSource(r'E:\OB\MEET_THE_FOCKERS_HDCLUB\BDMV\STREAM\00372.m2ts')
src = core.knlm.KNLMeansCL(src,d = 3,a = 6, h = 1.2,channels="Y",device_type = "gpu" )
src = core.knlm.KNLMeansCL(src,d = 3,a = 6, h = 1.2,channels="UV",device_type = "gpu" )
Only 0.3 fps ,And take up 10%-30% GPU usage。
Is it unable to run out of GPU or is it my own problem?
Hi fadedmaple, can you post the whole script?
The situation you describe is typical of a CPU-bottleneck.
fadedmaple
25th February 2018, 16:57
Hi fadedmaple, can you post the whole script?
The situation you describe is typical of a CPU-bottleneck.
here the whole script ,nothing special
from vapoursynth import core
import vapoursynth as vs
src = core.lsmas.LWLibavSource(r'E:\OB\MEET_THE_FOCKERS_HDCLUB\BDMV\STREAM\00372.m2ts')
src = core.knlm.KNLMeansCL(src,d = 3,a = 6, h = 1.2,channels="Y",device_type = "gpu" )
src = core.knlm.KNLMeansCL(src,d = 3,a = 6, h = 1.2,channels="UV",device_type = "gpu" )
src.set_output()
If i set the parametes as default (d = 1,a = 2),the x265 get a faster speed,even faster than no denoise.
So I think it really is using my GPU.
I use vseditor to benchmark ,when set d=3 a=6 ,CPU usage is very low,why CPU-bottleneck?
Khanattila
25th February 2018, 17:52
I never used vseditor, but I suspect it could slow things down.
RX 480 8GB (1330MHz / 2000MHz) ~1,29 FPS with 90-100% GPU Load.
script.vpy
import vapoursynth as vs
core = vs.get_core()
clip = core.lsmas.LWLibavSource("Sample.mkv", format="YUV420P8")
# 1920x1080 clip from a Blu-ray.
clip = core.knlm.KNLMeansCL(clip, d=3, a=6, channels="Y", device_type = "GPU")
clip = core.knlm.KNLMeansCL(clip, d=3, a=6, channels="UV", device_type = "GPU")
clip.set_output()
launcher.bat
vspipe script.vpy NUL -p
PS. Furthermore, there is the possibility LWLibavSource has decoding problems in that particular situation.
You should use a blank clip rather:
core.std.BlankClip(width=1920, height=1080, format=vs.YUV420P8, length=1000)
fadedmaple
26th February 2018, 07:47
I never used vseditor, but I suspect it could slow things down.
RX 480 8GB (1330MHz / 2000MHz) ~1,29 FPS with 90-100% GPU Load.
script.vpy
import vapoursynth as vs
core = vs.get_core()
clip = core.lsmas.LWLibavSource("Sample.mkv", format="YUV420P8")
# 1920x1080 clip from a Blu-ray.
clip = core.knlm.KNLMeansCL(clip, d=3, a=6, channels="Y", device_type = "GPU")
clip = core.knlm.KNLMeansCL(clip, d=3, a=6, channels="UV", device_type = "GPU")
clip.set_output()
launcher.bat
vspipe script.vpy NUL -p
PS. Furthermore, there is the possibility LWLibavSource has decoding problems in that particular situation.
You should use a blank clip rather:
core.std.BlankClip(width=1920, height=1080, format=vs.YUV420P8, length=1000)
Thanks for you explain and advise,i find a very strange thing.
I record a short video here https://youtu.be/yvW8pOkl2_I
I have use a BlankClip in the video,you can see the GPU load change after I close and reopen the chrome .
fadedmaple
26th February 2018, 13:48
You should really use something like GPU-Z instead of Win10's task manager for measuring GPU Load.
A rookie mistake ... :stupid:
It works well with 90-100% GPU Load.
tuanden0
26th April 2018, 12:45
Could you give me a link to download onpencl for AMD? I can't find it anywhere :(
LigH
26th April 2018, 13:07
In general, a hardware accelerated OpenCL driver should be part of a current graphic card driver (not knowing AMD, but nVidia drivers do install OpenCL.dll and additional hardware specific DLL files in the system director{y/ies}).
Atak_Snajpera
26th April 2018, 13:49
Could you give me a link to download onpencl for AMD? I can't find it anywhere :(
OpenCL is a part of AMD GPU driver.
tuanden0
26th April 2018, 15:25
OpenCL is a part of AMD GPU driver.
thank you, I installed :thanks:
tormento
17th November 2018, 11:15
@Khanattila what about trying to create a FFT3DCL filter? :)
Arhu
21st November 2018, 09:54
I'm seeing some weird frame order issues that appear to be happening with KNLMeansCL for me. I'm not sure for how long it has been happening because I only noticed recently with some UHD encodes. It may go back a few months.
1. Without KNLMeansCL frames seem to be fine in the output.
2. With d=0 and some values vor s, a and h sometimes a frame is skipped and later on another frame is repeated.
3. With d>0 and particularly with some UHD sources I occasionally but repeatedly get jumbled frames. E.g. for frames 1, 2, 3, 4, 5, 6 I'd get 1, 2, 3, 2, 5, 6 or something like that.
I didn't have time for more tests yet, but wanted to ask if this is a known problem or if anyone knows why this could be happening? Maybe something with the GPU or some buffer? I'm using a Geforce 1060, currently updating drivers.
Here's a sample script from staxrip:
import os
import sys
ScriptPath = 'D:/stax/staxrip/Apps/Plugins/VS/Scripts'
sys.path.append(os.path.abspath(ScriptPath))
import vapoursynth as vs
core = vs.get_core()
core.std.LoadPlugin(r"D:\stax\staxrip\Apps\Plugins\both\ffms2\ffms2.dll")
core.std.LoadPlugin(r"D:\stax\staxrip\Apps\Plugins\vs\fmtconv\fmtconv.dll")
core.std.LoadPlugin(r"D:\stax\staxrip\Apps\Plugins\both\KNLMeansCL\KNLMeansCL.dll")
clip = core.ffms2.Source(r"D:\clip.mkv", cachefile = r"D:\clip_temp\clip.ffindex")
clip = core.fmtc.bitdepth(clip, bits=16)
clip = core.knlm.KNLMeansCL(clip, d = 2, s = 4, a = 4, h = 0.5)
clip.set_output()
Atak_Snajpera
21st November 2018, 13:34
I'm seeing some weird frame order issues that appear to be happening with KNLMeansCL for me. I'm not sure for how long it has been happening because I only noticed recently with some UHD encodes. It may go back a few months.
1. Without KNLMeansCL frames seem to be fine in the output.
2. With d=0 and some values vor s, a and h sometimes a frame is skipped and later on another frame is repeated.
3. With d>0 and particularly with some UHD sources I occasionally but repeatedly get jumbled frames. E.g. for frames 1, 2, 3, 4, 5, 6 I'd get 1, 2, 3, 2, 5, 6 or something like that.
I didn't have time for more tests yet, but wanted to ask if this is a known problem or if anyone knows why this could be happening? Maybe something with the GPU or some buffer? I'm using a Geforce 1060, currently updating drivers.
Here's a sample script from staxrip:
import os
import sys
ScriptPath = 'D:/stax/staxrip/Apps/Plugins/VS/Scripts'
sys.path.append(os.path.abspath(ScriptPath))
import vapoursynth as vs
core = vs.get_core()
core.std.LoadPlugin(r"D:\stax\staxrip\Apps\Plugins\both\ffms2\ffms2.dll")
core.std.LoadPlugin(r"D:\stax\staxrip\Apps\Plugins\vs\fmtconv\fmtconv.dll")
core.std.LoadPlugin(r"D:\stax\staxrip\Apps\Plugins\both\KNLMeansCL\KNLMeansCL.dll")
clip = core.ffms2.Source(r"D:\clip.mkv", cachefile = r"D:\clip_temp\clip.ffindex")
clip = core.fmtc.bitdepth(clip, bits=16)
clip = core.knlm.KNLMeansCL(clip, d = 2, s = 4, a = 4, h = 0.5)
clip.set_output()
I suspect that FFms2 plugin is unable to deliver frames in right order for knlmeanscl.
ChaosKing
21st November 2018, 14:30
I suspect that FFms2 plugin is unable to deliver frames in right order for knlmeanscl.
Test your source with seek-test https://gist.github.com/dubhater/3a2c8a59841cae49ecae25cd47ff78d2
Arhu
21st November 2018, 16:14
I suspect that FFms2 plugin is unable to deliver frames in right order for knlmeanscl.
Test your source with seek-test https://gist.github.com/dubhater/3a2c8a59841cae49ecae25cd47ff78d2
I'm too much of a newbie to get it to work, but I found an old post of yours where you describe the issue I'm having. Switched to LWLibavSouce in staxrip and frames look accurate now. Guess I'll use that one from now on.
Bummer. I suppose I won't have to redo all of my earlier encodes as most of them look fine. It's just a select few that suffer from relatively obvious jerkiness where isolated frames weren't just repeated or skipped but came out in the wrong order.
Anyway, thanks for the quick help.
ChaosKing
22nd November 2018, 00:20
I'm too much of a newbie to get it to work, but I found an old post of yours where you describe the issue I'm having.
Try the FATpack here https://forum.doom9.org/showthread.php?p=1858098#post1858098 (need to download seek-test zip AND the latest zip from the 1st page)
You literary just need to extract it and drag&drop your video file onto the bat file.
Katie Boundary
15th February 2019, 03:24
I just gave this a spin. What's interesting is that it delivers extremely uneven results from one frame to the next. On most, it'll deliver stronger denoising than blur(1.0) without the actual blurring, but on some frames (maybe 20 or 25%?), it seems to do nothing at all.
SaurusX
19th February 2019, 15:43
I just gave this a spin. What's interesting is that it delivers extremely uneven results from one frame to the next. On most, it'll deliver stronger denoising than blur(1.0) without the actual blurring, but on some frames (maybe 20 or 25%?), it seems to do nothing at all.
What are the parameters you're using? This is my go-to denoiser, but the choice of parameters makes a big difference.
Selur
24th February 2019, 15:30
Small question for clarification: What color spaces are supported when using Vapoursynth?
Because when loading an 8bit 4:2:0 source, I get no problem, but when loading a 10bit 4:2:0 source I get 'only YUV444P10 and RGB30 are supported!'
So does KNLMeansCL only support 4:2:0 when using 8bit?
script I used:
import vapoursynth as vs
core = vs.get_core()
# Loading Plugins
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/DenoiseFilter/KNLMeansCL/KNLMeansCL.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# Loading E:\Output\10bitTest.mkv using LWLibavSource
clip = core.lsmas.LWLibavSource(source="E:/Output/10BITT~1.MKV", format="YUV420P10", cache=0)
# making sure input color matrix is set as 470bg
clip = core.resize.Point(clip, matrix_in_s="470bg",range_s="limited")
# making sure frame rate is set to 25/1
clip = core.std.AssumeFPS(clip, fpsnum=25, fpsden=1)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# denoising using KNLMeansCL
clip = core.knlm.KNLMeansCL(clip=clip, device_type="gpu", device_id=0)
# adjusting output color from: YUV420P10 to YUV420P8 for x264Model (i420)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, range_s="limited")
# Output
clip.set_output()
also adding:
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P10, range_s="limited")
doesn't seem to fix the issue, when using:
# Imports
import vapoursynth as vs
core = vs.get_core()
# Loading Plugins
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/DenoiseFilter/KNLMeansCL/KNLMeansCL.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# Loading E:\Output\10bitTest.mkv using LWLibavSource
clip = core.lsmas.LWLibavSource(source="E:/Output/10BITT~1.MKV", format="YUV420P10", cache=0)
# making sure input color matrix is set as 470bg
clip = core.resize.Point(clip, matrix_in_s="470bg",range_s="limited")
# making sure frame rate is set to 25/1
clip = core.std.AssumeFPS(clip, fpsnum=25, fpsden=1)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# denoising using KNLMeansCL (bit depth: 10)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P10, range_s="limited")
clip = core.knlm.KNLMeansCL(clip=clip, device_type="gpu", device_id=0)
# adjusting output color from: YUV444P10 to YUV420P8 for x264Model (i420)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, range_s="limited")
# Output
clip.set_output()
I still get:
Python exception: knlm.KNLMeansCL: only YUV444P10 and RGB30 are supported!
using:
clip = core.resize.Bicubic(clip=clip, format=vs.RGB30, matrix_in_s="470bg", range_s="limited")
does the trick for me, so from the looks of it bitdepth > 8 bit requires a conversion to RGB30.
Cu Selur
littlepox
25th February 2019, 17:03
Processing under YUV444P16 gives weird output, similar to the problems with Vega.
DJATOM
26th February 2019, 12:21
Tried with rtx2070 and I don't see any artifacts besides lost details from denoising: https://slowpics.org/comparison/ed6f00e4-b4f2-4a0d-8c6f-0a5f18a34bff
ChaosKing
26th February 2019, 12:38
Khanattila Last Activity: 26th October 2018 19:54
@selur maybe it would be better to open a github issue.
Selur
5th March 2019, 21:01
@ChaosKing: Thanks for the heads-up.
-> https://github.com/Khanattila/KNLMeansCL/issues/42
i recently upgraded to ryzen + radeon. i am getting weird frames while using knlmeans prefilter in smdegrain like this
https://i.imgur.com/YL2rHpH.jpg
it didnt happen in intel + nvidia... is there any solution ?
Atak_Snajpera
6th May 2019, 13:34
Try again with mod16 resolution (816p instead of 818p)
Try again with mod16 resolution (816p instead of 818p)
thanks. didn't make any difference.
i also tried following things
lwlibav instead of ffmsindex
mkvtoolnix and eac3to instead of makemkv
in all cases same issue... in some blurays it works fine and in some it gives garbage output.
Groucho2004
7th May 2019, 18:34
thanks. didn't make any difference.
i also tried following things
lwlibav instead of ffmsindex
mkvtoolnix and eac3to instead of makemkv
in all cases same issue... in some blurays it works fine and in some (mostly too noisy) sources it gives garbage output.
It might be a silly question but you have tested the filter without SMDegrain, right?
It might be a silly question but you have tested the filter without SMDegrain, right?
yes i did
https://imgur.com/a/N1y9OwH
dark frame on direct knlmeans,
others are with smdegrain(prefilter=4)
edit : i was getting this issue when windows updated few things automatically, now i uninstalled graphics drivers, everything works fine now. sounds strange but results are impressive now, thanks everyone.
Katie Boundary
2nd August 2019, 06:08
What exactly is opencl.dll and why do I need it now and why didn't I need it when I first tried this filter?
LigH
2nd August 2019, 07:25
The opencl.dll is a part of the graphic drivers set. It provides the OpenCL programming interface to allow the use of your GPU not to display fancy 3D worlds on the screen, but to calculate elaborate maths.
If you didn't need it before, it was probably available. If you need it now, it might not be available anymore in your system ... did you recently update your graphic drivers to a version which does not offer OpenCL support (e.g. shipped by Microsoft Windows, not by your graphic card vendor)?
Katie Boundary
2nd August 2019, 16:29
did you recently update your graphic drivers to a version which does not offer OpenCL support (e.g. shipped by Microsoft Windows, not by your graphic card vendor)?
Negatory but I did just learn something interesting: the filter works perfectly fine in my Win7 partition. Only my XP partition is missing the dll. I might be able to just search for the dll and then copy-paste.
EDIT: "The procedure entry point InitOnceExecuteOnce could not be located in the dynamic link library KERNEL32.dll". That's unfortunate. Kernel32.dll sounds like something really important that XP probably already has and that shouldn't just be overwritten with the Win7 version or else my computer might start vomiting green liquid and chanting backward in Latin.
StainlessS
2nd August 2019, 17:11
"The procedure entry point InitOnceExecuteOnce could not be located in the dynamic link library KERNEL32.dll"
That opencl.dll will only work on some later ver$ OS, "start vomiting", possibly, "chanting backward in Latin", less likely. :)
EDIT: Check out your graphics card maker's site (Intel/NVidia), might be an XP version [driver or Opencl only, but alas both seem to have dropped support for XP].
EDIT:
Both Intel and AMD used to supply [their version of] OpenCl.dll in a developers SDK,
AMD, old versions [that I have]
AMD-APP-SDK-v2.7-Windows-32.exe [~= 102MB]
AMD-APP-SDK-v2.9-1.599.381-GA-Full-windows-32.exe [~= 109MB]
Intel
intel_sdk_for_ocl_applications_2014_x86_setup.msi [~= 87MB]
I only managed to ever get the CPU version of OpenCL working,
Never did get my (crap, low power) graphics card to do anything at all [crashed Initializing, if I remember the error messages],
Graphics
Monitor
Name HP E231 on NVIDIA GeForce GT 520
Current Resolution 1920x1080 pixels
Work Resolution 1920x1036 pixels
State Enabled, Primary
Monitor Width 1920
Monitor Height 1080
Monitor BPP 32 bits per pixel
Monitor Frequency 60 Hz
Device \\.\DISPLAY1\Monitor0
NVIDIA GeForce GT 520
Manufacturer NVIDIA
Model GeForce GT 520
GPU GF119
Device ID 10DE-1040
Revision A2
Subvendor Undefined (0000)
Current Performance Level Level 1
Current GPU Clock 270 MHz
Current Memory Clock 405 MHz
Current Shader Clock 405 MHz
Voltage 0.900 V
Technology 40 nm
Die Size 79 mm²
Release Date Apr 12, 2011
DirectX Support 11.0
OpenGL Support 5.0
Bus Interface PCI Express x16
Temperature 43 °C
Driver version 23.21.13.9135
BIOS Version 75.19.1b.00.00
ROPs 4
Shaders 48 unified
Memory Type DDR3
Physical Memory 2047 MB
Virtual Memory 2048 MB
Bus Width 32x2 (64 bit)
Filtering Modes 16x Anisotropic
Noise Level Silent
Max Power Draw 29 Watts
Count of performance levels : 2
Level 1 - "2D Desktop"
GPU Clock 270 MHz
Memory Clock 540 MHz
Shader Clock 405 MHz
Level 2 - "3D Applications"
GPU Clock 810 MHz
Memory Clock 1620 MHz
Shader Clock 535 MHz
EDIT: I have another old crap nVidia, dont think I ever got that doing anything either. [GT206 or somethinglike that]
and same with some old AMD card.
EDIT: I should have 64 bit version of SDKs too, but cant seem to find them. [only 64 bit sdk I have is for Linux]
EDIT: There are (apparently) other OpenCl providers, WikiPedia:- https://en.wikipedia.org/wiki/OpenCL,
And the guys that govern the OpenCL standard, with lists of conformant Implementers of OpenCL[at bottom of page]:- https://www.khronos.org/opencl/
After my experience of trying to get OpenCL doing anything useful, I gave up, just dont care any more.
EDIT: And also some as yet non conformant providers, eg open source POCL:- http://portablecl.org/
Katie Boundary
2nd August 2019, 19:11
OMG Stainless you are literally the most helpful person on this whole forum. Have I ever told you that?
A Qwant search, plus following some links that seemed promising, revealed that version 3.0 of the AMD implementation can be found here:
http://amd-dev.wpengine.netdna-cdn.com/app-sdk/installers/APPSDKInstaller/3.0.130.135-GA/full/AMD-APP-SDKInstaller-v3.0.130.135-GA-windows-F-x86.exe
http://amd-dev.wpengine.netdna-cdn.com/app-sdk/installers/APPSDKInstaller/3.0.130.135-GA/full/AMD-APP-SDKInstaller-v3.0.130.135-GA-windows-F-x64.exe
If I'm using the 32-bit version of AVIsynth on a 64-bit OS, do I install the x86 version or the x64 version?
EDIT: "The operating system is not adequate for running AMD APP SDK 3.0". Son of a bitch.
I'm thinking of just using Virtualdub in win7 to create filtered and HuffYUV-compressed versions of the clips that I need, then loading them into my Premiere project in XP. Or maybe just do it all in Linux/WINE.
Groucho2004
2nd August 2019, 19:20
A Qwant search, plus following some links that seemed promising, revealed that version 3.0 of the AMD implementation can be found here:
http://amd-dev.wpengine.netdna-cdn.com/app-sdk/installers/APPSDKInstaller/3.0.130.135-GA/full/AMD-APP-SDKInstaller-v3.0.130.135-GA-windows-F-x86.exe
http://amd-dev.wpengine.netdna-cdn.com/app-sdk/installers/APPSDKInstaller/3.0.130.135-GA/full/AMD-APP-SDKInstaller-v3.0.130.135-GA-windows-F-x64.exe
If I'm using the 32-bit version of AVIsynth on a 64-bit OS, do I install the x86 version or the x64 version?
EDIT: "The operating system is not adequate for running AMD APP SDK 3.0". Son of a bitch.
There are old versions that run on XP. However, these are software emulations, they won't use your graphics hardware. You can just use TNLMeans which would be faster. See also this post (https://forum.doom9.org/showthread.php?p=1739321#post1739321).
It's usually best to use the OpenCL implementation that comes with your driver.
By the way, which graphics card are you using?
StainlessS
2nd August 2019, 20:05
Sorry bout OS not being OK, but thanks for the links.
I shall down them and bank until I find the enthusiasm to attempt re-try. cheers.
[Hopefully W7x64 is OK].
Katie Boundary
2nd August 2019, 21:14
You can just use TNLMeans which would be faster. See also this post (https://forum.doom9.org/showthread.php?p=1739321#post1739321).
Is TNLMeans included in KNLmeans or do I have to download it separately? Where's the documentation for this plugin, anyway?
By the way, which graphics card are you using?
I've been using AMD integrated graphics (A10-7860K, Radeon R7) ever since my Geforce 730 died a few months ago.
Sorry bout OS not being OK, but thanks for the links.
I shall down them and bank until I find the enthusiasm to attempt re-try. cheers.
[Hopefully W7x64 is OK].
I'm happy I could help :) Win7 should be fine; it's still being supported by Microsoft until the beginning of next year so everyone else in the industry kind of has to support it too.
ChaosKing
2nd August 2019, 21:19
It is a separate plugin http://avisynth.nl/index.php/TNLMeans
Groucho2004
2nd August 2019, 21:51
I've been using AMD integrated graphics (A10-7860K, Radeon R7)Maybe you find answers here (https://www.geeks3d.com/20181220/how-to-enable-intel-opencl-support-on-windows-when-amd-radeon-graphics-driver-is-installed/) on enabling OpenCL support. Please note that the latest KNLMeansCL requires OpenCL 1.2. If your card only supports OpenCL 1.1, you'll have to go back to a previous version, see here (https://github.com/Khanattila/KNLMeansCL/wiki/Requirements).
Katie Boundary
2nd August 2019, 21:51
All right, excellent. I now have fully functional non-local means denoising in XP. Thanks everyone!
Maybe you find answers here (https://www.geeks3d.com/20181220/how-to-enable-intel-opencl-support-on-windows-when-amd-radeon-graphics-driver-is-installed/) on enabling OpenCL support.
"On a Windows 10 system with..."
Well then that's a big no. It'll be a cold day in hell before I use Win10 for anything or even go back to Win8.1
Groucho2004
2nd August 2019, 21:57
All right, excellent. I now have fully functional non-linear means denoising in XP. Thanks everyone!I believe you mean non-local means. ;)
Katie Boundary
3rd August 2019, 06:03
Fixed lol
aymanalz
14th October 2019, 04:11
Any tips on what settings to use if I want KNLMeansCL purely for degraining? That is, I want it to remove a lot of grain, but (hopefully) no other detail? Live action film, not anime.
Cary Knoop
14th October 2019, 04:32
Any tips on what settings to use if I want KNLMeansCL purely for degraining? That is, I want it to remove a lot of grain, but (hopefully) no other detail? Live action film, not anime.
I recommend testing it, there is no one cookie-cutter setting.
For instance, use a combination of stack horizontal and vertical to create a video matrix with various settings, pick the one that is most to your liking.
Or interleave various settings and go through them one by one.
Alternatively, you might want to opt for BM3D for removing grain. It's slow though, until someone ports a GPU version (hint, hint, wink, wink).
aymanalz
14th October 2019, 05:13
I recommend testing it, there is no one cookie-cutter setting.
For instance, use a combination of stack horizontal and vertical to create a video matrix with various settings, pick the one that is most to your liking.
Or interleave various settings and go through them one by one.
Alternatively, you might want to opt for BM3D for removing grain. It's slow though, until someone ports a GPU version (hint, hint, wink, wink).
Someone has ported BM3D to GPU, but it is in prototype stage as of now. (So says the Vapoursynth wiki.)
I'd prefer to use the GPU for degraining, as my encoding is already very slow. That's why I'm trying KNLmeansCL.
In general, for removing grain, does increasing the temporal parameter (d) help? How high can I increase the h parameter, without starting to lose other details?
Are there any grain removal specific combinations of the settings?
Also, which weighting function should I use?
Cary Knoop
14th October 2019, 18:40
Are there any grain removal specific combinations of the settings?
Also, which weighting function should I use?
Testing is the answer to your questions!
There are no magic settings.
videoh
14th October 2019, 19:33
There's no formal definition of "grain", so we can't be sure what you mean by degraining. For me, grain is a film thing and it doesn't cross frames, so temporal processing is not needed. Tell us more or better still give us a sample.
Cary Knoop
14th October 2019, 19:40
For me, grain is a film thing and it doesn't cross frames, so temporal processing is not needed.
How on Earth did you make the conclusion that temporal processing is not needed?
What you say is completely wrong!
videoh
14th October 2019, 20:09
Cary is throwing a narc tantrum because someone has a different opinion.
Atak_Snajpera
14th October 2019, 20:56
There's no formal definition of "grain", so we can't be sure what you mean by degraining. For me, grain is a film thing and it doesn't cross frames, so temporal processing is not needed. Tell us more or better still give us a sample.
You obviously have never used temporal mdegrain1/2/3 filter If you think that temporal processing is basically useless.
videoh
14th October 2019, 21:15
I never said "temporal processing is basically useless", which means you are a scoundrel. DG is still living rent-free in your head. Loving it!
Atak_Snajpera
14th October 2019, 21:29
I never said "temporal processing is basically useless", which means you are a scoundrel. DG is still living rent-free in your head. Loving it!
Temporal mdegrain will always give you better quality than knlmeanscl or any other spatial filter. Deal with IT. Spatial denoising like knlmeanscl destroys details like crazy. After all those years You are still such a noob...
LigH
15th October 2019, 07:15
No religious wars, please. Thank you.
Cary Knoop
22nd October 2019, 20:12
Question about KNLMeansCL: Would it be beneficial to detect pre-deinterlace noise patterns with this filter or should this filter only be used after proper deinterlacing?
poisondeathray
22nd October 2019, 21:39
Question about KNLMeansCL: Would it be beneficial to detect pre-deinterlace noise patterns with this filter or should this filter only be used after proper deinterlacing?
progressive only, otherwise it will mess up the fields
either a) double rate deinterlace; or b) separate grouped even /odd fields and apply to each separately then weave back . For (b) you retain original fields, but you don't get temporal denoising between even/odd fields . I would say (a) is preferred
Cary Knoop
22nd October 2019, 21:57
progressive only, otherwise it will mess up the fields
either a) double rate deinterlace; or b) separate grouped even /odd fields and apply to each separately then weave back . For (b) you retain original fields, but you don't get temporal denoising between even/odd fields . I would say (a) is preferred
When I wrote interlaced I actually meant to use option b.
I was thinking about doing a first run using option b and then deinterlace (with frame doubling) and apply a second run.
But the question is if that is worth it?
poisondeathray
22nd October 2019, 22:09
When I wrote interlaced I actually meant to use option b.
I was thinking about doing a first run using option b and then deinterlace (with frame doubling) and apply a second run.
But the question is if that is worth it?
You can try it; but I don't think it's worth it in general (for other denoisers as well, not just KNLMeansCL) . When you process even/odd separately , you can introduce a type of flicker because you don't even out the pattern between even/odd
If there was some type of defect limited to , say the even fields, then you might do that as to not contaminate the other odd fields with temporal processing (denoising or double rate deinterlacing with temporal smoothing like QTGMC). Or if one group had more noise (e.g. maybe chroma noise) than the other , you might preprocess them separately with different strengths and filters applied to even vs. odd
aymanalz
26th October 2019, 12:47
KNLmeansCL seems to have no effect on the output file when the weighing function chosen is anything other than Welsch. Has anybody else experienced this? During the encode, the GPU runs at high power, but the output file remains un-denoised, if I select any other weighing function.
I mentioned this to @selur, as I thought it's a bug in his program "Hybrid", and he was able to confirm the bug - but he stated that the bug is in KNLmeansCL.
Selur
26th October 2019, 13:21
Hybrid properly uses:
clip = core.knlm.KNLMeansCL(clip=clip)
clip = core.knlm.KNLMeansCL(clip=clip, wmode=1)
clip = core.knlm.KNLMeansCL(clip=clip, wmode=2)
clip = core.knlm.KNLMeansCL(clip=clip, wmode=3)
no error occurs, but interleaving the filtered and unprocessed frames does not show a differenc if wmode != 0.
(Hybrid uses KNLMeansCL 1.1.1)
Cu Selur
Cary Knoop
26th October 2019, 16:36
KNLmeansCL seems to have no effect on the output file when the weighing function chosen is anything other than Welsch. Has anybody else experienced this?
I have no problem with for instance Modified Bisquare on Vapoursynth.
aymanalz
26th October 2019, 17:11
I have no problem with for instance Modified Bisquare on Vapoursynth.
What program do you use? Hybrid or Staxrip or...
Additionally, and I'm not sure if this is important, but what are you encoding from and to? x264/x265/something else?
Cary Knoop
26th October 2019, 18:30
What program do you use? Hybrid or Staxrip or...
Additionally, and I'm not sure if this is important, but what are you encoding from and to? x264/x265/something else?
Just straight Vapoursynth piped to FFmpeg.
No, the codec is not relevant. When I do a diff using Vapoursynth Editor, I can see a clear difference.
Selur
27th October 2019, 06:14
You are right there are differences using:
# Imports
import vapoursynth as vs
core = vs.get_core()
# Loading Plugins
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/DenoiseFilter/KNLMeansCL/KNLMeansCL.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SourceFilter/FFMS2/ffms2k.dll")
# Loading source using FFMS2K
clip = core.ffms2.Source(source="F:/TESTCL~1/files/test.avi",cachefile="E:/Temp/avi_078c37f69bb356e7b5fa040c71584c40_853323747.ffindex",format=vs.YUV420P8,alpha=False)
# making sure input color matrix is set as 470bg
clip = core.resize.Point(clip, matrix_in_s="470bg",range_s="limited")
# making sure frame rate is set to 25
clip = core.std.AssumeFPS(clip, fpsnum=25, fpsden=1)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
original = clip
# denoising using KNLMeansCL
clip = core.knlm.KNLMeansCL(clip=clip, wmode=2)
# adjusting for FilterView
if original.format.id != clip.format.id:
if (original.format.color_family == vs.RGB and clip.format.color_family != vs.RGB):
original = core.resize.Bicubic(original, format=clip.format.id, matrix_s="470bg", range_s="limited")
elif (original.format.color_family == clip.format.color_family):
original = core.resize.Bicubic(original, format=clip.format.id, range_s="limited")
else:
original = core.resize.Bicubic(original, format=clip.format.id, matrix_in_s="470bg", range_s="limited")
diff = core.std.MakeDiff(clip, original)
# Output
diff.set_output()
I can see differences even when not using wmode=9, but they are way less then when using wmode=0.
Instead of
diff = core.std.MakeDiff(clip, original)
# Output
diff.set_output()
Hybrid uses something like:
original = core.text.Text(original,"Original")
clip = core.text.Text(clip,"Filtered")
interleaved = core.std.Interleave([original, clip])
# Output
interleaved.set_output()
-> Looks to me like neither a bug in Hybrid or the filter, but simply that with wmode=2 those subtle differences are really hard to spot when looking at the frames itself. :)
Cu Selur
Cary Knoop
27th October 2019, 07:00
Out of curiosity why all the testing of the color format? KNLMeans does not convert the format. Also for YUV by default color is not processed.
Selur
27th October 2019, 07:24
Like the script states '# adjusting for FilterView' Hybrid does adjust the color (just) for the preview (converting to RGB in the script instead of having the editor used for the preview do it). :)
The color part before that:
# making sure input color matrix is set as 470bg
clip = core.resize.Point(clip, matrix_in_s="470bg",range_s="limited")
# making sure frame rate is set to 25
clip = core.std.AssumeFPS(clip, fpsnum=25, fpsden=1)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
is only used to make sure Vapoursynth assumes the same color matrix etc. that Hybrid assumes from the analysis of the source.
Cu Selur
aymanalz
27th October 2019, 10:46
-> Looks to me like neither a bug in Hybrid or the filter, but simply that with wmode=2 those subtle differences are really hard to spot when looking at the frames itself. :)
Cu Selur
In one of the earlier pages on this thread, @khanattila suggested using wmode=2 for removing heavy grain. But if I do that, no matter how high the strength, no grain seems to get removed. If the differences are too subtle to notice, he wouldn't have suggested wmode=2 for heavy degraining, right?
Cary Knoop
27th October 2019, 16:24
In one of the earlier pages on this thread, @khanattila suggested using wmode=2 for removing heavy grain. But if I do that, no matter how high the strength, no grain seems to get removed. If the differences are too subtle to notice, he wouldn't have suggested wmode=2 for heavy degraining, right?
What parameters do you use?
Selur
29th February 2020, 08:35
Hi,
I'm getting:
KNLMeansCL(device_type="auto")
Avisynth preview error: Avisynth error : KNLMeansCL: fatal error! (oclUtilsGetPlaformDeviceIDs: OCL_UTILS_UNKNOWN_ERROR) (E:\Temp\tempPreviewAvisynthFile08_26_19_695.avs, line 11) Couldn't import -1 (1):
NLMeansCL2()
Avisynth preview error: Avisynth error �Dw.>: NLMeansCL2: Houston, we've had a problem! [clGetPlatformIDs (GENERIC_ERROR)] (E:\Temp\tempPreviewAvisynthFile08_26_28_182.avs, line 11) Couldn't import -1 (1): ?Dw.>
using Windows 10pro 1909 (Build 18363.657) with an AMD Ryzen 7 1800X and a Geforce GTX 1070 Ti driver version 442.50.
anyone else experiencing this?
Cu Selur
Ps.: ' core.knlm.KNLMeansCL(clip=clip)' in Vapoursynth works fine.
Sharc
29th February 2020, 10:11
No problem here.
Hybrid 2020.02.16.1
Windows 10 Home (x64) Build 18363.657 (1909)
Intel Core i5-8400
NVIDIA GeForce GTX 1050 Ti, 26.21.14.3630 (GeForce 436.30)
Installed Avisynth versions:
VersionString: AviSynth+ 3.4 (r2923, 3.4, i386)
VersionNumber: 2.60
File / Product version: 3.4.0.0 / 3.4.0.0
Interface Version: 6
Multi-threading support: Yes
VersionString: AviSynth+ 3.4 (r2923, 3.4, x86_64)
VersionNumber: 2.60
File / Product version: 3.4.0.0 / 3.4.0.0
Interface Version: 6
Multi-threading support: Yes
Selur
29th February 2020, 10:34
Okay, then it probably is a driver issue. -> Will do some testing.
Thanks for the feedback. :)
Cu Selur
Khanattila
29th February 2020, 11:46
It could be a driver problem indeed ... what version of AviSynth do you use?
Selur
29th February 2020, 12:23
tested different driver versions (from https://www.nvidia.com/Download/Find.aspx?lang=en-us used GeForce Game Ready Driver')
442.50 -> fail
442.19 -> fail
441.87 -> fail
441.66 -> fail
441.41 -> fail
441.20 -> fail
441.12 -> fail
441.08 -> failed to install: "Your system requires DCH driver packages,... " :/
440.97 -> failed to install: "Your system requires DCH driver packages,... " :/
436.48 -> failed to install: "Your system requires DCH driver packages,... " :/
436.30 -> failed to install: "Your system requires DCH driver packages,... " :/
deinstalled drivers using DDU, installed older drivers restarted, tested,...
I use AviSynth+ 0.1 (r272, MT, i386) according to version().
Cu Selur
StainlessS
29th February 2020, 12:30
Selur, r272 from 2014, dump and and get v3.4(Oct 2019):- https://github.com/AviSynth/AviSynthPlus/releases
EDIT: Nice speedup amongst other things.
Selur
29th February 2020, 12:57
I get the exactly same error message with "Avisynth+ 3.4 (r295, master, i386)",...
Groucho2004
29th February 2020, 14:12
I get the exactly same error message with "Avisynth+ 3.4 (r295, master, i386)",...????? How do you get these revision numbers / version strings?
Selur
29th February 2020, 14:31
Sorry, it's 'r2925', lost the 2 during typing.
https://i.ibb.co/s5mbNVM/avisynth-Plus.png
I get it my calling 'version()' and look at it in AvsPmod,...
Groucho2004
29th February 2020, 14:35
Sorry, it's 'r2925', lost the 2 during typingAh, OK.
tormento
1st March 2020, 13:52
436.30 -> failed to install: "Your system requires DCH driver packages,... " :/
deinstalled drivers using DDU, installed older drivers restarted, tested,..
Unfortunately DCH will be a mandatory step. Anyway here with 450.12 everything is working fine and bit faster too.
Selur
5th March 2020, 20:20
Anyway here with 450.12 everything is working fine and bit faster too.
Where did you get that version?
'442.50' is the latest I see over at NVIDIAs Download site (https://www.nvidia.de/Download/Find.aspx?lang=en)
Cu Selur
tormento
6th March 2020, 11:31
Where did you get that version?
Included in Windows Insider version.
It gives you WDDM 2.7:
Hardware-accelerated GPU scheduling (An additional option in the system settings, which increases the minimum and average fps to reduce latency)
Shader Model 6.5
DirectX 12 Raytracing Tier 1.1
DirectX 12 Mesh Shader
DirectX 12 Sampler Feedback: Texture Streaming, Texture-Space Shading
DirectX 12 Video Protected Resource Support
Selur
6th March 2020, 14:25
Ah okay, then I'll wait for it to be available. Will stick with Vapoursynth for the time being, but good to know it'll be fixed in a newer version.
Cu Selur
tormento
8th March 2020, 09:45
good to know it'll be fixed in a newer version
Newer versions=mandatory DCH
Selur
19th March 2020, 19:51
hmm,..
Geforce Experience just installed 442.74, sadly those drivers didn't help.:/
(luckily hardware filters seem to work fine with Vapoursynth)
Cu Selur
tormento
19th March 2020, 21:05
hmm,..
Geforce Experience just installed 442.74, sadly those drivers didn't help.:/
(luckily hardware filters seem to work fine with Vapoursynth)
Cu Selur
Why oh why you uninstalled DCH?
sl1pkn07
19th March 2020, 22:01
https://www.dropbox.com/s/xxj86mdfkckgx9b/450.12.zip?dl=0 DCH
https://mega.nz/#!PZ1m0CSK!b5F4edNUcBaaErgjsjuXmLBP7enXL63A_epCzl8ij_E Standard
from Guru3d (https://forums.guru3d.com/threads/nvidia-450-12-whql-for-win10-x64.430333/)
IDK if works outside Insider (XD)
Selur
20th March 2020, 08:19
Installed 450.12 from that link (and rebooted), sadly it did not help, error is still there.
Cu Selur
tormento
20th March 2020, 09:59
Installed 450.12 from that link (and rebooted), sadly it did not help, error is still there.
Cu Selur
Can you be more specific about error?
Selur
20th March 2020, 11:46
@tormento: posted the error message before, see: https://forum.doom9.org/showthread.php?p=1902429
tormento
20th March 2020, 12:17
@tormento: posted the error message before
Tried to set correct device number and see what GPU-Z tells you? I think removing DCH perhaps messed up something with device inf or OpenGL libraries. Try to restore DCH too.
Selur
21st March 2020, 12:16
I use the 442.74 DCH install downloaded from NVIDIA.
I only have one graphic card and using 'KNLMeansCL(device_type="gpu",device_id=0)' sadly does not change anything, error stays the same.
tormento
21st March 2020, 13:00
I use the 442.74 DCH install downloaded from NVIDIA.
I only have one graphic card and using 'KNLMeansCL(device_type="gpu",device_id=0)' sadly does not change anything, error stays the same.
Try to look at dependencies of the dll. Perhaps you uninstalled something necessary.
Selur
21st March 2020, 13:38
Usually when a dependency is missing there should be a problem loading the filter itself, the error:
Avisynth preview error: Avisynth error ��[>: KNLMeansCL: fatal error! (oclUtilsGetPlaformDeviceIDs: OCL_UTILS_UNKNOWN_ERROR) (E:\Temp\TEMPPR~1.AVS, line 11) Couldn't import -1 (1): ��[>
sounds to me more like the ocl interface changed in the new drivers or something similar.
I looked at gpu-z:
http://gpuz.techpowerup.com/20/03/21/a55.png
but don't see anything that seems wrong,...
Since the Vapoursynth gpu filters all work fine it might be that this is only an issue with using 32bit Avisynth (Vapoursynth I use 64bit).
Cu Selur
tormento
21st March 2020, 23:12
Since the Vapoursynth gpu filters all work fine it might be that this is only an issue with using 32bit Avisynth (Vapoursynth I use 64bit).
Definitely use x64 AVS+
Selur
22nd March 2020, 20:22
I mainly use Avisynth for SD content and Vapoursynth for HD+ resolutions, so 32bit is usually fine for me.
Would also first have to check whether all filters I use have 64bit ports.
Cu Selur
tormento
22nd March 2020, 20:24
I mainly use Avisynth for SD content and Vapoursynth for HD+ resolutions, so 32bit is usually fine for me.
Would also first have to check whether all filters I use have 64bit ports.
Cu Selur
I am telling you to use x64 because some people (me included) had problems with x86 and OpenCL.
Selur
25th March 2020, 20:54
worked fine so far, tested 64bit and it worked, but 32bit is still broken :/
tormento
18th April 2020, 14:16
worked fine so far, tested 64bit and it worked, but 32bit is still broken :/
Just installed 450.82 developer drivers. Working fine on my x64 chain.
Selur
19th April 2020, 17:41
Nice, hopefully it will still work with the next normal release. :)
Khanattila
20th April 2020, 16:25
I am telling you to use x64 because some people (me included) had problems with x86 and OpenCL.
Do you have problems with all 32bit opencl applications?
It could be an installer problem ... maybe you can solve it by changing some DLL manually
tormento
20th April 2020, 19:21
It could be an installer problem ... maybe you can solve it by changing some DLL manually
It's a long story... maybe. I use 99.999999% x64, so, no fuss.
Groucho2004
27th April 2020, 20:56
I updated my graphics card from GTX750 to GTX1660 a few days ago. I'm getting about twice the speed with KNLMeansCL. I was expecting a bit more but still, nice speed-up. :)
Atak_Snajpera
27th April 2020, 22:56
I updated my graphics card from GTX750 to GTX1660 a few days ago. I'm getting about twice the speed with KNLMeansCL. I was expecting a bit more but still, nice speed-up. :)
Indeed. Gtx1660 Has 5x more tflops than 750. I wonder where is bottleneck in this case.
videoh
27th April 2020, 23:28
Atak, I was wondering the same. Is Groucho doing an encode at the same time? Assuming not, is the boost coming mainly from faster frame decoding, or from faster KNLMeans?
750 is hybrid decode for HEVC IIRC, so there may be a big improvement in decoding speed. If of course Groucho is processing HEVC.
Groucho2004
28th April 2020, 00:07
Atak, I was wondering the same. Is Groucho doing an encode at the same time? Assuming not, is the boost coming mainly from faster frame decoding, or from faster KNLMeans?
750 is hybrid decode for HEVC IIRC, so there may be a big improvement in decoding speed. If of course Groucho is processing HEVC.Just decoding with DGDevNV is much faster with the 1660. It's just KNLMeansCL that did not quite yield the expected results. I'm testing with AVSMeter.
Groucho2004
28th April 2020, 00:15
Indeed. Gtx1660 Has 5x more tflops than 750. I wonder where is bottleneck in this case.Maybe it's my oldish mobo (P8P67) with PCI Express 2.0 slot.
videoh
28th April 2020, 00:25
Is your test stream HEVC? Frame size? Didn't read the whole thread, perhaps you already said.
Groucho2004
28th April 2020, 00:42
Is your test stream HEVC? Frame size? Didn't read the whole thread, perhaps you already said.Decoding 4K HEVC (SonyCamp4K) I get 155 fps with DGDecNV. 1080p H.264 is ~ 500 fps. That seems pretty fast.
Sparktank
28th April 2020, 01:05
I updated my graphics card from GTX750 to GTX1660 a few days ago. I'm getting about twice the speed with KNLMeansCL. I was expecting a bit more but still, nice speed-up. :)
I need to get one of those.
The 1060 is a nice upgrade over my 750ti.
videoh
28th April 2020, 02:02
Decoding 4K HEVC (SonyCamp4K) I get 155 fps with DGDecNV. Pretty good. I'm getting 326 fps with my 2080 Ti. :D
Groucho2004
28th April 2020, 02:31
I'm getting 326 fps with my 2080 Ti. :DWhich is 6-7 times the price of the 1660. :eek:
videoh
28th April 2020, 03:05
My progress bar of life is nearing the end (probably not soon enough for a lot of you). I'm not leaving my money to anybody. Gonna live it up!
LigH
28th April 2020, 08:05
I still have a PC with Phenom-II X6 and GT450. I seriously need a new PC ... but to be future-proof, it would cost me a month's wages.
Boulder
28th April 2020, 08:15
I still have a PC with Phenom-II X6 and GT450. I seriously need a new PC ... but to be future-proof, it would cost me a month's wages.
An X470 board + Ryzen 3700X is a quite affordable upgrade, which gives a big boost in video encoding and will easily last several years. AVX2 performance was increased substantially compared to the first-gen Ryzens. I don't expect to see any major jumps in the near future so my 3900X will do nicely for years (the next gen will require a new mobo and DDR5 RAM so no rush).
RAM is not too expensive either, the speed won't matter much when encoding.
MeteorRain
28th April 2020, 08:31
I'm on B450 + Ryzen 3600 + GTX 1650S and I feel like it's pretty future proof.
tormento
28th April 2020, 08:49
AVX2 performance was increased substantially compared to the first-gen Ryzens.
Zen 2 is a terrific architecture but about AVX2, that is sort of “emulated”. There are many articles about this topic, look at them if interested.
Boulder
28th April 2020, 09:07
Zen 2 is a terrific architecture but about AVX2, that is sort of “emulated”. There are many articles about this topic, look at them if interested.
I'm not sure I follow you. The first-gen Zen did some tricks which is why it was quite poor in AVX2. The current gen has full AVX2 support.
https://forum.doom9.org/showthread.php?t=174393&page=2 shows nicely how big the difference is. A 32-thread 1950X scored 4.26 for AVX2 and a stock 3900X (24 threads) got 5.51.
MeteorRain
28th April 2020, 09:33
Zen 2 is a terrific architecture but about AVX2, that is sort of “emulated”. There are many articles about this topic, look at them if interested.
Zen2 has full AVX2 capability. Not sure where you got that "emulated" idea.
tormento
28th April 2020, 10:06
Zen2 has full AVX2 capability. Not sure where you got that "emulated" idea.
Unfortunately I can't find the page anymore, I can summarize only.
By SIMDjson benchmark, it was shown that Intel has more AVX2 IPC than Zen2.
Apart from that, the higher core count could nullify that penalty.
Zen3 should come across that and introduce AVX512 too.
MeteorRain
28th April 2020, 10:33
Unfortunately I can't find the page anymore, I can summarize only.
By SIMDjson benchmark, it was shown that Intel has more AVX2 IPC than Zen2.
Apart from that, the higher core count could nullify that penalty.
Zen3 should come across that and introduce AVX512 too.
I found that benchmark. It was concluded that AMD has a poor IPC performance on AVX2. That is kinda expected, and actually many factors matters including that SIMDjson was optimized against Intel processors.
CPU pipelines, instruction order, cache size, even picking one instruction over another, can make a lot difference.
tormento
28th April 2020, 10:42
That is kinda expected, and actually many factors matters including that SIMDjson was optimized against Intel processors.
Wasn't compiled using neutral flags?
Groucho2004
28th April 2020, 10:44
Conversation is getting a bit off-topic...
MeteorRain
28th April 2020, 23:14
Wasn't compiled using neutral flags?
A highly optimized library wouldn't use a neutral flag. Also there's no neutral flag. If you have Intel CPU then all you can do is make sure your program runs fastest on that Intel CPU. If later AMD CPU appears and has different characteristics, likely some of the previous optimization won't make it as fast as on Intel CPU.
One example would be Intel has avx down clocking. So to reduce the chance of that you can carefully reduce the amount of heavy avx computing, and let CPU stay on light load frequency (higher frequency). But AMD doesn't have avx down clocking so the best thing to do is give it all the heavy lifting as much as possible.
Intel compiler for example when compiling avx 512, will take the down clocking in to account, and emit code that is not too hard for the CPU, so it won't run too fast to run slow (lol) but if AMD comes with 512 some day and it does not clock down, then when it runs the same binary it would not use its 100% potential.
tormento
29th April 2020, 00:00
One example would be Intel has avx down clocking.
AFAIK it's a bios option, not mandatory.
hintlou
27th May 2020, 12:58
After I updated some filters (yadifmod2-0.2.4,SangNom2-0.5.0,DCTFilter-0.5.1,vsMSharpen-2.0.0,MatchHistogram-2.1.0,TMM2-0.1.4,CombMask-2.0.0 and MPEG2DecPlus-0.1.2),my QTGMC 3.364 got error and warned me that "KNLMeans.dll cannot be used as a plugin for Avisynth".
I don't know which filter caused it.
pinterf
27th May 2020, 16:12
KNLMeansCL needs to be rebuilt for AviSynth+ 3.6
https://forum.doom9.org/showthread.php?p=1909698#post1909698
Until it is done officially, you can download it from my repository
hintlou
27th May 2020, 16:42
Thanks pinterf!I updated to your KNLMeansCL.
But it also made error:
Script error:expected ')'
((null),line 1,column 4)
(AviSynth+/plugins64+/srestore v2.796.avsi,line 79)
(QTGMC 3.364.avsi,line 186)
(my.avs line 25:QTGMC(preset="Very Slow", InputType=0,sourceMatch=3).SelectEven())
real.finder
27th May 2020, 19:24
Thanks pinterf!I updated to your KNLMeansCL.
But it also made error:
Script error:expected ')'
((null),line 1,column 4)
(AviSynth+/plugins64+/srestore v2.796.avsi,line 79)
(QTGMC 3.364.avsi,line 186)
(my.avs line 25:QTGMC(preset="Very Slow", InputType=0,sourceMatch=3).SelectEven())
update your scripts, especially SMDegrain and Zs_RF_Shared.avsi
hintlou
28th May 2020, 10:25
Thanks!After I updated the Zs_RF_Shared.avsi,problem were solved.
Selur
11th June 2020, 20:03
KNLMeansCL is still (https://forum.doom9.org/showthread.php?p=1902429#post1902429) crashing for me with:
Avisynth error : KNLMeansCL: fatal error! (oclUtilsGetPlaformDeviceIDs: OCL_UTILS_UNKNOWN_ERROR) (E:\Temp\tempPreviewAvisynthFile08_26_19_695.avs, line 11) Couldn't import -1 (1)
also tried the testbuild from pinterf but it doesn't change anything.
Since it there hasn't been a driver version since February that works for me with KNLMeansCL anyone has an idea how to get it working again?
(Problem is only with 32bit Avisynth, works fine in 64bit Vapoursynth)
=> found the problem here, I had an abandoned old OpenCL.dll in the same folder as KNLMeansCL which caused the problem, after removing the OpenCL.dll it's working again :)
Slogra
6th September 2020, 13:42
I'm using Ripbot264 which incluses the KNLMeansCL plugin, but the filter does not work well on my AMD VEGA GPU. (i believe it did not work on my previous AMD RX480 card either).
When i enable KNLMeansCL by using mono noise 2, then the output image gets very dark, almost completely black.
It seems to be minor issue though, because is soon as i resize the video from 1920x1080 to 1904x1072 for example, the output image is normal and the denoising works! It even works fine if i resize to higher resolution.
So resizing is a workaround. But i would like to keep original 1920x1080 resolution, so it's not a good workaround for me.
Does anyone know a better way to fix this issue?
mp3dom
6th September 2020, 20:35
Maybe it's due to a not mod16 resolution? You can workaround with padding, adding borders to the image (just the minimum needed, for example, does it work at 1920x1088?), filters and then crop the borders away to restore the original image.
Slogra
7th September 2020, 09:39
Thanks, that's a good idea.
I would think 1920x1088 would be better, but that resolution did not fix it.
But I know that resizing to 1936x1090 works. So i added 16 and 10, and that works!
video=video.AddBorders(0,0,16,10)
video=KNLMeansCL(video,d=1, a=2, s=4, h=2, device_type="GPU", device_id=0)
video=video.Crop(0,0,-16,-10)
tormento
9th September 2020, 17:03
KNLMeansCL is crashing for me with:
Avisynth error : KNLMeansCL: fatal error! (oclUtilsGetPlaformDeviceIDs: OCL_UTILS_UNKNOWN_ERROR) (E:\Temp\tempPreviewAvisynthFile08_26_19_695.avs, line 11) Couldn't import -1 (1)
Same error here after updating to NVidia drivers 460.15.
Unfortunately no orphaned opencl*.* around.
Reverted to 452.06 and everything works again.
tormento
22nd September 2020, 11:15
460.20 Nvidia drivers solved OpenCL issue.
real.finder
16th October 2020, 12:37
bug when using rclip and prefetch at least with https://github.com/pinterf/KNLMeansCL (didn't test the others since they not work with last avs+ now)
ColorBars(width=640, height=480, pixel_type="yv24").Trim(0,1000).Subtitle("Testing",align=5,size=200)
Animate(0, 500, "Crop",
\ 0, 0, 300,400,
\ 316, 0, 300,400)
KNLMeansCL(rclip=Blur(1))
prefetch(8)
using avspmod and seek to frame 120 (or any other) and refresh with f5 you will noted that image is blended with another frame and it same or worst when you go to the next frames (121, 122, ...) until you reach clean frames after some frames
the problem is there even without rclip, but it's worst with rclip
and it also showed with d=0
using SetFilterMTMode("KNLMeansCL",3,true) or SetFilterMTMode("KNLMeansCL",2,true) will fix it
edit: with real encoding, even SetFilterMTMode("KNLMeansCL",3,true) is not fully fix it, it only make it showed in less frames
edit: I tried with another device with only opencl on cpu, and it work fine! the one above was using intel gpu
edit: seems it also showed in opencl on cpu device, but not in the frame that I refreshed but in next 2 or 3
real.finder
22nd October 2020, 22:39
also I note that KNLMeansCL (at least with mcKNLMeansCL) in very complex scripts even without prefetch case random deadlock but the cpu usage will stay high in x264/avspmod with no progress
pinterf
12th November 2020, 13:56
bug when using rclip and prefetch at least with https://github.com/pinterf/KNLMeansCL (didn't test the others since they not work with last avs+ now)
ColorBars(width=640, height=480, pixel_type="yv24").Trim(0,1000).Subtitle("Testing",align=5,size=200)
Animate(0, 500, "Crop",
\ 0, 0, 300,400,
\ 316, 0, 300,400)
KNLMeansCL(rclip=Blur(1))
prefetch(8)
using avspmod and seek to frame 120 (or any other) and refresh with f5 you will noted that image is blended with another frame and it same or worst when you go to the next frames (121, 122, ...) until you reach clean frames after some frames
Bug fixed. For high bit depth (9-15 bits) support and other changes see change log. (mods done and tested for both VS and Avs)
https://github.com/pinterf/KNLMeansCL/releases/tag/v1.1.1e
real.finder
13th November 2020, 03:23
Bug fixed. For high bit depth (9-15 bits) support and other changes see change log. (mods done and tested for both VS and Avs)
https://github.com/pinterf/KNLMeansCL/releases/tag/v1.1.1e
thanks! everything seems work now
Khanattila
17th December 2020, 09:41
Bug fixed. For high bit depth (9-15 bits) support and other changes see change log. (mods done and tested for both VS and Avs)
https://github.com/pinterf/KNLMeansCL/releases/tag/v1.1.1e
Arg! You have succumbed to the dark side of the force!
I'm joking, of course.
EDIT. Seriously, I have never added support for 9-15 bits formats because I think it is a waste of memory.
In the best of scenarios, they are as fast as the 16-bit format... so why bother?
kedautinh12
17th December 2020, 13:24
You still developer KNLMeansCL or abandoned, Khanattila??
real.finder
17th December 2020, 14:48
Arg! You have succumbed to the dark side of the force!
I'm joking, of course.
EDIT. Seriously, I have never added support for 9-15 bits formats because I think it is a waste of memory.
In the best of scenarios, they are as fast as the 16-bit format... so why bother?
I think it's better to support them and leave the choice to the user, also here https://forum.doom9.org/showthread.php?p=1906009#post1906009
You still developer KNLMeansCL or abandoned, Khanattila??
I have same question and also https://forum.doom9.org/showthread.php?t=182126
feisty2
17th December 2020, 15:33
users don't know shit, the internal processing precision has nothing to do with either the bitdepth of the source file, or the bitdepth of the encoded file, or the display bitdepth.
feisty2
17th December 2020, 15:52
Even first going up to int16 or directly to fp32, then simply applying truncation to convert the bitdepth to something like int10 before encoding would be better than an int10 processing line. clueless users should be banned from touching filters before they understand how error propagation works.
Khanattila
18th December 2020, 12:07
I think it's better to support them and leave the choice to the user, also here https://forum.doom9.org/showthread.php?p=1906009#post1906009
I wrote it to be sharp and transparent and then use AvS or VS to smooth the corners.
Anyway, you are probably right; I wrote the program 6 years ago, while I was studying C and OpenCL, and anyone can notice it by style in which I wrote it.
I have same question and also https://forum.doom9.org/showthread.php?t=182126
To be honest, I didn't think anyone cared. I wrote it myself just to test one thing. It is a project that I could think of resuming if there is interest.
To talk about KNLMeansCL ... I don't think it's worth it. Let me be clear, I am glad that there is someone who takes care of it but OpenCL support is a complete disaster, and will not improve. If today I work on it actively, I will try to do it again in C ++ and Vulkan.
"Tensorflow on open source GPUs" - David Airlie (LCA 2020) (https://youtu.be/KfDQb6xOkXg?t=740)
ChaosKing
18th December 2020, 12:35
It's time for KNLMeansVK :cool:
real.finder
18th December 2020, 18:04
To be honest, I didn't think anyone cared. I wrote it myself just to test one thing. It is a project that I could think of resuming if there is interest.
I think there are many care, there were https://forum.doom9.org/showthread.php?p=1806299&highlight=KPassFilterCL#post1806299 even if KPassFilterCL was not announced back then and seems there are care in posts here https://forum.doom9.org/showthread.php?t=182126 too
real.finder
18th December 2020, 18:21
To talk about KNLMeansCL ... I don't think it's worth it. Let me be clear, I am glad that there is someone who takes care of it but OpenCL support is a complete disaster, and will not improve. If today I work on it actively, I will try to do it again in C ++ and Vulkan.
"Tensorflow on open source GPUs" - David Airlie (LCA 2020) (https://youtu.be/KfDQb6xOkXg?t=740)
well, even if Vulkan seems better, OpenCL still has Features on Vulkan like it can run on CPUs and old GPUs
KNLMeansCL still has problems that didn't fixed yet even by pinterf update, like dark image https://forum.doom9.org/showthread.php?p=1927287#post1927287 and this VS problem https://github.com/Khanattila/KNLMeansCL/issues/43
ChaosKing
18th December 2020, 18:36
AMD basically dropped OpenCL support anyway. GPU driver support is not that good on windows. Opencl in Ryzen is not supported, on windows. Why focus on old stuff if Vulkan is the future...
Reel.Deel
19th December 2020, 00:06
Khanattila nice to see you back around!
If possible can you please share the source code to KPassFilterCL?
Khanattila
19th December 2020, 11:36
Khanattila nice to see you back around!
If possible can you please share the source code to KPassFilterCL?
Fun fact, I don't think I have KPassFilterCL anymore.
Furthermore, PassFilter was something else than KPassFilterCL.
EDIT. It's your lucky day
StainlessS
19th December 2020, 19:24
Fun fact, I don't think I have KPassFilterCL anymore.
This is ? :- https://github.com/Khanattila/KPassFilterCL/tree/master/KPassFilterCL
EDIT: I Got from here:- https://sites.google.com/site/khanattilasfilters/
OOps, you already just posted that link in the other thread.
Khanattila
19th December 2020, 20:08
This is ? :- https://github.com/Khanattila/KPassFilterCL/tree/master/KPassFilterCL
EDIT: I Got from here:- https://sites.google.com/site/khanattilasfilters/
OOps, you already just posted that link in the other thread.
I was really sure I didn't have it anymore :D
ChaosKing
3rd February 2021, 14:14
Bug fixed. For high bit depth (9-15 bits) support and other changes see change log. (mods done and tested for both VS and Avs)
https://github.com/pinterf/KNLMeansCL/releases/tag/v1.1.1e
In Vapoursynth I get this
https://i.imgur.com/OAPJweD.png
sometimes like this
https://i.imgur.com/HekyxaH.png
clip = core.lsmas.LWLibavSource(source=r"f:\VTS_01_CHAPTER_03_1.VOB")# DVD NTSC 720x480
clip=mvf.Depth(clip, 16)
clip = core.knlm.KNLMeansCL(clip, d=2, a=3, h=1)
Only 16bit seems to be affected
Vapoursynth R52, Win10 64
pinterf
3rd February 2021, 16:48
In Vapoursynth I get this
https://i.imgur.com/OAPJweD.png
sometimes like this
https://i.imgur.com/HekyxaH.png
clip = core.lsmas.LWLibavSource(source=r"f:\VTS_01_CHAPTER_03_1.VOB")# DVD NTSC 720x480
clip=mvf.Depth(clip, 16)
clip = core.knlm.KNLMeansCL(clip, d=2, a=3, h=1)
Only 16bit seems to be affected
Vapoursynth R52, Win10 64
Right now I have an R48 and was not able to reproduce. Tried YUV420, 422, 444, 8-9-10-12-14-16 bits, channels="YUV" and without it.
EDIT: same with R52: I'm seeing no artifacts.
Does it work with the original one?
ChaosKing
3rd February 2021, 19:12
The original has the same problem :D
I switched recently to a AMD Vega64 card. On my previous GTX 1070 it was fine, at least the original version.
RGB24-48 is fine
YUV8-15 is fine, 16 bit = FAIL
What info should/can I provide in order to help fixing it?
EDIT
Avisynth 3.7 64bit looks ok
convertbits(16)
KNLMeansCL(d=2, a=3, h=1)
real.finder
3rd February 2021, 19:32
AMD GPU then maybe this has to do with it https://forum.doom9.org/showthread.php?p=1927287#post1927287
but since it work in avs, maybe this (https://github.com/Khanattila/KNLMeansCL/issues/43)?
Selur
3rd February 2021, 20:29
using:
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16, range_s="limited")
clip = core.knlm.KNLMeansCL(clip=clip, d=2, a=3, s=1, h=1.00)
with YUV444P16, YUV422P16, YUV420P16 works fine here. (using a Geforce GTX 1070ti)
could be an issue of 'clip=mvf.Depth(clip, 16)' or with the amd card,..
Cu Selur
pinterf
4th February 2021, 10:05
Could you please try this test build:
https://drive.google.com/uc?export=download&id=1xR5RPUUwJbF8ZNbY1P_6p3VxSq3S8ESU
Theoretically the same thing could happen in VapourSynth as in Avisynth did (and was fixed there): frame buffer would be freed up before the actual content is copied for OpenCL.
ChaosKing
4th February 2021, 10:08
Same broken output.
Usually the first preview is very dark, I see red and some blue colors. Then I try it with Depth(10) and it looks ok. Back to 16 again and it looks like the second image I posted here https://forum.doom9.org/showthread.php?p=1935108#post1935108
https://i.imgur.com/tA86OhO.png
left broken, right original
I tried it in vseditor and Vdub2, same result.
pinterf
4th February 2021, 10:55
Check if only plane 0 (Luma) is affected or chroma as well?
Default is luma-only working mode so chroma planes should be copied as-is.
EDIT:
further tests:
- OK? 10 bit input, channels "YUV"
- All is OK? 10 bit input, channels "YUV", mode_9_to_15bits parameter 0 and 1 and 2
- screenshot with info=1 parameter (unfortunately this works only for 8 bit modes)
ChaosKing
4th February 2021, 12:24
info:
https://i.imgur.com/0TL5lS0.png
knlm.KNLMeansCL(clip, channels="Y") # 8-15 bit OK - 16 broken (14 seems not to be supported?)
clip = clip.fmtc.resample(css="444")
clip=mvf.Depth(clip, 16)
clip = core.knlm.KNLMeansCL(clip, channels="YUV") 1-16 OK !
mode_9_to_15bits = 0,1,2 is only broken with 16bits Y channel, 1-15 are ok. YUV 16bits is also ok
=> So 16bit with only Y channel seems to be affected
I tested with your the latest test-version.
pinterf
4th February 2021, 12:50
Nothing special, just 'info' works for any formats (except 16-bit float "half"):
https://drive.google.com/uc?export=download&id=1hfd6K6Q4hOEqlDMwPrte6maqPs3DxElU
Khanattila
4th February 2021, 17:46
AMD GPU then maybe this has to do with it https://forum.doom9.org/showthread.php?p=1927287#post1927287
but since it work in avs, maybe this (https://github.com/Khanattila/KNLMeansCL/issues/43)?
Fun fact, Vega's availability has always been so scarce that I bought a Navi directly.
ChaosKing
11th February 2021, 11:50
Fun fact, Vega's availability has always been so scarce that I bought a Navi directly.
Crypto mining is back! I sold my Vega for a good price. GPU prices are insane right now...
I'm on a cheap GTX 660 now and 16 bit output looks ok here.
FranceBB
11th February 2021, 23:44
I'm on a cheap GTX 660 now and 16 bit output looks ok here.
For what it's worth, 4:2:2 16bit planar looks fine on Avisynth x64 3.7 on my NVIDIA Quadro P4000 as well.
Soichiro
4th February 2022, 01:33
I hope this doesn't count as a necro, but since I can't post issues on the Github fork, here seems like the best place.
I'm having the same issue you are. I narrowed down the triggers quite a bit.
It only happens on my Windows PC, which is running an AMD Radeon 6700 XT (latest drivers). My two Linux PCs, one with a Geforce 2060 and one with a 2070M, both produce correct outputs in all tested cases. (Unfortunately, I haven't narrowed it down to whether Windows is the trigger or AMD is the trigger.)
It only occurs on 8-bit or 16-bit inputs where the width of the video in bytes is a multiple of 32 (i.e. width in pixels is mod-32 for 8-bit or mod-16 for 16-bit).
I've tested both using a precompiled binary from the internet, as well as one compiled myself using the meson script in the repo, on clang 13, x86_64-pc-windows-msvc. This is all using pinterf's fork.
What seems to be happening is that every pixel in the luma plane is getting set to some very low value (1?) and it is causing the image to appear extremely dark like this.
info:
https://i.imgur.com/0TL5lS0.png
knlm.KNLMeansCL(clip, channels="Y") # 8-15 bit OK - 16 broken (14 seems not to be supported?)
clip = clip.fmtc.resample(css="444")
clip=mvf.Depth(clip, 16)
clip = core.knlm.KNLMeansCL(clip, channels="YUV") 1-16 OK !
mode_9_to_15bits = 0,1,2 is only broken with 16bits Y channel, 1-15 are ok. YUV 16bits is also ok
=> So 16bit with only Y channel seems to be affected
I tested with your the latest test-version.
takla
4th February 2022, 02:53
Why not use MVtools degrain or BM3D? They are a lot faster and can look just as good if not better.
Soichiro
4th February 2022, 03:04
BM3D is not faster than KNLMeansCL. Not even close. Unless you don't have a GPU.
Also that's the least helpful response ever, it's completely irrelevant to the issue I mentioned.
kedautinh12
4th February 2022, 03:26
I seen BM3DCUDA faster than KNLMEANSCL
Soichiro
4th February 2022, 05:07
In my case, it's not. On my 2060, BM3DCuda is (surprisingly) even slower than CPU BM3D. Which is, on the fastest preset, half the speed of KNLMeansCL.
And it's irrelevant anyway. All I came here to do is research and report more details on a bug. Not be dismissed for using KNLMeansCL, in the thread dedicated to KNLMeansCL.
tormento
4th February 2022, 09:56
In my case, it's not. On my 2060, BM3DCuda is (surprisingly) even slower than CPU BM3D. Which is, on the fastest preset, half the speed of KNLMeansCL.
Put the 2060 on the Windows PC and give DGDenoise a try.
It's as fast as being almost transparent and works really well with anime contents.
takla
4th February 2022, 13:18
In my case, it's not. On my 2060, BM3DCuda is (surprisingly) even slower than CPU BM3D. Which is, on the fastest preset, half the speed of KNLMeansCL.
And it's irrelevant anyway. All I came here to do is research and report more details on a bug. Not be dismissed for using KNLMeansCL, in the thread dedicated to KNLMeansCL.
Well in my testings KNLMeansCL was insanely slow (0.1fps) so I just moved on. I'm very surprised BM3D Cuda is slower then BM3D cpu...
What CPU do you have?
Also, why shouldn't I recommend denoisers which are better?
Dogway
4th February 2022, 19:59
Put the 2060 on the Windows PC and give DGDenoise a try.
Wow, so much better, I'm going to fully replace ex_KNLmeansCL with that.
tormento
4th February 2022, 20:03
Wow, so much better, I'm going to fully replace ex_KNLmeansCL with that.
Much better to place side by side with other prefilter modes than to fully replace, just to see how it performs on speed and noise reduction, also because it's CUDA only.
Dogway
4th February 2022, 20:42
Even these past days I was already pondering on removing KNLMeansCL or at least make it spatial only, it's motion estimation is horrible besides anime works better with spatial only. To me KNLMeansCL now looks like poor man's BM3D (when this one gets fixed). I will keep the function though.
Dogway
5th February 2022, 18:00
By the way I noticed that DGDenoise() is broken when chroma is denoised : ( Looks like we can't have a fully working GPU denoiser without jumping through hoops.
videoh
5th February 2022, 18:18
That was fixed just days ago. Re-download DGDecNV 239 and update DGDecodeNV.dll. If you still have a problem, let me know and I'll fix it straightaway. Working fine for me and others.
Dogway
5th February 2022, 18:43
Thanks videoh! Need to integrate latest version but felt intimidated by having to reindex all the source clips
videoh
5th February 2022, 18:58
Depending on your previous version you may be able to appropriately edit the dgi file instead of re-indexing.
Maybe since DG stuff is free now, I should unbundle the CUDA filters. Then you wouldn't have this dilemma.
anton_foy
6th February 2022, 11:00
Even these past days I was already pondering on removing KNLMeansCL or at least make it spatial only, it's motion estimation is horrible besides anime works better with spatial only. To me KNLMeansCL now looks like poor man's BM3D (when this one gets fixed). I will keep the function though.
Yes I agree even D=6 and MCknlmeanscl does not rid my footage of wobbly lines due to the noise. Did you guys get good results with Dgdenoise? When I used it with UHD material it looks just blurry and unusable and I cannot find any good settings. I guess this will be trial and error just as it was with knlmeanscl for me to find good settings which was also just blurry until I cranked up to s=6.
Dogway
6th February 2022, 19:36
@anton_foy: Yes it's too blurry so it might not be good for regular denoising but for prefiltering it's perfect. Normally you don't want to denoise spatially except for exceptional (yeah) cases.
@videoh: Worked now. I think when I tried a few months back I was keeping the major version "2053.0.0.239 X64" while now it's "239.0.0.0 X64"
real.finder
7th February 2022, 02:08
I hope this doesn't count as a necro, but since I can't post issues on the Github fork, here seems like the best place.
I'm having the same issue you are. I narrowed down the triggers quite a bit.
It only happens on my Windows PC, which is running an AMD Radeon 6700 XT (latest drivers). My two Linux PCs, one with a Geforce 2060 and one with a 2070M, both produce correct outputs in all tested cases. (Unfortunately, I haven't narrowed it down to whether Windows is the trigger or AMD is the trigger.)
It only occurs on 8-bit or 16-bit inputs where the width of the video in bytes is a multiple of 32 (i.e. width in pixels is mod-32 for 8-bit or mod-16 for 16-bit).
I've tested both using a precompiled binary from the internet, as well as one compiled myself using the meson script in the repo, on clang 13, x86_64-pc-windows-msvc. This is all using pinterf's fork.
What seems to be happening is that every pixel in the luma plane is getting set to some very low value (1?) and it is causing the image to appear extremely dark like this.
I think someone should report it to AMD so they fix it in windows, it was fixed in Linux https://github.com/Khanattila/KNLMeansCL/issues/26#issuecomment-660256817 (note that it not only KNLMeansCL problem (https://github.com/Khanattila/KNLMeansCL/issues/26#issuecomment-609772502) since Morpheus1123 said: "I also find similar issue occurs on VapourSynth-NNEDI3CL when I set planes=[0] or [1] or [2] or [0,1]........ . Planes=[0, 1, 2] is no problem.")
Edit: https://forum.doom9.org/showthread.php?p=1873988&highlight=dark#post1873988
Yes I agree even D=6 and MCknlmeanscl does not rid my footage of wobbly lines due to the noise. Did you guys get good results with Dgdenoise? When I used it with UHD material it looks just blurry and unusable and I cannot find any good settings. I guess this will be trial and error just as it was with knlmeanscl for me to find good settings which was also just blurry until I cranked up to s=6.
@anton_foy: Yes it's too blurry so it might not be good for regular denoising but for prefiltering it's perfect. Normally you don't want to denoise spatially except for exceptional (yeah) cases.
maybe xNLMeans worth a try https://forum.doom9.org/showthread.php?t=172966 , there are also https://github.com/pinterf/TNLMeans
kedautinh12
7th February 2022, 06:02
I remember xNLMeans very slow
real.finder
7th February 2022, 13:21
I remember xNLMeans very slow
it's cpu only and no simd (c only) so that normal
MysteryX
16th May 2022, 04:07
I'm trying to get KNLMeansCL to work in my Windows VM (with GPU passthrough), with the latest Avisynth+
ColorBars()
KNLMeansCL()
It throws
System exception: Access Violation
Are there additional dependencies needed to make it run?
Also the CPU-only mode isn't working, are there any plans to fix that?
EDIT: found the Pinterf plugin version and that one works. device_type="cpu" still doesn't work though.
Atak_Snajpera
19th May 2022, 14:35
Are you sure that you have required software installed for OpenCL running on CPU
Check this tool
https://www.mediafire.com/file/fd0jmbs7t642n5y/OpenCLinfo.exe/file
https://i.postimg.cc/5tNYDyS2/Capture.png
Selur
19th May 2022, 14:45
Didn't AMD drop OpenCL support through the CPU a while ago?
(Just checked, at least for my Ryzen 9 3950x I couldn't find any drivers,..)
guest
21st May 2022, 03:38
Didn't AMD drop OpenCL support through the CPU a while ago?
(Just checked, at least for my Ryzen 9 3950x I couldn't find any drivers,..)
I've never been successful at getting OpenCL to work with any CPU, be it Intel or AMD.
Need appropriate GPU !!!
MysteryX
21st May 2022, 05:34
You mean that none of the OpenCL plugins work on the CPU at all? I'm on Intel btw.
Atak_Snajpera
21st May 2022, 14:56
You mean that none of the OpenCL plugins work on the CPU at all? I'm on Intel btw.
KNMEANSCL works fine with device_type="CPU" . You just need proper driver
https://www.intel.com/content/www/us/en/developer/tools/opencl-cpu-runtime/overview.html
https://www.intel.com/content/www/us/en/developer/articles/technical/legacy-opencl-drivers.html#latest_CPU_runtime
kedautinh12
21st May 2022, 15:45
Didn't AMD drop OpenCL support through the CPU a while ago?
(Just checked, at least for my Ryzen 9 3950x I couldn't find any drivers,..)
I using AMD but can use with Knlmeanscl normally
guest
22nd May 2022, 03:32
KNMEANSCL works fine with device_type="CPU" . You just need proper driver
https://www.intel.com/content/www/us/en/developer/tools/opencl-cpu-runtime/overview.html
https://www.intel.com/content/www/us/en/developer/articles/technical/legacy-opencl-drivers.html#latest_CPU_runtime
I have tried this before, without too much luck, but certainly will give it another try, using "device type="CPU" in the command line.
Problem is, you need to sign up for an Intel Account, to get this :(
Thanks
guest
22nd May 2022, 03:33
I using AMD but can use with Knlmeanscl normally
Hi ked,
How ??
What CPU are you running (I know I should know this already, sorry)
kedautinh12
22nd May 2022, 06:57
Hi ked,
How ??
What CPU are you running (I know I should know this already, sorry)
Are you check your GPU support???https://i.imgur.com/P8oqc7v.png
guest
22nd May 2022, 09:43
Are you check your GPU support???https://i.imgur.com/P8oqc7v.png
I think you might have misunderstood, the subject was CPU OpenCL support, NOT GPU's.
Most GPU's DO support it...
kedautinh12
22nd May 2022, 18:03
I think you might have misunderstood, the subject was CPU OpenCL support, NOT GPU's.
Most GPU's DO support it...
Sorry, i'm mistake. I can't use KNLMEANSCL with my AMD GPU too :D
ReinerSchweinlin
23rd May 2022, 15:22
Sorry, i'm mistake. I can't use KNLMEANSCL with my AMD GPU too :D
no openCL support on your AMD GPU ? Which model do you have ?
Selur
23rd May 2022, 17:03
You mean that none of the OpenCL plugins work on the CPU at all? I'm on Intel btw.
No, I afaik. OpenCL stuff just does not work on AMD CPUs for quite some time, I assumed that Intel is working.
ReinerSchweinlin
24th May 2022, 11:51
I remember some driver install packages from AMD without OPENCL support in it, but in general, it always worked.
Since AMD dropped Support of GCN cards, there probably will not be any further development, but I see no reason, why the "old stuff" shouldn`t work anymore...
Did anyone check if the patched Anmermine drivers have OPEN CL included? For gaming and other stuff, these are a very nice option to give older cards new live (after all, a R9 Fury has almost 10tflops of FP32 compute power - not so bad even today...).
CPU-Support: I used to run Ripbot on a XEON Server with no possibility to add a GPU- Atak was so kind to enable the OPEN_CL CPU Switch in Ripbot - after installing the xeon-OpenCL Drivers - I was good to go. But lets not talk about speeds :)
I rememnber many installations with AMD Cards that prompted the CPU as OPENCL device, too. They were running on the AMD Drivers (even Intel CPUs).
So my guess is that in most cases where "its not running" it only takes a little driver installation, fiddling... Last month I trhew together some GCN 2.0 machines and used all kinds of benchmarks for stresstesting - luxmark always being one of them - runs on OPENCL... Mandelbubler is also on of my test-suites, OPENCL... Everythung "just worked"...
ReinerSchweinlin
24th May 2022, 12:04
I have tried this before, without too much luck, but certainly will give it another try, using "device type="CPU" in the command line.
Problem is, you need to sign up for an Intel Account, to get this :(
I remember... But its not too much harm getting an intel account - I recall it was relatively straight forward...
OPEN CL on CPUs really is not a lot of fun if you want to do something that actually nees a GPU... Even a 30 dollar gtx 750 outran my two xeons by A LOT...
kedautinh12
24th May 2022, 16:51
no openCL support on your AMD GPU ? Which model do you have ?
It's from my broken driver GPU. I fixed it and work KNLMEANSCL type GPU normally but still can't work with my AMD CPU
guest
25th May 2022, 03:49
I remember... But its not too much harm getting an intel account - I recall it was relatively straight forward...
OPEN CL on CPUs really is not a lot of fun if you want to do something that actually nees a GPU... Even a 30 dollar gtx 750 outran my two xeons by A LOT...
Somehow I have an Intel account, I just had to update my password, and was good to go.
I totally agree, OpenCL on CPU's is not pretty :(, but if you have no choice...
A $30 GTX 750...hmmm, can't find one of them.
I have a few 760's, 770's, etc, in my my older encoding servers, just incase.
ReinerSchweinlin
25th May 2022, 12:35
A $30 GTX 750...hmmm, can't find one of them.
I have a few 760's, 770's, etc, in my my older encoding servers, just incase.
Check the minimum OPENCL Version you need - head over to techpowerup to see which generation of GPU supports your OPENCL needs. 750 is Maxwell, 770 is Kepler. AFAIR, Kepler still is good for OPENCL 3.0, which should be totally ok.... Kepler is not supported in the newest NVIDIA drivers, but that might not be a problem in your case. Maxwell is supported...
A 770 (Kepler) is more powerfull than a 750 (maxwell), but older, but might still do the job...
AMD Cards from GCN Generation and higher are quite powerfull for OPENCL means... Even with the still a little crazy prices nowadays, it should be no problem to get a GPU for under 50 bucks to support the OPENCL filteriing - even the smallest one will be much more powerfull than a CPU for around the same money.. (So instead of ramping up the CPU - get a GPU).
takla
30th May 2022, 19:11
Just use ffmpegs built-in nlmeans_opencl like this
ffmpeg -y -benchmark -init_hw_device opencl=GPU -filter_hw_device GPU -i INPUT.mkv -map_metadata -1 -vf "format=yuv420p,hwupload,nlmeans_opencl,hwdownload,format=yuv420p" -c:v prores_ks OUTPUT.mov
Here are the available parameters (https://ffmpeg.org/ffmpeg-filters.html#nlmeans-1)
Use them like this nlmeans_opencl=s=1.0:p=7:r=15
Note1: r=15 might be too slow. Use lower values.
Note2: p=7 might be too lossy. Use higher values.
Note3: Anything but 8bit is not supported
Note4: If you have a nvidia GPU or a good CPU, use BM3D (https://github.com/WolframRhodium/VapourSynth-BM3DCUDA/issues/7#issuecomment-886173346)
Note5: Or use MDegrain (https://forum.doom9.org/showpost.php?p=1951459&postcount=1)
Both are much better then nlmeans.
kedautinh12
30th May 2022, 21:08
Just use ffmpegs built-in nlmeans_opencl like this
ffmpeg -y -init_hw_device opencl=ocl -filter_hw_device ocl -i INPUT.avs -c:v prores_ks -filter_complex "format=yuv420p, hwupload, nlmeans_opencl, hwdownload, format=yuv420p" OUTPUT.mkv
Here are the available parameters (https://ffmpeg.org/ffmpeg-filters.html#nlmeans-1)
Use them like this nlmeans_opencl=s=1.0:p=7:r=15
Note1: r=15 might be too slow. Use lower values.
Note2: p=7 might be too lossy. Use higher values.
Note3: Anything but 8bit is not supported
Note4: If you have a nvidia GPU or a good CPU, use BM3D (https://github.com/WolframRhodium/VapourSynth-BM3DCUDA/issues/7#issuecomment-886173346)
Note5: Or use MVtools (https://forum.doom9.org/showpost.php?p=1951459&postcount=1)
Both are much better then nlmeans.
Some people say KNLMeansCL still better than BM3D in here
takla
30th May 2022, 21:29
Some people say KNLMeansCL still better than BM3D in here
I did exactly one test with nlmeans_opencl which was not only MUCH slower then BM3D or MDegrain but also had MUCH worse quality. I tried multiple different parameters to no avail. That is already bad enough for me to never consider it as an option ever again.
guest
31st May 2022, 04:51
Some people say KNLMeansCL still better than BM3D in here
Well, I have to say I did a BM3D (CUDA) encode the other day, and it was NOT good, so that's off my usage list, from now on.
Having said that, BM3D (CPU) is OK :)
Yet to do a proper KNLMeansCL comparison.
Lan4
17th June 2023, 22:18
When this filter is running, my video card starts to squeak. The sound is like a grasshopper. The filter is working fine. Can this be fixed without repairing the video card?
Emulgator
17th June 2023, 23:34
That sqeaking just tells about the load.
If the video card is designed in a way that current draw can lead to magnetostriction
(inductivities can exhibit that), any serious load will trigger similar behaviour, not just KNLMeansCL.
Lan4
18th June 2023, 03:23
I compared the work of KNLMeansCL and FFT3DGPU in GPU-Z. Is the "GPU Load" value important? The load is 100% when KNLMeansCL is running. In other values, the difference is small.
kedautinh12
18th June 2023, 04:27
I compared the work of KNLMeansCL and FFT3DGPU in GPU-Z. Is the "GPU Load" value important? The load is 100% when KNLMeansCL is running. In other values, the difference is small.
For me, KNLMeansCL better than FFT3DGPU, FFT3DGPU ported base old ver of FFT3DFilter so it's even worst than FFT3DFilter
Lan4
25th June 2023, 04:12
Perhaps I have a strange question. How to reduce load and speed of KNLMeansCL? I don't need the maximum speed of the filter, KNLMeansCL is already fast enough. I want to try to reduce the temperature of the video card, the noise of the fans and remove the squeak.
poisondeathray
25th June 2023, 04:33
Perhaps I have a strange question. How to reduce load and speed of KNLMeansCL? I don't need the maximum speed of the filter, KNLMeansCL is already fast enough. I want to try to reduce the temperature of the video card, the noise of the fans and remove the squeak.
Look at various GPU over/underclocking utilities. They can change the core / memory speeds, voltage.
StainlessS
25th June 2023, 10:48
For me, KNLMeansCL better than FFT3DGPU, FFT3DGPU ported base old ver of FFT3DFilter so it's even worst than FFT3DFilter
FFT3DGPU uses less precision than CPU version FFT3DFilter,
it was always of lesser quality.
Lan4
25th June 2023, 14:58
Look at various GPU over/underclocking utilities. They can change the core / memory speeds, voltage.
I already thought about reducing the power of the video card. But is it possible to reduce the power of the filter itself?
OAKside
4th July 2023, 01:27
When this filter is running, my video card starts to squeak. The sound is like a grasshopper. The filter is working fine. Can this be fixed without repairing the video card?
KNLMeansCL does make my graphics card (6600 XT) produce a specific noise, not heard at other times (games, HW encoding, etc). The sound is like a constant white noise (low decibel, barely heard, similar to coil whine). I assumed it was due to the particular or heavy processing that is going on, like Emulgator has explained. It is my least favorite part about KNLMeansCL (haha, I just don't like my GPU yelling at me or screaming in agony). I assume there is no possible potential of damage (temps are fine). Anyway, this may be unrelated to your squeak, which may be due to load, temps, and fan speed (or even certain speed, which resonates, basically a problematic fan).
StainlessS
4th July 2023, 02:18
My GPU used to click [but not just with KNLMeansCL, which I dont think I've ever used],
I removed it, gave it a clean, plugged it back in and hey presto, no clicking now, for a couple of years.
guest
4th July 2023, 02:57
I already thought about reducing the power of the video card. But is it possible to reduce the power of the filter itself?
Try:-
MSI Afterburner (https://www.msi.com/Landing/afterburner/graphics-cards)
You could change the fan "curve", and maybe get passed the "squeak zone".
Katie Boundary
10th July 2023, 23:28
Come to think of it, a throttling parameter could be pretty generally useful. Set it to 30 and it won't use more than 30% of your available GPU power so you can play Cyberpunk 2077 while you render.
ChaosKing
11th July 2023, 10:16
Another way would be to set a lower Process Priority in Task Manager
https://helpdeskgeek.com/wp-content/pictures/2021/08/8-Set-Priority.png
LeXXuz
1st August 2023, 16:38
KNLMeansCL does make my graphics card (6600 XT) produce a specific noise, not heard at other times (games, HW encoding, etc). The sound is like a constant white noise (low decibel, barely heard, similar to coil whine). I assumed it was due to the particular or heavy processing that is going on, like Emulgator has explained. It is my least favorite part about KNLMeansCL (haha, I just don't like my GPU yelling at me or screaming in agony). I assume there is no possible potential of damage (temps are fine). Anyway, this may be unrelated to your squeak, which may be due to load, temps, and fan speed (or even certain speed, which resonates, basically a problematic fan).
Sounds like coil whine. Nothing you need to be afraid of. But it can be annoying depending on how sensitive your hearing is to high frequencies.
Katie Boundary
31st January 2024, 20:55
I have a new laptop and I'm reinstalling everything. I have several versions of KNLmeansCL and none of them work in Win7. I don't know why.
These are the versions that I have:
KNLMeansCL-v0.6.11.zip
KNLMeansCL-v1.1.1.zip
KNLMeansCL_1.1.1_test_for_avs3.5.2.7z
KNLMeansCL_1.1.1e_v20201112-pfmod.7z
Please direct me to one that works in Win7. Thanks.
ChaosKing
31st January 2024, 22:30
Knlmeanscl depends on MSVCP140.dll, VCRUNTIME140.dll, VCRUNTIME140_1.dll
You probably missing 2015-2022 runtimes https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170
Katie Boundary
1st February 2024, 07:01
Knlmeanscl depends on MSVCP140.dll, VCRUNTIME140.dll, VCRUNTIME140_1.dll
You probably missing 2015-2022 runtimes https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170
It's not that. I already have the MSVC++ 2005, 2010, 2012, 2013, and 2015-2022 runtimes in both 32 and 64-bit.
ReinerSchweinlin
1st February 2024, 08:27
Does OPENCL work on your system? In most cases, it is installed together with the GPU driver.
DOwnload GPU-Z to see if OPEN CL is installed
Take something like mandelbuler or an older geekbench version to see if OPEN CL actually works.
Which GPU are you using ?
kedautinh12
1st February 2024, 09:05
It's not that. I already have the MSVC++ 2005, 2010, 2012, 2013, and 2015-2022 runtimes in both 32 and 64-bit.
You need check in avsmeter
Katie Boundary
1st February 2024, 16:58
https://i.imgur.com/LHGHrdP.png
Which GPU are you using ?
Some Intel integrated BS
EDIT: Intel HD 3000, which is the same as my desktop. But KNLmeansCL works on the desktop.
DOwnload GPU-Z to see if OPEN CL is installed
GPU-Z reports that it is not installed... weird.
StainlessS
1st February 2024, 19:42
https://registry.khronos.org/OpenCL/sdk/3.0/docs/man/html/
OpenCL Runtime
Runtime API's
Buffer Objects
clEnqueueFillBuffer
clEnqueueFillBuffer is missing before version 1.2.
Maybe update Graphics driver, if available.
EDIT: Related, be careful:- https://forum.videohelp.com/threads/388441-dll-errors-when-using-qtgmc-on-windows-7
EDIT: Google Search:- https://www.google.co.uk/search?q=clEnqueueFillBuffer+%22opencl.dll%22
Katie Boundary
1st February 2024, 20:19
Okay, I figured out what's going on. Sandy Bridges just don't support OpenCL. My desktop can run KNLmeansCL mecause it has a discrete graphics card, and my previous laptop could do it because it had a Broadwell or Haswell chip.
tormento
5th February 2024, 07:34
That's a pity that the development of this plugin stopped.
Selur
5th February 2024, 15:05
That's a pity that the development of this plugin stopped.
I totall agree. :)
ChaosKing
6th February 2024, 23:55
Btw there is a faster drop in replacement for KNLMeansCL but written for cuda, only for vapoursynth https://github.com/AmusementClub/vs-nlm-cuda
tormento
7th February 2024, 17:24
Btw there is a faster drop in replacement for KNLMeansCL but written for cuda, only for vapoursynth
DGDenoise from DGToolsNV is actually a NLMeans denoiser.
tebasuna51
11th February 2024, 09:50
DGDenoise from DGToolsNV is actually a NLMeans denoiser.
Posts after that moved to new thread CUDASynth filters (DGdecode, DGdenoise, DGHDRtoSDR) (https://forum.doom9.org/showthread.php?t=185300)
ReinerSchweinlin
12th February 2024, 16:52
"Invalid Thread specified....."
ReinerSchweinlin
13th February 2024, 14:35
thank you :)
tormento
18th July 2024, 10:22
@pinterf
Have a look here (https://forum.doom9.org/showthread.php?p=2004419#post2004419).
Thank you.
anton_foy
20th July 2024, 09:01
Btw there is a faster drop in replacement for KNLMeansCL but written for cuda, only for vapoursynth https://github.com/AmusementClub/vs-nlm-cuda
Any possibility to rewrite this for Avs+?
ChaosKing
20th July 2024, 22:21
You have to ask the author of the plugin :-)
kedautinh12
21st July 2024, 01:31
You have to ask the author of the plugin :-)
WolframRhodium said "no more avisynth ported" :D
anton_foy
22nd July 2024, 01:34
WolframRhodium said "no more avisynth ported" :D
Too bad, it is really fast and has so much better temporal stability compared to knlmeansCL.
tormento
22nd July 2024, 09:18
Too bad, it is really fast and has so much better temporal stability compared to knlmeansCL.
You tried newer DGDenoise?
anton_foy
22nd July 2024, 09:40
You tried newer DGDenoise?
Yes and I get smearing/ghosting-like artifacts from the temporal setting even on low values.
tormento
22nd July 2024, 10:08
Yes and I get smearing/ghosting-like artifacts from the temporal setting even on low values.
Tried to disable chroma? Anyway report the issue to the writer of the plugin.
WolframRhodium
22nd July 2024, 11:28
Too bad, it is really fast and has so much better temporal stability compared to knlmeansCL.
The output of nlm-cuda should be closed to KNLMeansCL and should not result in an increase in image quality.
anton_foy
23rd July 2024, 00:29
The output of nlm-cuda should be closed to KNLMeansCL and should not result in an increase in image quality.
My mistake, yes they seem to give identical results yet only the first 4 frames seems to differ from eachother even when both using the same settings. But that doesn't bother me. Great plugin :thanks:
@Tormento
Is the author here on Doom9 still? I cannot access his own forum.
tormento
23rd July 2024, 09:02
Is the author here on Doom9 still? I cannot access his own forum.
I think he is lurking but not officially here.
You can’t access or you can’t register?
In the second case, perhaps some users here and on his forum can ask him to create you an account.
He is very capable but also a bit weird.
JamesJohnston
13th August 2024, 01:25
I reported this issue on GitHub, but I'm not sure if anyone's monitoring that, so posting it here as well. More details in the GitHub issue: https://github.com/pinterf/KNLMeansCL/issues/6
In short, if the image width is a multiple of 64, KNLMeansCL outputs garbage - as seen in this test case:
plugin_dir = "C:\VideoProject\Software\AviSynth-plugin\"
LoadPlugin(plugin_dir + "KNLMeansCL.dll")
function test(int width) {
input = ColorBars(width=width, height=480, pixel_type="YV24").Trim(0, 50).Subtitle(String(width), size=36).FadeOut(50).ConvertToY8()
output = input.KNLMeansCL(ocl_x=8, ocl_y=16, ocl_r=1)
StackVertical(input, output)
}
StackHorizontal( \
test(8*1), test(8*2), test(8*3), test(8*4), test(8*5), test(8*6), test(8*7), test(8*8), \
test(8*9), test(8*10), test(8*11), test(8*12), test(8*13), test(8*14), test(8*15), test(8*16), \
test(8*17), test(8*18), test(8*19), test(8*20), test(8*21), test(8*22), test(8*23), test(8*24), \
test(8*25), test(8*26), test(8*27), test(8*28), test(8*29), test(8*30), test(8*31), test(8*32), \
test(8*33), test(8*34), test(8*35), test(8*36), test(8*37), test(8*38), test(8*39), test(8*40), \
test(8*41), test(8*42), test(8*43), test(8*44), test(8*45), test(8*46), test(8*47), test(8*48) \
)
I posted an example of an output frame in the GitHub issue. But what happens is the bottom row (filter output) is missing outputs (they are all black) whenever width is a multiple of 64.
In real-world videos, I've seen where the filter output gets stuck at a specific frame, and doesn't change when I move the AvsPmod slider bar to other frames. Other times, it will show partial or total garbage pixels, as if it was displaying uninitialized memory.
In practice, I'm trying to crop a standard definition 720x480 video down by a multiple of 16, which is coming out with a width of 704. That seems like it would be a fairly common scenario...? but that's a multiple of 64, so the rendered output comes out as garbage.
real.finder
30th November 2024, 06:00
with intel igpu in 13th gen
ColorBars(width=640, height=480, pixel_type="yv12")
KNLMeansCL()
https://i.postimg.cc/02HPRr4f/Untitled.png (https://postimages.org/)
it's intel problem or KNLMeansCL?
tormento
30th November 2024, 10:32
it's intel problem or KNLMeansCL?
OpenCL should be GPU agnostic.
You tried with other GPUs as well?
real.finder
30th November 2024, 16:40
OpenCL should be GPU agnostic.
You tried with other GPUs as well?
there are problems with KNLMeansCL and amd gpu already, only nvidia seems work fine with KNLMeansCL
I think CPU is the only standard (Especially X86-X64 since in apple m1-m4 is kind of different from another arm from what I've heard, I know someone use x86 port of his program to make it work in m1-m4), so maybe it's good idea to make cpu port of KNLMeansCL (opencl in cpu is dropped in modren cpus) edit: there are https://forum.doom9.org/showthread.php?t=172966 already but not as KNLMeansCL, xNLMeans maybe got things that not in KNLMeansCL but there are also things in KNLMeansCL that not in xNLMeans, so maybe someone update xNLMeans to make it ultimate NLMeans :)
qyot27
30th November 2024, 17:37
with intel igpu in 13th gen
ColorBars(width=640, height=480, pixel_type="yv12")
KNLMeansCL()
https://i.postimg.cc/02HPRr4f/Untitled.png (https://postimages.org/)
it's intel problem or KNLMeansCL?
I can't reproduce that here with an Arc A770, Ubuntu 24.10.
tormento
30th November 2024, 23:21
it's good idea to make cpu port of KNLMeansCL
Or not. ;)
There are plugins that works really well under cpu, others really good on GPU. I think KNLMeansCL could be a real performance hit on a CPU.
Why don’t you simply use the CPU version of BM3D? I find it in many ways superior.
Z2697
1st December 2024, 04:46
CPU KNLM Choices:
1) CPU "port": https://github.com/AmusementClub/vs-nlm-ispc
2) CPU OpenCL runtime: https://www.intel.com/content/www/us/en/developer/articles/technical/intel-cpu-runtime-for-opencl-applications-with-sycl-support.html
Jamaika
1st December 2024, 15:00
there are problems with KNLMeansCL and amd gpu already, only nvidia seems work fine with KNLMeansCL
I think CPU is the only standard (Especially X86-X64 since in apple m1-m4 is kind of different from another arm from what I've heard, I know someone use x86 port of his program to make it work in m1-m4), so maybe it's good idea to make cpu port of KNLMeansCL (opencl in cpu is dropped in modren cpus) edit: there are https://forum.doom9.org/showthread.php?t=172966 already but not as KNLMeansCL, xNLMeans maybe got things that not in KNLMeansCL but there are also things in KNLMeansCL that not in xNLMeans, so maybe someone update xNLMeans to make it ultimate NLMeans :)
KNLMeansCL is old __AVISYNTH_8_H__ and openCL 1.2.
plugins/Khanattila/NLMAvisynth.cpp: In constructor 'NLMAvisynth::NLMAvisynth(PClip, int, int, int, double, const char*, int, double, PClip, const char*, int, int, int, int, bool, bool, int, IScriptEnvironment*)':
plugins/Khanattila/NLMAvisynth.cpp:215:38: warning: converting to non-pointer type 'cl_channel_type' {aka 'unsigned int'} from NULL [-Wconversion-null]
215 | cl_channel_type channel_type_u = NULL, channel_type_p = NULL;
| ^~~~
plugins/Khanattila/NLMAvisynth.cpp:215:61: warning: converting to non-pointer type 'cl_channel_type' {aka 'unsigned int'} from NULL [-Wconversion-null]
215 | cl_channel_type channel_type_u = NULL, channel_type_p = NULL;
| ^~~~
plugins/Khanattila/NLMAvisynth.cpp:216:42: warning: converting to non-pointer type 'cl_channel_type' {aka 'unsigned int'} from NULL [-Wconversion-null]
216 | cl_channel_type channel_type_p_out = NULL;
| ^~~~
ffplay_avx2.exe KNLMeansCL.avs =
ColorBars(width=640, height=480, pixel_type="yv12")
KNLMeansCL()
https://forum.doom9.org/showthread.php?p=2010721#post2010721
real.finder
1st December 2024, 16:25
I can't reproduce that here with an Arc A770, Ubuntu 24.10.
maybe windows driver bug? like this https://forum.doom9.org/showthread.php?p=1963373#post1963373
Or not. ;)
There are plugins that works really well under cpu, others really good on GPU. I think KNLMeansCL could be a real performance hit on a CPU.
Why don’t you simply use the CPU version of BM3D? I find it in many ways superior.
the cpu plugins of NLMeans in avs can't be used as drop-in replacement for KNLMeansCL
BM3D is another story
CPU KNLM Choices:
1) CPU "port": https://github.com/AmusementClub/vs-nlm-ispc
2) CPU OpenCL runtime: https://www.intel.com/content/www/us/en/developer/articles/technical/intel-cpu-runtime-for-opencl-applications-with-sycl-support.html
that for vs only?
anyway thanks for CPU OpenCL runtime link, I thought Intel no longer supported that
KNLMeansCL is old __AVISYNTH_8_H__ and openCL 1.2.
plugins/Khanattila/NLMAvisynth.cpp: In constructor 'NLMAvisynth::NLMAvisynth(PClip, int, int, int, double, const char*, int, double, PClip, const char*, int, int, int, int, bool, bool, int, IScriptEnvironment*)':
plugins/Khanattila/NLMAvisynth.cpp:215:38: warning: converting to non-pointer type 'cl_channel_type' {aka 'unsigned int'} from NULL [-Wconversion-null]
215 | cl_channel_type channel_type_u = NULL, channel_type_p = NULL;
| ^~~~
plugins/Khanattila/NLMAvisynth.cpp:215:61: warning: converting to non-pointer type 'cl_channel_type' {aka 'unsigned int'} from NULL [-Wconversion-null]
215 | cl_channel_type channel_type_u = NULL, channel_type_p = NULL;
| ^~~~
plugins/Khanattila/NLMAvisynth.cpp:216:42: warning: converting to non-pointer type 'cl_channel_type' {aka 'unsigned int'} from NULL [-Wconversion-null]
216 | cl_channel_type channel_type_p_out = NULL;
| ^~~~
ffplay_avx2.exe KNLMeansCL.avs =
ColorBars(width=640, height=480, pixel_type="yv12")
KNLMeansCL()
don't know, but avs should be backward compatible unless there are bugs in KNLMeansCL, anyway it still work with nvidia for me (in my home pc, the igpu bug using remote server)
Jamaika
1st December 2024, 17:22
You tried my version. Is it the same or not?
real.finder
3rd December 2024, 05:06
You tried my version. Is it the same or not?
where? your link is for ffmpeg
Jamaika
3rd December 2024, 09:56
I added it above. Yes, you run it via ffplay_avx2
https://www.sendspace.com/file/mou7uc
real.finder
4th December 2024, 03:49
I added it above. Yes, you run it via ffplay_avx2
https://www.sendspace.com/file/mou7uc
no need to do it in this case
anyway, it worked with
ColorBars(width=640, height=480, pixel_type="yv12")
KNLMeansCL(device_type="cpu")
after install w_opencl_runtime_p_2024.2.0.980.exe so it's gpu problem (maybe the driver)
Jamaika
4th December 2024, 08:16
I will just add that I have installed latest opencl.
https://github.com/KhronosGroup/OpenCL-Headers/commit/4ea6df132107e3b4b9407f903204b5522fdffcd6
real.finder
7th December 2024, 03:30
I will just add that I have installed latest opencl.
https://github.com/KhronosGroup/OpenCL-Headers/commit/4ea6df132107e3b4b9407f903204b5522fdffcd6
it's same as https://i.postimg.cc/02HPRr4f/Untitled.png
pinterf
7th December 2024, 11:34
with intel igpu in 13th gen
ColorBars(width=640, height=480, pixel_type="yv12")
KNLMeansCL()
it's intel problem or KNLMeansCL?
Reproduced.
device_id = 0 (Nvidia driver)
no problems, this setting is using NVidia 1660 on my machine.
device_id = 1: (Intel driver)
artifacts.
This id is using my Intel UHD 750 driver. It looks like if there were internal format or endian-ness problems (e.g. how a 32 bit data is ordered YUVX or XVUY)
Hint: with info=true you can display the actual driver config.
ColorBars(width=640, height=480, pixel_type="yv12")
KNLMeansCL(channels="auto", device_id=1, info=true)
My processor is 11th Gen Intel(R) Core(TM) i7-11700, but obviously, there must be a hidden driver setting which has to be checked to figure out that a pixel format which is good for one driver why is not good for the other.
Jamaika
7th December 2024, 12:33
Hint: with info=true you can display the actual driver config.
ColorBars(width=640, height=480, pixel_type="yv12")
KNLMeansCL(channels="auto", device_id=1, info=true)
My processor is 11th Gen Intel(R) Core(TM) i7-11700, but obviously, there must be a hidden driver setting which has to be checked to figure out that a pixel format which is good for one driver why is not good for the other.
ColorBars(width=640, height=480, pixel_type="yv12")
KNLMeansCL(channels="auto", device_id=1, info=true)
[avisynth @ 0000023e209d9f60] KNLMeansCL: no compatible opencl platforms available!
(AudioBoost.avs, line 2)
AudioBoost.avs: Unknown error occurred
ColorBars(width=640, height=480, pixel_type="yv12")
KNLMeansCL(channels="auto", device_id=0, info=true)
KNLMeansCL
Version 1.1.1e
Copyright(C) Khanattila
Bits per sample: 8
Search window: 5x5x3
Similarity neightborhood: 9x9
Num of ref pixels: 74
Local work size: 16x16 - 16x8x3
Platform info
Name: NVIDIA CUDA
Version: OpenCL 3.0 CUDA 12.6.65
Device info
Name: NVIDIA Geforce RTX 3050
Vendor: NVIDIA Corporation
Version: OpenCL 3.0 CUDA 560.94
It works.
real.finder
7th December 2024, 17:50
Hint: with info=true you can display the actual driver config.
https://i.imgur.com/1qIbUY7.png
pinterf
7th December 2024, 22:32
Same for me, except that I have 750. And the driver is a bit older, 32.0.101.6078.
Anyway, I narrowed down the problem, which is in one or more of the opencl program kernel functions which do the actual horizontal and vertical processing. Seems that next week(s) I'm going to entertain myself with the millions of trial and error modifications.
You have to wait a bit further, I will only appear when I'm ready.
real.finder
27th January 2025, 04:53
Same for me, except that I have 750. And the driver is a bit older, 32.0.101.6078.
Anyway, I narrowed down the problem, which is in one or more of the opencl program kernel functions which do the actual horizontal and vertical processing. Seems that next week(s) I'm going to entertain myself with the millions of trial and error modifications.
You have to wait a bit further, I will only appear when I'm ready.
no news since months, forgotten? :)
pinterf
27th January 2025, 06:37
no news since months, forgotten? :)
It's just not finalized. Most possibly a driver error, on the 4th crazy day and after the fifth possible workaround, I got it. I have almost finished and assembled a meaningful bug report (the smallest possible code which still presents the bug), then the holidays came then a huge pile of Avisynth and other plugin related stuffs. And I had to arrange and nicely commit the modifications I've done to KNL since 2020. So please wait a little bit more I hope not that much.
tormento
27th January 2025, 11:52
I find BM3D to be superior to KNLMeansCL almost in every aspect.
Is there any niche application where it could shine?
pinterf
7th March 2025, 10:00
Bug reported to Intel. At least I consider it a bug:
https://community.intel.com/t5/GPU-Compute-Software/Intel-OpenCL-on-UHD750-770-artifacts-at-specific-block-sizes/m-p/1673206#M1764
EDIT: Intel (or Intel's bot) almost instantly categorized my bug report as spam, causing it to disappear from the flow of posts. I mentioned this to the moderator... We'll see what happens. It's not easy to communicate with them.
There may be a possible workaround: manually specifying parameters ocl_x and ocl_y to 16.
Report back if it works.
tormento
7th March 2025, 15:02
Bug reported to Intel. At least I consider it a bug
The link you posted brings to:
The message you are trying to access is not available.
real.finder
7th March 2025, 19:55
Bug reported to Intel. At least I consider it a bug:
https://community.intel.com/t5/GPU-Compute-Software/Intel-OpenCL-on-UHD750-770-artifacts-at-specific-block-sizes/m-p/1673206#M1764
EDIT: Intel (or Intel's bot) almost instantly categorized my bug report as spam, causing it to disappear from the flow of posts. I mentioned this to the moderator... We'll see what happens. It's not easy to communicate with them.
There may be a possible workaround: manually specifying parameters ocl_x and ocl_y to 16.
Report back if it works.
KNLMeansCL(info=true, ocl_x=16, ocl_y = 16, ocl_r=16)
seems work, dont know if it act like KNLMeansCL(info=true) with other non bugged gpu drivers
pinterf
7th March 2025, 21:10
KNLMeansCL(info=true, ocl_x=16, ocl_y = 16, ocl_r=16)
seems work, dont know if it act like KNLMeansCL(info=true) with other non bugged gpu drivers
Probably, the 32x8 configuration was chosen for performance reasons on Intel GPUs (I'm not sure if this was based on tests or manufacturer recommendations). The 16x16 configuration should work as well. Anyway, a lot of time has passed since these values were established in the code, and the optimal setting may have changed since then.
Katie Boundary
16th April 2025, 23:26
Has anyone compiled a version of this that doesn't rely on external DLL bullshit? Visual C++ 2013 isn't installing on one of my computers for some stupid bullshit reason or another and I think that's screwing up a bunch of my filters.
UPDATE: I was able to find slightly older versions (12.0.30501) of Visual C++ 2013, and they installed correctly, but KNLmeansCL and two other filters are still whining about a missing DLL file.
Dynamic linking is one of the worst ideas in computing history.
Jamaika
17th April 2025, 05:31
I have a statically linked library using gcc/mingw.
https://github.com/FFmpeg/FFmpeg/commit/afe6c1238ac4119ec9c9dedc42220c4595f6a33c
https://github.com/AviSynth/AviSynthPlus/commit/2e34f5daba7f223e8172e28ed7900b0997749207
https://github.com/HomeOfAviSynthPlusEvolution/L-SMASH-Works/commit/b43f75fab4a6f7330e24855c9f7c9c971cd626d9
https://github.com/Khanattila/KNLMeansCL/commit/ca424fa91d1e16ec011f7db9c3ba0d1e76ed7850
https://github.com/KhronosGroup/OpenCL-ICD-Loader/commit/86448ce4e47bc59688c58e7542ebfa4d7568c0de
https://github.com/KhronosGroup/OpenCL-Headers/commit/bb1dc2e5882378817831ae17ba7391b3e23efa81
LibavSource2("input.avi",fpsnum=30000,fpsden=1001)
KNLMeansCL(device_type="gpu",device_id=0,info=true)
https://www.sendspace.com/file/k2xj7v
Edit:
I will only add that all add-ons should be for ffms2 and not ffmpeg. If we want to use ffmpeg, the library should be modified, e.g. for l-smash. There aren't modifications for the latest avisynth.c 3.7.4.
https://github.com/HomeOfAviSynthPlusEvolution/FFmpeg/commits?author=qyot27
Katie Boundary
17th April 2025, 06:36
I have a statically linked library using gcc/mingw.
https://github.com/FFmpeg/FFmpeg/commit/afe6c1238ac4119ec9c9dedc42220c4595f6a33c
https://github.com/AviSynth/AviSynthPlus/commit/2e34f5daba7f223e8172e28ed7900b0997749207
https://github.com/HomeOfAviSynthPlusEvolution/L-SMASH-Works/commit/b43f75fab4a6f7330e24855c9f7c9c971cd626d9
https://github.com/Khanattila/KNLMeansCL/commit/ca424fa91d1e16ec011f7db9c3ba0d1e76ed7850
https://github.com/KhronosGroup/OpenCL-ICD-Loader/commit/86448ce4e47bc59688c58e7542ebfa4d7568c0de
https://github.com/KhronosGroup/OpenCL-Headers/commit/bb1dc2e5882378817831ae17ba7391b3e23efa81
LibavSource2("input.avi",fpsnum=30000,fpsden=1001)
KNLMeansCL(device_type="gpu",device_id=0,info=true)
https://www.sendspace.com/file/k2xj7v
Okay... which of those 20 or 30 links is it?
EDIT: after a little bit of digging, it turns out that version 0.6.11 was compiled with Visual C++ 2013 instead of 2015, and therefore does not require UCRT. It was kept around for compatibility with older versions of OpenCL, but XP compatibility was an accidental side effect. I can use this for now.
Khanattila
20th June 2025, 13:51
Bug reported to Intel. At least I consider it a bug:
https://community.intel.com/t5/GPU-Compute-Software/Intel-OpenCL-on-UHD750-770-artifacts-at-specific-block-sizes/m-p/1673206#M1764
EDIT: Intel (or Intel's bot) almost instantly categorized my bug report as spam, causing it to disappear from the flow of posts. I mentioned this to the moderator... We'll see what happens. It's not easy to communicate with them.
There may be a possible workaround: manually specifying parameters ocl_x and ocl_y to 16.
Report back if it works.
Great job with the bug report.
Probably, the 32x8 configuration was chosen for performance reasons on Intel GPUs (I'm not sure if this was based on tests or manufacturer recommendations). The 16x16 configuration should work as well. Anyway, a lot of time has passed since these values were established in the code, and the optimal setting may have changed since then.
Testing, and a general understanding of how the Intel integrated GPU architecture was designed (memory alignment, cache size, compute units per group). Those values obviously depend on the architecture and are not optimal forever.
GeoffreyA
20th June 2025, 14:56
Not related, but I recently discovered a slight performance loss with KNLMeansCL on the Arc B580's recent drivers versus one from January.
https://github.com/IGCIT/Intel-GPU-Community-Issue-Tracker-IGCIT/issues/1134
takla
18th October 2025, 01:00
FFMPEG has merged a rewrite of nlmeans vulkan (https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20689), which offers increased processing speed.
Newest FFMPEG download (https://github.com/BtbN/FFmpeg-Builds/releases)
Usage example:
ffmpeg -y -benchmark -init_hw_device vulkan -i INPUT.mkv -vf "format=nv12,hwupload,nlmeans_vulkan,hwdownload,format=nv12" -c:v libx264 OUTPUT.mkv
On my system (Ryzen 7600X, RTX 5070 Ti) I get 39.2 FPS with 1920x1080 BluRay footage.
Edit: And 44.4 FPS with +300/+3000 core/memory overclock on the GPU.
GeoffreyA
18th October 2025, 08:51
FFMPEG has merged a rewrite of nlmeans vulkan (https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20689), which offers increased processing speed.
Newest FFMPEG download (https://github.com/BtbN/FFmpeg-Builds/releases)
Usage example:
ffmpeg -y -benchmark -init_hw_device vulkan -i INPUT.mkv -vf "format=nv12,hwupload,nlmeans_vulkan,hwdownload,format=nv12" -c:v libx264 OUTPUT.mkv
On my system (Ryzen 7600X, RTX 5070 Ti) I get 39.2 FPS with 1920x1080 BluRay footage.
Edit: And 44.4 FPS with +300/+3000 core/memory overclock on the GPU.
On the 4600G and B580, I get 12 fps on an old build, and 14 fps on the new one. Notably, though, is that the pervasive artefacts are gone.
tormento
18th October 2025, 10:12
Now we just need to wait (and hope) that someone will port that to AVS+.
takla
19th October 2025, 04:33
On the 4600G and B580, I get 12 fps on an old build, and 14 fps on the new one. Notably, though, is that the pervasive artefacts are gone.
Thats a 16.6% speedup, nice.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.