/allowmultiple broken in 45beta26

I use the following BAT file to start two instances of vvvv:

start vvvv.exe /allowmultiple
process.exe -a vvvv.exe 0011
start vvvv2.exe /allowmultiple
process.exe -a vvvv2.exe 1100

The second instance (vvvv2.exe, a copy of vvvv.exe) always results in an error. I tried waiting to start the second until the first was fully initialized, but no joy. Error message attached.

This happens on Win7 x64 and XP. 25.1 works fine.

Apparently uploading an image STILL does not work here (doesn’t show in preview), so attaching a zip of it. (Love it when the bug reporting process is buggy… :^P)

vvvv2-crash.zip (140.6 kB)

there’s a hidden file called vvvv.exe.config
you need to rename that one too -> vvvv2.exe.config

hei mediadog,

the idea with the /allowmultiple switch was that you don’t have to rename vvvv.exe. just run the following from a commandline:

vvvv.exe
vvvv.exe /allowmultiple
vvvv.exe /allowmultiple

to get 3 instances running.

@joreg: In order to run each instance on different cores (why I’m running more than one vvvv), the images have to have different names as input into process.exe.

@Elias: Yes! That works. Thanks! I would tack this info onto the multiple vvvv thread, but it’s closed.

So, with 45beta26 (and later one would assume) to run two instances and set their processor affinity, you need to:

  1. Copy vvvv.exe to vvvv2.exe

  2. Copy vvvv.exe.config to vvvv2.exe.config

  3. Get the program process.exe and put it in the vvvv folder

  4. Create a .bat file in the vvvv folder that contains:

    start vvvv.exe /allowmultiple
    process.exe -a vvvv.exe 0011 <- bitmap of cores to use
    start vvvv2.exe /allowmultiple
    process.exe -a vvvv2.exe 1100 <- bitmap of cores to use

You’ll need to set the bitmap according to the number of cores you have. For a dual-core CPU, use “01” and “10”. For a hyperthreading CPU, I would assume you would double the number of cores, but I can’t test that. So a HT quad-core would become “00001111” and “11110000”.

All that being said, I think that vvvv just uses one core, but DirectX will use another (or maybe two depending on video) so setting a lot of cores may not be a big benefit. But more instances could be run and set on other cores.

are you aware of SetProcessAffinityMask (Windows)?

Apparently not!

So you can start several vvvv.exe processes and then set the processor affinity in the patch using the Processes (Windows) and SetProcessAffinityMask (Windows) nodes, yes?

But doesn’t that require sorting the output of the Processes node to get the process ID? How do you tell apart the different instances of vvvv.exe? Is there a node that returns the running process ID? (As an aside, the help patch for Processes is missing.)

I guess you could have one master patch iterate through all process instances and setting the vvvv.exe masks in order. Am I on the right track?

Thanks joreg!

ouright, now you hit it. there is definitely a node missing that returns the instances process ID as sorting with multiple ‘vvvv.exe’ won’t help you identify specific instances. this could probably be a one-liner for a plugin? and i suggest the node should be called PID (VVVV).

quickly wrote this one liner :)

A plugin node which returns the current process ID. (2.1 kB)

Coolness - thanks folks.

Here’s a little patch I did just fooling around in the meanwhile.

vvvvProcAffinity.v4p (6.3 kB)

Hi
I can t find any info about what the bitmask values mean:

examples:

  • 2 processors:
    a process is supposed to run on processor 2:
    AffinityMask = 2
    a process is supposed to run on both processors:
    AffinityMask = 3

  • 4 processors:
    a process is supposed to run on processor 3:
    AffinityMask = 4

I am using an i7 (4 physical + 4 in HT), I d like to launch 2 instances of vvvv which I do with the /allowmultiple option, and each instance should of course run a different processor

*the SetProcessAffinityMask (Windows) node should be placed on each vvvv root patch or can I just use one instance of the node and use spreads to set the bitmask ?

*can I combine the /allowmultiple and the /dda options?

*it says AffinityMask = 3 makes vvvv run on 2 processor ? Is that right?

tx

S>

indeed the explanation could be better. lemmi try:

the Affinity Mask value can be computed like this:

bit 1: processor 1
bit 2: processor 2
bit 3: processor 3
bit 4: processor 4

if you want a process to run on processors 3 and 4 you set bits 3 and 4 and get a bitmask like:
1100
which can be translated to a binary value of 12.

a value of 3 would mean:
0011
and would let the process run on processors 1 and 2.

you can specify the affinity mask of multiple processes at once with one node using spreading or use one node in each instance. should not make a difference.

fcourse.

i’ve been pointed at 2 errors in my above explanation. now corrected. the bitmask is to be read from right to left (i.e. bit 1 is the rightmost, bit 4 the leftmost)

Dont mean to dig up an old thread, but can anyone explain how to get elias’s currentID patch to show? Ive extracted it into the nodes folder, but i dont see “PID” listed in the node browser.

yeah this is really frustrating, that node wont show unless i right click on a dual tabbed help window to enter the mysterious ROOT file which wont open if i click directly on it, and even though the node files are in one of the default node directories it wont load. It only works if i add it specifically.

windowprocess node doesnt return the processid so the one time i got this one to work it returned the correct one. Oddly enough the setprocessaffinity seems to work without it, probably because it guesses at a list of default id’s and throws a bunch of errors for the wrong ones.

Im just starting with this program and i dont know if theres any point in continuing if i’ll constantly have to be fighting built-in bugs.

hey poof,

you don’t put anything in \lib\nodes nor in \addonpack\lib\nodes
you leave those completely untouched and make yourself a directory where you put all additional nodes you download. for details, please check: nodes and paths

Is there any benefit in asking one vvvv.exe process to run on more than one core?

yes. while vvvv itself is not multithreaded, some plugins may be and especially all directshow related stuff is and can thus make use of multiple cores.

so any multithreaded plugins run by a particular instance of vvvv will be restricted to the cores associated using SetProcessAffinityMask (Windows) ?

Didn’t realise the built in directshow stuff was multithreaded. Thought that was the reason Elliot’s opencv video in was ‘faster’ ?

Cheers J

Also, is it possible to set any kind of visual indicator to which vvvv instance a particular patch is running in?

Like setting the window colour with the Kalle node of all instance windows, automatically, or a character in the window’s title bar?

yes.

no.