{"record":{"id":"4167afdcababfac0","repo":"immich-app/immich","slug":"device-devicename-does-not-exist-if-using-do","errorCode":null,"errorMessage":"Device '${deviceName}' does not exist. If using Docker, make sure this device is mounted","messagePattern":"Device '(.+?)' does not exist\\. If using Docker, make sure this device is mounted","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/src/utils/media.ts","lineNumber":455,"sourceCode":"      throw new Error('No /dev/dri devices found. If using Docker, make sure at least one /dev/dri device is mounted');\n    }\n\n    return devices.filter(function (device) {\n      return device.startsWith('renderD') || device.startsWith('card');\n    });\n  }\n\n  getDevice({ dri }: VideoInterfaces) {\n    if (this.config.preferredHwDevice === 'auto') {\n      // eslint-disable-next-line unicorn/no-array-reduce\n      return `/dev/dri/${this.validateDevices(dri).reduce(function (a, b) {\n        return a.localeCompare(b) < 0 ? b : a;\n      })}`;\n    }\n\n    const deviceName = this.config.preferredHwDevice.replace('/dev/dri/', '');\n    if (!dri.includes(deviceName)) {\n      throw new Error(`Device '${deviceName}' does not exist. If using Docker, make sure this device is mounted`);\n    }\n\n    return `/dev/dri/${deviceName}`;\n  }\n\n  getVideoCodec(): string {\n    return `${this.config.targetVideoCodec}_${this.config.accel}`;\n  }\n\n  getGopSize() {\n    if (this.config.gopSize <= 0) {\n      return 256;\n    }\n    return this.config.gopSize;\n  }\n}\n\nexport class ThumbnailConfig extends BaseConfig {","sourceCodeStart":437,"sourceCodeEnd":473,"githubUrl":"https://github.com/immich-app/immich/blob/199723261c6ffa897fec8ccdaea6359e39c37cc3/server/src/utils/media.ts#L437-L473","documentation":"Thrown by VideoInterface.getDevice when ffmpeg.preferredHwDevice is set to a specific device name (not 'auto') but that name is not present among the discovered /dev/dri entries. The configured name is normalized by stripping '/dev/dri/' then checked with `dri.includes(deviceName)`.","triggerScenarios":"A transcode job initializes hardware acceleration while ffmpeg.preferredHwDevice references a render node (e.g. 'renderD129') that does not exist on the host/container.","commonSituations":"Hardcoding preferredHwDevice on a host whose render node has a different number (renderD128 vs renderD129); passing only one GPU but configuring another; typo in the device name; multi-GPU system where the configured node is absent.","solutions":["List available devices on the host/container (`ls /dev/dri`) and set preferredHwDevice to one that exists (or to '/dev/dri/<existingNode>').","Set preferredHwDevice to 'auto' to let Immich pick the highest-sorted render node automatically.","Ensure the intended device is passed through to the container."],"exampleFix":"// before\nffmpeg.preferredHwDevice = '/dev/dri/renderD129'; // absent\n\n// after\nffmpeg.preferredHwDevice = 'auto';\n// or\nffmpeg.preferredHwDevice = '/dev/dri/renderD128'; // exists per `ls /dev/dri`","handlingStrategy":"validation","validationCode":"import { readdirSync } from 'node:fs';\nconst dev = config.ffmpeg.preferredHwDevice;\nif (dev !== 'auto') {\n  const dri = readdirSync('/dev/dri');\n  const name = dev.replace('/dev/dri/', '');\n  if (!dri.includes(name)) throw new Error(`configured device ${name} not present`);\n}","typeGuard":"const isKnownDevice = (dev: string, dri: string[]): boolean =>\n  dev === 'auto' || dri.includes(dev.replace('/dev/dri/', ''));","tryCatchPattern":"try { await transcode(assetId); }\ncatch (e) { if (/does not exist/.test(e.message)) { config.ffmpeg.preferredHwDevice='auto'; await retry(); } else throw e; }","preventionTips":["Use 'auto' unless you have a specific multi-GPU reason to pin a device.","List /dev/dri before pinning preferredHwDevice."],"tags":["ffmpeg","hardware-acceleration","gpu","config","transcoding","docker"],"backgroundTag":null,"analyzedSha":"199723261c6ffa897fec8ccdaea6359e39c37cc3","analyzedAt":"2026-08-12T04:54:27.085Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}