BOINC / boinc

Open-source software for volunteer computing and grid computing.
https://boinc.berkeley.edu
GNU Lesser General Public License v3.0
2.03k stars 449 forks source link

"gpu-usage must be positive" for a CPU only app #5016

Open hucker75 opened 2 years ago

hucker75 commented 2 years ago

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.

AenBleidd commented 2 years ago

@hucker75, have you tried app_config.xml without milkyway_nbody app? I believe, the issue is not with it but with the milkyway configuration

davidpanderson commented 2 years ago

I couldn't repro this.

RichardHaselgrove commented 2 years ago

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 commented 2 years ago

@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 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).

hucker75 commented 2 years ago

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.

RichardHaselgrove commented 2 years ago

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.

hucker75 commented 2 years ago

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?

RichardHaselgrove commented 2 years ago

Looks like I've been down this rabbit-hole before: #4291