This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
wiki:managing_resources_cpu_gpu [2018/10/16 09:08] – [Managing GPUs] neyron | wiki:managing_resources_cpu_gpu [2020/03/03 14:10] (current) – [The oar_resource_add command] neyron | ||
---|---|---|---|
Line 2: | Line 2: | ||
====== Managing processing unit topologies ====== | ====== Managing processing unit topologies ====== | ||
- | OAR's resources tables provides several kinds of information: | + | The OAR database '' |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | They are called OAR resources | + | They are called OAR resources |
- | In database these 3 kinds of properties are all stored as columns of the table. A rows then gives the set of properties for one resource. | + | In database these 4 kinds of resource |
- | Given a hierarchy (chosen by the administrator for its cluster setup, for instance cluster/ | + | **Given a hierarchy** (chosen by the administrator for his cluster setup, for instance cluster/ |
| | ||
- | One rule must be kept in mind: any unique object in the resources hierarchy must have a unique id among its set of object. For example: | + | One rule must be kept in mind: **any unique object in the resources hierarchy must have a unique id among its set of object**. For example: |
* any of the cores (of any of the CPUs, of any of the hosts...) must have a unique id among the whole set of cores ; | * any of the cores (of any of the CPUs, of any of the hosts...) must have a unique id among the whole set of cores ; | ||
* any of the CPUs (of any of the nodes, of any of the clusters...) | * any of the CPUs (of any of the nodes, of any of the clusters...) | ||
* and so one of any resource. | * and so one of any resource. | ||
- | Then, when it comes to the hardware identifiers (cpusets, or see below for GPU devices id), the administrator must take a special attention so that a correct mapping is done between the logical hierarchy (e.g. id of the host, CPUs, cores, hyperthreads) and the hardware processing unit ids (cpuset value). Using a tool such as '' | + | Then, when it comes to the hardware identifiers (cpusets, or see below for GPU devices id), the administrator must take a special attention so that a **correct mapping** is done between the **logical hierarchy** (e.g. id of the host, CPUs, cores, hyperthreads) and the **hardware** processing unit **ids** (cpuset value). Using a tool such as '' |
- | The '' | + | The basic commands to work with resources are: |
+ | * The '' | ||
+ | * The '' | ||
+ | * The '' | ||
- | Two meta-command are provided to build the resource table (using underneath the '' | + | But two meta-command are provided to build the resource table (using underneath the '' |
* '' | * '' | ||
* '' | * '' | ||
Line 30: | Line 33: | ||
====== Managing GPUs ====== | ====== Managing GPUs ====== | ||
- | Support of Nvidia GPU devices was added to OAR and will ship with OAR 2.5.8 (already ship with RC versions, starting with 2.5.8 RC6). | + | Support of Nvidia GPU devices was added to OAR and ships with OAR 2.5.8. |
- | + | ||
- | Meanwhile, for those who cannot wait and since this only involves some configuration of the resources and using the latest version of the job resource manager script taken from git (the job resource manager is part of the configuration files of OAR, which the administrator can modify), one can // | + | |
- | + | ||
- | See: | + | |
- | * the latest job resource manager script: https:// | + | |
- | * some explanations about it: https:// | + | |
- | + | ||
- | Next releases of OAR may provide tools to help setup GPU resources, but for now, here are some explanations for the setup (for //advanced OAR admins// only). | + | |
+ | OAR provides tools to help setup GPU resources (see the '' | ||
In order to enable the mechanism, you have to: | In order to enable the mechanism, you have to: | ||
- | - use the last job resource manager (see above) | + | - use the latest version of the job resource manager (job_resource_manager_cgroup.pl shipped with the latest version of OAR, at least version 2.5.8) |
- enable the device cgroup mechanism in it ('' | - enable the device cgroup mechanism in it ('' | ||
- add a resource property for the gpu devices ('' | - add a resource property for the gpu devices ('' | ||
Line 66: | Line 62: | ||
Also, if some nodes do not have any GPU, you could set the value of the property for the corresponding resources to '' | Also, if some nodes do not have any GPU, you could set the value of the property for the corresponding resources to '' | ||
- | ===== Second scenario, | + | |
+ | But be **warned**, that the following commands will mostly not provide what a user would expect: | ||
+ | <code bash> | ||
+ | $ oarsub -l gpudevice=1 | ||
+ | </ | ||
+ | will gives all resources matching one identifier of gpudevices, which means all nodes limited to their first gpus ('' | ||
+ | |||
+ | <code bash> | ||
+ | $ oarsub -l gpudevice=N | ||
+ | </ | ||
+ | with N > 1 makes even less sense. See the setup proposed in the section below if you want to let your users request N gpus like that (using '' | ||
+ | |||
+ | **We strongly suggest to setup the second scenario below, which defines the '' | ||
+ | |||
+ | |||
+ | |||
+ | ===== Second scenario, | ||
Lets assume now that you have a cluster of 3 nodes with 32 GB of RAM and per node: | Lets assume now that you have a cluster of 3 nodes with 32 GB of RAM and per node: | ||
* 2 CPUs of 6 cores each | * 2 CPUs of 6 cores each | ||
Line 78: | Line 90: | ||
Lets translate that to technical words: | Lets translate that to technical words: | ||
- | * first we have to define the resources hierarchy levels: cluster, host, cpu, core, gpu | + | * first we have to define the resources hierarchy levels: cluster, host, cpu, gpu, core |
- | * then we have to define the gpu resource for the system mapping: gpudevice (i.e. the GPU equivalent of cpuset | + | * then we have to define the GPU resource for the system mapping: gpudevice (i.e. the GPU' |
* finally any additional resource property can be added, like mem for host memory, cpumodel for the CPU model, gpumodel, etc. | * finally any additional resource property can be added, like mem for host memory, cpumodel for the CPU model, gpumodel, etc. | ||
Line 164: | Line 176: | ||
When reserving 1 GPU, the user obviously gets the 3 cores associated to the GPUs. | When reserving 1 GPU, the user obviously gets the 3 cores associated to the GPUs. | ||
+ | |||
+ | Finally, GPU jobs can be tied to GPU resources (where '' | ||
+ | <code perl> | ||
+ | foreach my $mold (@{$ref_resource_list}){ | ||
+ | foreach my $r (@{$mold-> | ||
+ | my $gpu_request = 0; | ||
+ | foreach my $resource (@{$r-> | ||
+ | if ($resource-> | ||
+ | $gpu_request = 1; | ||
+ | } | ||
+ | } | ||
+ | if ($gpu_request) { | ||
+ | if ($r-> | ||
+ | $r-> | ||
+ | }else{ | ||
+ | $r-> | ||
+ | } | ||
+ | print(" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </ | ||
Warning: make sure to look at lstopo output in order to correctly associate cpuset and gpudevices, e.g. not associating cores and GPUs not attached to a same CPU. | Warning: make sure to look at lstopo output in order to correctly associate cpuset and gpudevices, e.g. not associating cores and GPUs not attached to a same CPU. | ||
- | ====== The oar_resource_add | + | Warning: mind the fact that with the defined hierarchy '' |
+ | <code bash> | ||
+ | $ oarsub -l host=1/core=8/gpu=2 | ||
+ | </ | ||
+ | In that case, you select 1 host, with 8 of its cores, and 2 GPUs of each cores. But since for each core, there is at most 1 gpu value, that makes no sense. | ||
- | In OAR 2.5.8 (starting from 2.5.8 RC6), the oar_resource_add command provides some support to create GPU resources in OAR as well as CPU-Core resources with relevant topologies. | + | Also, that: |
+ | <code bash> | ||
+ | $ oarsub -l host=1/ | ||
+ | </ | ||
+ | is equivalent to: | ||
+ | <code bash> | ||
+ | $ oarsub -l host=1/ | ||
+ | </ | ||
+ | The user will get 1 host with 8 cores of it. Nothing is said about what or how many GPUs will be available in the job. | ||
+ | ====== The oar_resource_add command ====== | ||
+ | The oar_resource_add command provides some support to create GPU resources in OAR as well as CPU-Core resources with relevant topologies. | ||