GPU Hardware Accelerations in Immich

Hello, I am trying to enable hardware acceleration within Immich running on my TrueNAS Scale instance. I have been struggling to get my Nvidia 3070 to be detected by TrueNAS and just got the drivers installed, which then enabled the check box in the Immich configuration to tell the app to use the 3070, although when I select the box and save the configuration I get the following error:

FAILED:
[EFAULT] Failed to render compose templates: Traceback (most recent call last): File “/usr/bin/apps_render_app”, line 33, in sys.exit(load_entry_point(‘apps-validation==0.1’, ‘console_scripts’, ‘apps_render_app’)()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/usr/lib/python3/dist-packages/catalog_templating/scripts/render_compose.py”, line 47, in main render_templates_from_path(args.path, args.values) File “/usr/lib/python3/dist-packages/catalog_templating/scripts/render_compose.py”, line 19, in render_templates_from_path rendered_data = render_templates( ^^^^^^^^^^^^^^^^^ File “/usr/lib/python3/dist-packages/catalog_templating/render.py”, line 36, in render_templates ).render({‘ix_lib’: template_libs, ‘values’: test_values}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/usr/lib/python3/dist-packages/jinja2/environment.py”, line 1301, in render self.environment.handle_exception() File “/usr/lib/python3/dist-packages/jinja2/environment.py”, line 936, in handle_exception raise rewrite_traceback_stack(source=source) File “/mnt/.ix-apps/app_configs/immich/versions/1.7.37/templates/docker-compose.yaml”, line 12, in top-level template code {% set postgres = tpl.deps.postgres(values.consts.pgvecto_container_name, “pgvecto_image”, pg_config, perm_container) %} ^^^^^^^^^^^^^^^^^^^^^^^^^ File “/mnt/.ix-apps/app_configs/immich/versions/1.7.37/templates/library/base_v2_1_16/deps.py”, line 26, in postgres return PostgresContainer(self._render_instance, name, image, config, perms_instance) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/mnt/.ix-apps/app_configs/immich/versions/1.7.37/templates/library/base_v2_1_16/deps_postgres.py”, line 48, in init c = self._render_instance.add_container(name, image) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/mnt/.ix-apps/app_configs/immich/versions/1.7.37/templates/library/base_v2_1_16/render.py”, line 59, in add_container container = Container(self, name, image) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/mnt/.ix-apps/app_configs/immich/versions/1.7.37/templates/library/base_v2_1_16/container.py”, line 94, in init self.deploy: Deploy = Deploy(self._render_instance) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/mnt/.ix-apps/app_configs/immich/versions/1.7.37/templates/library/base_v2_1_16/deploy.py”, line 15, in init self.resources: Resources = Resources(self._render_instance) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/mnt/.ix-apps/app_configs/immich/versions/1.7.37/templates/library/base_v2_1_16/resources.py”, line 24, in init self._auto_add_gpus_from_values() File “/mnt/.ix-apps/app_configs/immich/versions/1.7.37/templates/library/base_v2_1_16/resources.py”, line 55, in _auto_add_gpus_from_values raise RenderError(f"Expected [uuid] to be set for GPU in slot [{pci}] in [nvidia_gpu_selection]") base_v2_1_16.error.RenderError: Expected [uuid] to be set for GPU in slot [0000:01:00.0] in [nvidia_gpu_selection]

Any idea why this is happening or what I could do to solve the issue? Nvidia-smi shows the GPU although the drivers are version 550.127.05 and I can’t seem to get a later version, not sure if that is playing into it.

So after digging around a bit I found this article which lists this error as a know issues but when I try to run the command to assign the GPU UUID in Nvidia_gpu_selection I am getting this error: “Status: (none)
Total Progress: [________________________________________] 0.00%
[EINVAL] app_update: A dict was expected”

Again any help is greatly appreciated!

Are you on 25.04?

No I am still on ElectricEel-24.10.2 which is what installed when I grabbed the ISO file from the site last week. I can upgrade if you think that will solve it, didn’t want to make the issue worse

I also found the cause of the error above but now am getting this error when trying to assign the UUID

“CRUDService.update() takes 5 positional arguments but 6 were given
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/middlewared/main.py”, line 211, in call_method
result = await self.middleware.call_with_audit(message[‘method’], serviceobj, methodobj, params, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/main.py”, line 1529, in call_with_audit
result = await self._call(method, serviceobj, methodobj, params, app=app,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/main.py”, line 1460, in _call
return await methodobj(*prepared_call.args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: CRUDService.update() takes 5 positional arguments but 6 were given”

No, there is just a slight syntax difference with that command between 24.10 and 25.04, which I thought might have been the issue.

Not sure what is happening with that next error though.

Can you post the command as you are trying to run it (and use the </> button or a code block on here to format it)?

Sure so I started with midclt call app.gpu_choices | jq to get the data on my GPU which returns:

{
“0000:01:00.0”: {
“vendor”: “NVIDIA”,
“description”: “NVIDIA GeForce RTX 3070”,
“vendor_specific_config”: {
“uuid”: “GPU-67c194a7-bc5a-3806-7886-e466cd4112ca”
},
“pci_slot”: “0000:01:00.0”
}
}

I then use the data provide from that command to fill in the field in this command midclt call app.update APP_NAME immich '{"values": {"resources": {"gpus": {"use_all_gpus": false, "nvidia_gpu_selection": {"PCI_SLOT": "0000:01:00.0" {"use_gpu": true, "uuid": "GPU-67c194a7-bc5a-3806-7886-e466cd4112ca"}}}}}}'

Which now give me this error when I run the command:

“CRUDService.update() takes 5 positional arguments but 6 were given
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/middlewared/main.py”, line 211, in call_method
result = await self.middleware.call_with_audit(message[‘method’], serviceobj, methodobj, params, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/main.py”, line 1529, in call_with_audit
result = await self._call(method, serviceobj, methodobj, params, app=app,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/main.py”, line 1460, in _call
return await methodobj(*prepared_call.args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: CRUDService.update() takes 5 positional arguments but 6 were given”

Looks like you’re missing a -job flag and you added the PCI slot after the variable instead of in place of it

The template is

midclt call -job app.update APP_NAME '{"values": {"resources": {"gpus": {"use_all_gpus": false, "nvidia_gpu_selection": {"PCI_SLOT": {"use_gpu": true, "uuid": "GPU_UUID"}}}}}}'

Where:

  • APP_NAME is the name you entered in the application, for example “plex”.
  • PCI_SLOT is the pci slot identified in the error, for example “0000:2d:00.0”.
  • GPU_UUID is the UUID matching the pci slot that you retrieved with the above command.

Oh my bad I pasted in the wrong one, I had removed that because the -j in the Jira ticket was causing an error, everything is still correct in my above comment and I still get the same output when using midclt call -job app.update APP_NAME: "immich" '{"resources": {"gpus": {"use_all_gpus": false, "nvidia_gpu_selection": {"PCI_SLOT": "0000:01:00.0" {"use_gpu": true, "uuid": "GPU-67c194a7-bc5a-3806-7886-e466cd4112ca"}}}}}'

Apologies for the confusion!

-j is needed for 25.04, 24.10 is -job

This is the other part I was talking about:

try {"0000:01:00.0": {"use_gpu":

This is the output when removing the “PCI_SLOT” and just replace it with {"0000:01:00.0": {"use_gpu":

The overall command is now midclt call -job app.update APP_NAME "immich" '{"values": {"resources": {"gpus": {"use_all_gpus": false, "nvidia_gpu_selection": {"0000:01:00.0": {"use_gpu": true, "uuid": "GPU-67c194a7-bc5a-3806-7886-e466cd4112ca"}}}}}}'

The output from that command is now:

CRUDService.update() takes 5 positional arguments but 6 were given
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/middlewared/main.py”, line 211, in call_method
result = await self.middleware.call_with_audit(message[‘method’], serviceobj, methodobj, params, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/main.py”, line 1529, in call_with_audit
result = await self._call(method, serviceobj, methodobj, params, app=app,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/main.py”, line 1460, in _call
return await methodobj(*prepared_call.args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: CRUDService.update() takes 5 positional arguments but 6 were given

truenas_admin@truenas[~]$ midclt call -job app.update APP_NAME “immich” ‘{“values”: {“resources”: {“gpus”: {“use_all_gpus”: false, “nvidia_gpu_selection”: {‘0000:01:00.0’: {“use_gpu”: true, “uuid”: “GPU-67c194a7-bc5a-3806-7886-e466cd4112ca”}}}}}}’
CRUDService.update() takes 5 positional arguments but 6 were given
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/middlewared/main.py”, line 211, in call_method
result = await self.middleware.call_with_audit(message[‘method’], serviceobj, methodobj, params, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/main.py”, line 1529, in call_with_audit
result = await self._call(method, serviceobj, methodobj, params, app=app,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/main.py”, line 1460, in _call
return await methodobj(*prepared_call.args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: CRUDService.update() takes 5 positional arguments but 6 were given

truenas_admin@truenas[~]$ midclt call -job app.update APP_NAME “immich” ‘{“values”: {“resources”: {“gpus”: {“use_all_gpus”: false, “nvidia_gpu_selection”: {“0000:01:00.0”: {“use_gpu”: true, “uuid”: “GPU-67c194a7-bc5a-3806-7886-e466cd4112ca”}}}}}}’
CRUDService.update() takes 5 positional arguments but 6 were given
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/middlewared/main.py”, line 211, in call_method
result = await self.middleware.call_with_audit(message[‘method’], serviceobj, methodobj, params, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/main.py”, line 1529, in call_with_audit
result = await self._call(method, serviceobj, methodobj, params, app=app,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/main.py”, line 1460, in _call
return await methodobj(*prepared_call.args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: CRUDService.update() takes 5 positional arguments but 6 were given

This ended up being the solution, I had to also remove out the APP_NAME section. Thank you for your help, Immich is now running and updated to use the 3070!!

1 Like