Running multiple copies of Boinc.

A place to discuss how to set up BOINC Manager and how to get the best results from your connected hardware
Post Reply
Woodles
UBT Contributor
Posts: 11757
Joined: Thu Dec 20, 2007 12:00 am
Location: Cambridgeshire

Running multiple copies of Boinc.

Post by Woodles »

There are some times when you would want to run multiple copies of the Boinc programme at the same time.

These include (but are not limited to):
Where projects limit the amount of work per host (useful for bunkering before a sprint)
Using hosts with multiple GPUs either of the same or different architectures.
Where projects produce work rarely and intermittently.
Running NCI projects.

Where projects limit the amount of work you can download per core/GPU or host, it can sometimes be difficult to build up enough of cache to last more than a couple of hours.
Having multiple caches will extend this time. Note however, that Boinc has a hard limit of 1,000 tasks downloaded regardless of number of copies running or cache settings.

Most projects can't handle a mix of Nvidia and AMD GPUs in the same host. Having the Nvidia GPUs only available to one host and the AMD GPUs only available to a second makes the projects work easier (and you're less likely to have GPUs sitting idle)
In addition, some GPU projects run one task on all the GPUs available. This isn't always the most efficient way of using them so having one GPU per Boinc copy would be better.

Running intermittent projects alongside normal operating ones can result in the cache being full of 'normal' tasks when work becomes available on the intermittent project(s) This results in no work being requested and so the chance to download work is lost.
Having a separate copy of Boinc only requesting work from the intermittent project(s) will ensure that its cache is empty and it will always try to download work.

This is a little more contentious.
NCI projects by definition use very little CPU resources. These tasks are usually limited to a certain number per host. Multiple copies of Boinc will usually appear as multiple hosts and can run their own set of NCI projects. It's worth checking with the project manager that multiple hosts are allowed.

Note, some projects will not run in more than one copy of Boinc simultaneously.
GPUGrid combines all Boinc instances on a host into a single project host as does Sztaki. As soon as a second copy of Boinc requests work, the first set is marked as abandoned and cancelled.
WUProp doesn't count hours for more than one Boinc instance, other WUProp workunuts returned are ignored.
Some of the WCG projects fail with a shared memory allocation error.


Additional copies of Boinc can be run in a virtual machine or on the native hardware. Both approaches have advantages and disadvantages.
Virtual machine
Good - Will appear to the projects as a separate host to the one that it's running on and is more likely to be accepted.
Bad - Has to be created with an operating system, specified number of cores, amount of RAM, disc space and peripherals (GPUs) These resources are not available to the other copies of Boinc if not being used by the VM. Peripherals are sometimes difficult to assign to virtual machines and will run slower due to the extra processing required.

Second instance.
Good - Running on the base metal of the machine will share the resources. There is no need to specify number of cores or reserved amounts of RAM, they all come from the same 'pool'.
Bad - As noted above, it doesn't always work with all projects. Also, it's much easier to capture the current state of a virtual machine and restore it as opposed to multiple copies in the same host.


Virtual machines are a different topic, for now I'm going to concentrate on running multiple instances on Boinc on the same PC. for ease, I'm sticking to Windows operating systems.

Multiple instances
Create the base structure.
1. Navigate to an area of disc that you want to store the multiple clients.
2. Create a folder named MultiBoincs (any name will do, just change the future instructions as appropriate)
3. Navigate inside that folder.
4. Create another folder named BOINC. As previously, just a suggestion.
5. Navigate inside that folder.
6. Create an xml file using Notepad.exe.
7. Name it gui_rpc_auth.cfg.
The only thing inside the file should be an easy to remember password to use to connect to the clients using Boinc manager or BoincTasks should you wish. "boinc", "1" or your name are good choices.

Configure the instances.
8. Navigate to your normal BOINC data directory.
9. Copy your cc_config.xml file to the BOINC directory just created in step 4.
10. Copy your global_prefs.xml file to the BOINC directory just created in step 4.
11. copy your global_prefs_override.xml file (if it exists) to the BOINC directory just created in step 4.
This ensures that each instance will have the same configuration as your base setup.
12. If you're creating additional instances to run an existing project, copy the appropriate account file from your normal Boinc data directory to the BOINC directory just created. These files should be obvious, they start with "account_" and contain the internet name of the project. For example, the YAFU file is called account_yafu.myfirewall.org_yafu.xml If not, skip this step and see later.

Create the instances
Note. this will create an additional 100 instances. To vary the number, change the 199 in the following commands.
13. Open a command prompt.
14. Navigate to the MultiBoincs directory created in step 2.
15. Automatically create 100 directories called BOINC_100 to BOINC_199 inclusive.

Code: Select all

FOR /L %X IN (100,1,199) DO mkdir BOINC_%X
Hit return.
16. Automatically configure the 100 instances.

Code: Select all

FOR /L %X IN (100,1,199) DO copy BOINC\*.* BOINC_%X\*.*
Hit return.
17. This is the point where individual instances can be set up with different projects if required.
Repeat step 12 as needed, copying the appropriate account file into the appropriate instance directory.
For example, to configure instance 102 to run numberfields, copy the account_numberfields.asu.edu_NumberFields.xml file from your normal Boinc directory into the BOINC_102 directory.
New projects can be added later using either the command line, Boinc Manager or BoincTasks.

Start the instances
18. Automatically start the 100 instances.

Code: Select all

FOR /L %X IN (100,1,199) DO start "" /MIN "c:\Program Files\BOINC\boinc.exe" -allow_multiple_clients -dir BOINC_%X -gui_rpc_port 90%X
This assumes that your normal Boinc setup is installed in c:\Program Files\BOINC\, change as required.
Hit return.

Control the instances
Each of the previous will now be running but with no apparent window to access them.
To close all Boinc instances gracefully, open a command prompt and type

Code: Select all

TASKKILL /IM boinc.exe
To force close all Boinc instance not gracefully, open a command prompt and type

Code: Select all

TASKKILL /IM boinc.exe /F
Using boinccmd (https://boinc.berkeley.edu/wiki/Boinccmd_tool) from a command prompt, you can create an account, attach, start, stop, refresh or detach from a project.
19. To set all the clients to No New Work for BURP

Code: Select all

FOR /L %X IN (100,1,199) DO start "" "c:\Program Files\BOINC\boinccmd.exe" --host 127.0.0.1:50%X --passwd boinc --project http://burp.renderfarming.net/ nomorework
20. To set all the clients to Allow New Work for BURP

Code: Select all

FOR /L %X IN (100,1,199) DO start "" "c:\Program Files\BOINC\boinccmd.exe" --host 127.0.0.1:50%X --passwd boinc --project http://burp.renderfarming.net/ allowmorework
21. To force all instances to update BURP

Code: Select all

FOR /L %X IN (100,1,199) DO start "" "c:\Program Files\BOINC\boinccmd.exe" --host 127.0.0.1:50%X --passwd boinc --project http://burp.renderfarming.net/ update
--passwd is followed by the instance password set in step 7. The --project is the home page address of the project.

For those that prefer the original interface:
22. Open Boinc Manager
23. Click File, Select Computer
24. In the Host Name box, enter 127.0.0.1:90101 to connect to instance 101.
25. Enter the easy to remember password that you created in step 7.
26. Click OK
Boinc Manager will now be connected to the appropriate instance and you can control it as if it was the only instance running.
Change back be selecting localhost as the Host name.

It has been noted that 32 bit operating systems like XP will only run about 1000 instances reliably. Maybe it's the limited memory?
64 bit operating systems can run a LOT more instances.

Mark
UBT - Chris Suddick
Active UBT Contributor 15+ yrs
Posts: 698
Joined: Tue Mar 14, 2006 12:00 am
Location: Warrington, Cheshire

Re: Running multiple copies of Boinc.

Post by UBT - Chris Suddick »

Mark,

Can I ask a couple of questions about this procedure? I've got it working but not perfectly...

6. Create an xml file using Notepad.exe.
7. Name it gui_rpc_auth.cfg.

I've done this and put in a password for the alternate clients but when I look in the folder it is listed as

gui_rpc_auth.cfg ... Text Document

A second copy was copied over which was listed as

gui_rpc_auth.cfg ... xml file

The password is unrecognised when I try to connect to the client so I deleted the xml version and it is still unrecognised. I've now got a second client running which has done a few workunits for sztaki but my score is not going up and I don't think it is associated with my account and hence UBT.

So, to be clear, I select computer from the file menu, enter 127.0.0.1:90101 with the password but then I get an error saying the password is incorrect. Any ideas?

Chris.
Woodles
UBT Contributor
Posts: 11757
Joined: Thu Dec 20, 2007 12:00 am
Location: Cambridgeshire

Re: Running multiple copies of Boinc.

Post by Woodles »

Hi Chris,

Ask away :)

You have to be careful with Windows, it will automatically add ".txt" onto the end of any file created with notepad unless you tell it differently. I assume this is what's happened as it should be listed as "CFG file" if it's named correctly.

Open it in notepad and when it comes to save it, click on "File", "Save As" and select "All Files" in the "Save as type" drop down. You should be able to save it as "gui_rpc_auth.cfg" file then. Once it's saved correctly, shutdown and restart the new instance.

Back to your original Boinc Manager and yes, "File", "Select Computer", "127.0.0.1:90101" and the password. If the computer address is wrong then you'll end up disconnected.

The "account_szdg.lpds.sztaki.hu_szdg.xml" file contains your CPID so if you copied that over (which it looks like you did or you wouldn't be connected to Sztaki) then the work will be going to your account and hence to UBT. If you check the output when the second client starts up it should say something along the lines of Running under account "Chris" near the beginning.

You have two hosts attached to Sztaki at the moment.

Mark
UBT - Chris Suddick
Active UBT Contributor 15+ yrs
Posts: 698
Joined: Tue Mar 14, 2006 12:00 am
Location: Warrington, Cheshire

Re: Running multiple copies of Boinc.

Post by UBT - Chris Suddick »

Mark,

Bloody brilliant! It was, indeed, the hidden .txt that was causing the problem.

Many thanks for that.

Chris.
Woodles
UBT Contributor
Posts: 11757
Joined: Thu Dec 20, 2007 12:00 am
Location: Cambridgeshire

Re: Running multiple copies of Boinc.

Post by Woodles »

Hi Chris,

No problem, glad you got it sorted, we can do with all the Sztaki tasks you can do! :)

That's why I automatically set my Windows systems to not hide extensions and display hidden files. Much easier to navigate then.

Mark
scole of TSBT
The Scottish BOINC Team member
Posts: 46
Joined: Wed Dec 07, 2011 12:00 am

Re: Running multiple copies of Boinc.

Post by scole of TSBT »

Yoyo doesn't allow multiple clients either. It behaves like GPUGrid and abandons WUs on other clients.
damienh
UBT Contributor
Posts: 1685
Joined: Mon Aug 26, 2019 2:16 pm

Re: Running multiple copies of Boinc.

Post by damienh »

Just adding to this: if using BOINC Manager to talk to your 'orginal' boinc.exe process, that's

Code: Select all

127.0.0.1:31416
You may need to enter a password, if you have one set.
Post Reply