Add mount devices to API. (#69)

* add room devices to API.

* devicese one 1:1 mapping.

* add devices to gui.

* get used devices.

* rename gpu support to nvidia gpu.
This commit is contained in:
Miroslav Šedivý
2023-04-15 14:04:23 +02:00
committed by GitHub
parent 283ba9b71f
commit 9f46df0022
7 changed files with 72 additions and 1 deletions
+6
View File
@@ -375,6 +375,12 @@ export interface RoomResources {
* @memberof RoomResources
*/
'gpus'?: Array<string>;
/**
*
* @type {Array<string>}
* @memberof RoomResources
*/
'devices'?: Array<string>;
}
/**
*
+1
View File
@@ -174,6 +174,7 @@
<tr><th> CPU Shares </th><td :title="settings.resources.cpu_shares"><span v-if="settings.resources.cpu_shares">{{ settings.resources.cpu_shares }}</span><i v-else>--undefined--</i></td></tr>
<tr><th> Shared memory </th><td :title="settings.resources.shm_size">{{ settings.resources.shm_size | memory }}</td></tr>
<tr><th> GPUs </th><td><span v-if="settings.resources.gpus && settings.resources.gpus.length > 0">{{ settings.resources.gpus.join(",") }}</span><i v-else>--not used--</i></td></tr>
<tr><th> Devices </th><td><span v-if="settings.resources.devices && settings.resources.devices.length > 0">{{ settings.resources.devices.join(",") }}</span><i v-else>--none--</i></td></tr>
</tbody>
</template>
</v-simple-table>
+33 -1
View File
@@ -351,6 +351,7 @@
:max="20*1e9"
:step="0.2*1e9"
color="blue"
hide-details
>
<template v-slot:thumb-label="{ value }">
<span v-if="value">{{ value | memory }}</span>
@@ -361,9 +362,40 @@
<v-col>
<v-checkbox
@change="$set(data.resources, 'gpus', $event ? ['all'] : [])"
label="Enable GPU support"
label="Enable Nvidia GPU support"
hide-details
class="shrink ml-2 mt-0"
></v-checkbox>
<div style="margin-left: 41px;"><i>Nvidia docker runtime is required.</i></div>
</v-col>
</v-row>
<v-row align="center">
<v-col class="pt-0">
<v-combobox class="pt-0"
label="Devices"
v-model="data.resources.devices"
:items="[ '/dev/dri/renderD128' ]"
multiple
>
<template v-slot:selection="{ attrs, item, parent, selected }">
<v-chip
v-bind="attrs"
:input-value="selected"
label
small
>
<span class="pr-2">
{{ item }}
</span>
<v-icon
small
@click="parent.selectItem(item)"
>
$delete
</v-icon>
</v-chip>
</template>
</v-combobox>
</v-col>
</v-row>
</template>
+1
View File
@@ -75,6 +75,7 @@ export const state = {
memory: 0,
// eslint-disable-next-line
shm_size: 2000000000,
devices: [],
},
} as RoomSettings,
videoCodecs: [