feat: add hardware transcoding support to talk-recording container

Agent-Logs-Url: https://github.com/nextcloud/all-in-one/sessions/eaea217b-2995-4e47-a4ec-f7be19f98a18

Auto-detect /dev/dri in start.sh and export NEXTCLOUD_ENABLE_DRI_DEVICE automatically

Agent-Logs-Url: https://github.com/nextcloud/all-in-one/sessions/751d0b0c-e529-4ea6-a316-5a53169a9ab6

fix: address code review feedback (nvidia check, file_exists, group_add comment)

Agent-Logs-Url: https://github.com/nextcloud/all-in-one/sessions/eaea217b-2995-4e47-a4ec-f7be19f98a18

Use --device=/dev/dri instead of -v bind-mount in docs and compose

Agent-Logs-Url: https://github.com/nextcloud/all-in-one/sessions/4fa5e70a-b786-445e-946f-a0610751d855
Co-Authored-By: szaimen <42591237+szaimen@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-16 14:48:19 +00:00
committed by Simon L.
parent c9182aea4e
commit 1da363ea8c
8 changed files with 74 additions and 10 deletions

View File

@@ -311,17 +311,31 @@ readonly class DockerActionManager {
}
$devices = [];
$groupAdd = [];
foreach ($container->devices as $device) {
if ($device === '/dev/dri' && !$this->configurationManager->nextcloudEnableDriDevice) {
continue;
}
$devices[] = ["PathOnHost" => $device, "PathInContainer" => $device, "CgroupPermissions" => "rwm"];
if ($device === '/dev/dri') {
// Add the render device's group as a supplemental group so that non-root
// containers (e.g. nextcloud-aio-talk-recording) can access the device.
// The GID is detected during mastercontainer startup when /dev/dri is bind-mounted.
$gid = $this->configurationManager->driDeviceGid;
if ($gid !== '' && !in_array($gid, $groupAdd, true)) {
$groupAdd[] = $gid;
}
}
}
if (count($devices) > 0) {
$requestBody['HostConfig']['Devices'] = $devices;
}
if (count($groupAdd) > 0) {
$requestBody['HostConfig']['GroupAdd'] = $groupAdd;
}
if ($container->enableNvidiaGpu && $this->configurationManager->enableNvidiaGpu) {
$requestBody['HostConfig']['Runtime'] = 'nvidia';
$requestBody['HostConfig']['DeviceRequests'] = [