Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
21st October 2022, 21:41 | #2141 | Link |
Registered User
Join Date: Dec 2017
Posts: 90
|
Hello. I'm trying to develop a plugin and running into super strange stuff. My plugin is an import plugin that produces an RGB64 image. When I try to use ConvertToRGB48() on the output I get the error
"Device unmatch: ConvertToRGB48[CPU] does not support [CUDA] frame". I can assure you that my code does absolutely nothing CUDA-related. The same happens if I output RGB48 and try to convert to RGB64. This does not happen if I try to do this with a BlankClip. However if I just leave it at outputting RGB64 and open the script without any conversions in VirtualDub, it shows me the image just fine with no issues. Is this some new stuff? How do I fix this? I reckon the error might lie somewhere else and this might just be a symptom but I find this mystifying. Edit: With ffmpeg I get access violation. Must be some other issue I guess that's bleeding over. Edit 2: This actually happens even with an older version of the plugin: http://avisynth.nl/index.php/ImageSequence . If you take the 64 bit plugin and use it with the wildcard input filter for 2 jpeg files and then run ConvertToRGB48() after it, the same error happens, including the access violation in ffmpeg (but not in VirtualDub). I'm at a loss. Edit 3: On a sidenote, my PC doesn't even have CUDA. It's an AMD APU without a discrete GPU. Edit 4: Searching around on Google, I ignorantly (without knowing what it even does) tried adding onCPU(1) after the input plugin. Made no difference. Then I tried onCUDA(1) and it said "This AviSynth does not support memory type 2(CUDA)". This is, uh, really strange? Edit 5: Ok it might have been an access violation that somehow went under the radar for years and nobody noticed. I fixed that, however I downgraded to a lower AVISynth version, so not sure if I'll get to test if it also solved the CUDA thing error. Edit 6: Ok this problem was completely unrelated to the Access Violation problem. Bottom line is, every version above 3.7.0 (I tested from newest backwards) has this problem with the CUDA stuff. Last edited by TomArrow; 22nd October 2022 at 04:02. |
23rd October 2022, 22:37 | #2142 | Link | |
Registered User
Join Date: Oct 2018
Location: Germany
Posts: 999
|
Quote:
https://gitlab.com/uvz/AviSynthPlus-Builds Since r3820 there are no more problems so far. Nice!
__________________
Live and let live |
|
26th October 2022, 03:31 | #2143 | Link |
Registered User
Join Date: Dec 2002
Location: Region 0
Posts: 1,436
|
Is prefetch supposed to slow down sources?
A script consisting of only a source DGSource("HZLIP.dgi") I get 550fps per AVSmeter without a prefetch or with a prefetch of 1. With a prefetch of 2 or more it drops to ~60fps. I'm sure you're wondering why I'm using prefetch with just a source. I'm not normally, but I'm trying to figure out if my script was source limited and saw this behavior. |
26th October 2022, 12:48 | #2144 | Link |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
|
Some plugins have their own multithreading that works internally and I'm pretty sure DGSource() is one of them.
For those who have their own multithreading and/or threadpool, Prefetch() will do nothing but harm. To be absolutely fair, I'm not a big fan of Prefetch as I believe plugins should be multithreading and create their own thread-pool in the best and most efficient way, without relying on Avisynth trying to be smart. Things used to be much worse back in the days (I'm talking about AVS 2.5 MT) and that came back to bite me in one of my first jobs as encoder for a streaming company when I was hardsubbing stuff as some filters didn't really like the temporal discontinuity introduced by some of the MT Modes. Anyway, long story short, it's normal to get faster speeds without prefetch for some filters/plugins as it means that they create their own threadpool with their own multithreading (and rightly so). |
26th October 2022, 16:06 | #2145 | Link | |
Registered User
Join Date: Dec 2002
Location: Region 0
Posts: 1,436
|
Quote:
|
|
26th October 2022, 16:14 | #2146 | Link | |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
|
Quote:
Try with: Code:
DGSource() Spline64ResizeMT() ###Use whatever parameters you like### from plugins_JPSDR.dll I know for sure that his plugins have their own multithreading and create their own threadpool, so you should see better results without Prefetch() compared to with Prefetch, thus confirming my hypothesis. p.s if you don't get better results without Prefetch, then I'll join you in the |
|
26th October 2022, 16:24 | #2147 | Link |
Pig on the wing
Join Date: Mar 2002
Location: Finland
Posts: 5,733
|
My guess is that using Prefetch clogs up the lane between the CPU and the GPU in a single line DGSource's case. Have you checked what the GPU usage shows in Task Manager for the AVSMeter process? I've noticed that when launching an encode, it jumps very high at the beginning and then gradually slows down as the encoder does not request frames so fast (because my script has denoising, resizing etc. in it). In my case it's like 3-4% at maximum during the encode phase.
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... |
26th October 2022, 16:42 | #2149 | Link |
Registered User
Join Date: Jul 2018
Posts: 1,070
|
It may be a bug or issue with internal MT:
I sometime have lost of MT (single thread running) with adding Code:
myclip=some_filter() return myclip Prefetch(N) Code:
some_filter() Prefetch(N) It is typically not a great issue because I use return as debug/tuning preview and production script is running without return at the end. But some finding. Last edited by DTL; 26th October 2022 at 16:47. |
26th October 2022, 23:49 | #2151 | Link |
German doom9/Gleitz SuMo
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,781
|
Another variation: If you don't explicitly use any return statement, then the last statement of a script is the implicit "return last" statement. All you have to do is assigning your active clip variable to the implicit "last" clip variable. You can do that with an explicit assignment using the equal sign, or implicitly by just mentioning the clip variable in a single line.
Code:
myclip = some_filter() myclip # means the same as: # last = myclip Prefetch(N) # means the same as: # last = last.Prefetch(N) # implicit last statement: # return last |
27th October 2022, 09:33 | #2152 | Link |
Registered User
Join Date: Jul 2018
Posts: 1,070
|
"the last statement of a script is the implicit "return last" statement."
If add Code:
return last Prefetch(N) Prefetch(N) before return - Code:
Prefetch(N) return last Found in the documentation: http://avisynth.nl/index.php/SetFilterMTMode Enabling MT 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. If there is a return statement in your script it must be placed after Prefetch(). So to return something from middle of script with MT: Code:
myclip = some_filter() myclip=Prefetch(myclip, N) return myclip Last edited by DTL; 27th October 2022 at 09:38. |
28th October 2022, 05:32 | #2153 | Link | |
German doom9/Gleitz SuMo
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,781
|
You really misunderstood.
"Implicit" statements are those you do not write in the script but they are in fact executed because you did not write them. Quote:
Only if. Last edited by LigH; 28th October 2022 at 05:35. |
|
28th October 2022, 13:27 | #2154 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
Quote:
In practice, that is usually what happens, but there are some cases when 'last' is not returned, such as when the final expression is not a clip. See here.) |
|
31st October 2022, 02:21 | #2157 | Link |
Registered User
Join Date: Dec 2017
Posts: 90
|
Any clues on the "Device unmatch: ConvertToRGB48[CPU] does not support [CUDA] frame" problem?
Way to reproduce: 1. Get newest AVISynth+ release. 2. Grab CoronaSequence plugin from http://avisynth.nl/index.php/ImageSequence 3. Load image sequence with CoronaSequence command. 4. Add ConvertToRGB64() at the end. |
1st November 2022, 13:01 | #2158 | Link |
Big Bit Savings Now !
Join Date: Feb 2007
Location: close to the wall
Posts: 1,545
|
If I only had enough time I would skim AviSynth source code for that error
"Device unmatch: ConvertToRGB48[CPU] does not support [CUDA] frame"
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain) "Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..." Last edited by Emulgator; 1st November 2022 at 13:05. |
1st November 2022, 16:06 | #2159 | Link |
Banana User
Join Date: Sep 2008
Posts: 989
|
No error on my side.
__________________
InpaintDelogo, DoomDelogo, JerkyWEB Fixer, Standalone Faster-Whisper - AI subtitling |
1st November 2022, 16:46 | #2160 | Link | |
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,666
|
Quote:
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|