boinc
boinc copied to clipboard
"gpu-usage must be positive" for a CPU only app
I have this app config for the Milkyway project:
<app_config>
<app>
<name>milkyway</name>
<max_concurrent>0</max_concurrent>
<gpu_versions>
<gpu_usage>0.250000</gpu_usage>
<cpu_usage>0.010000</cpu_usage>
</gpu_versions>
<fraction_done_exact>1</fraction_done_exact>
<report_results_immediately>0</report_results_immediately>
</app>
<app>
<name>milkyway_nbody</name>
<fraction_done_exact>1</fraction_done_exact>
</app>
<project_max_concurrent>0</project_max_concurrent>
<report_results_immediately>0</report_results_immediately>
</app_config>
As you can see, the app milkyway_nbody, which is a CPU only task, has simply been told to use fraction_done_exact.
Yet in the Boinc messages, I get "gpu_usage must be positive in app_config.xml"
I can't put gpu_usage in the app section, and even if I could, it's a CPU only task, and a positive GPU usage would be nonsensical.
@hucker75, have you tried app_config.xml without milkyway_nbody app?
I believe, the issue is not with it but with the milkyway configuration
I couldn't repro this.
I have a machine which reports, to this day,
15/11/2022 07:34:23 | climateprediction.net | Found app_config.xml
15/11/2022 07:34:23 | climateprediction.net | gpu_usage must be positive in app_config.xml
15/11/2022 07:34:23 | climateprediction.net | Your app_config.xml file refers to an unknown application 'dummy_app_name'. Known applications: None
The file in question, in full, reads
<app_config>
<app>
<name>dummy_app_name</name>
<max_concurrent>0</max_concurrent>
<gpu_versions>
<gpu_usage>0.000000</gpu_usage>
<cpu_usage>0.000000</cpu_usage>
</gpu_versions>
<fraction_done_exact>0</fraction_done_exact>
<report_results_immediately>0</report_results_immediately>
</app>
<project_max_concurrent>0</project_max_concurrent>
<report_results_immediately>0</report_results_immediately>
</app_config>
It was generated on 30 March 2021 while testing a new feature in BoincTasks to create and edit app_config files remotely, analogous to the way in which BOINC Manager can cause an updated cc_config.xml file to be written following an Event Log options update.
It appears that when the BOINC client writes the new file in response to the RPC from BoincTasks, it unconditionally includes every XML element, even when not needed.
I'm guessing that this was a new feature introduced somewhere during the v7.16.x development process, although it doesn't appear in the release notes.
@hucker75, have you tried app_config.xml without
milkyway_nbodyapp? I believe, the issue is not with it but with themilkywayconfiguration
I removed the nbody section and the error went away, so it's definitely the nbody app. This is not a GPU app.
Boinctasks or the Boinc Client edits it to:
<app>
<name>milkyway_nbody</name>
<max_concurrent>0</max_concurrent>
<gpu_versions>
<gpu_usage>0.000000</gpu_usage>
<cpu_usage>0.000000</cpu_usage>
</gpu_versions>
<fraction_done_exact>1</fraction_done_exact>
<report_results_immediately>0</report_results_immediately>
</app>
Which causes the complaint. But if I change gpu_usage to 0.1, it's ok.
So I agree with Richard. something is adding a 0 gpu usage in a non-gpu app, which it then doesn't like. Either it needs to not add it, or not care about 0 usage (which is perfectly feasible as some apps don't use a GPU).
I couldn't repro this.
Did you save the file yourself? I'm doing it via Boinctasks, which as Richard suggests causes inclusion of extra XML elements.
I think I've found a commit where this functionality was introduced:
client/lib: add GUI RPCs for reading and writing app_config.xml files. These will allow GUIs (e.g. BoincTasks) to provide dialogs for editing app config info.
commit 5b6f648570cdef551b77bbabf3e69243dac69de4
May 12, 2017, client_release/7/7.10.2
I think that was before we started using the full Issue / PR reviewing system, but some later tweaks were added by #4275.
That doesn't seem to help Boinctasks. When I try to edit a non-existant file, I just get told it doesn't exist, then I'm presented with a blank window and have to write it myself.
But I seem to remember it used to work (producing a nice blank template to edit), perhaps Boinctasks changed the way it works?
Looks like I've been down this rabbit-hole before: #4291
@AenBleidd @hucker75 @RichardHaselgrove This happened to me when I used
<app_config>
<app>
<name>beta30</name>
<max_concurrent>1</max_concurrent>
<gpu_versions>
<gpu_usage>0.000000</gpu_usage>
<cpu_usage>1.000000</cpu_usage>
</gpu_versions>
</app>
<project_max_concurrent>0</project_max_concurrent>
<report_results_immediately>0</report_results_immediately>
</app_config>
The problem is caused in app_config::parse_gpu_versions by the test for positive value of gpu usage. The test should be for non-negative value IMHO. The default value of gpu_gpu_usage is 0 which is non-negative anyway.

When the boinc client starts the default value of gpu_gpu_usage is 0 and stays 0 The test, when it runs, prevents the gpu_usage from being 0. If the default is 0 then what is the harm of letting it be 0?
The <gpu_usage> specifies the (possibly fractional) GPU usage for app versions that use a GPU. This by definition can't be zero.
Of course it can be zero if the graphics card isn't used. Zero is also the default boinc itself puts in if the line is omitted!
The <gpu_usage> specifies the (possibly fractional) GPU usage for app versions that use a GPU. This by definition can't be zero.
By definition all PCs use a CPU. It then follows that the CPU cannot be 0 and the test for non-negative CPU is coded incorrectly ;)