Fangtooth fails to add gpu to plex

Hello,

I’m currently getting errors when trying to add the gpu in PLEX
I’ve tried the old fix but i’m getting an error messafe

midclt call -j appupdate plex ‘{“values”: {“resources”: {“gpus”: {“use_all_gpus”: false, “nvidia_gpu_selection”: {“0000:09:00.0”: {“use_gpu”: true, “uuid”: “GPU-cad985be-5158-a003-b576-a8f8c2bf479f”}}}}}}’

When selecting the GPU i get this:

[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 48, 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 31, in render_templates rendered_templates[i.name] = env.get_template(i.name).render( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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/plex/versions/1.2.4/templates/docker-compose.yaml", line 3, in top-level template code {% set c1 = tpl.add_container(values.consts.plex_container_name, values.plex.image_selector) %} ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/.ix-apps/app_configs/plex/versions/1.2.4/templates/library/base_v2_1_35/render.py", line 63, in add_container container = Container(self, name, image) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/.ix-apps/app_configs/plex/versions/1.2.4/templates/library/base_v2_1_35/container.py", line 99, in __init__ self.deploy: Deploy = Deploy(self._render_instance) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/.ix-apps/app_configs/plex/versions/1.2.4/templates/library/base_v2_1_35/deploy.py", line 15, in __init__ self.resources: Resources = Resources(self._render_instance) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/.ix-apps/app_configs/plex/versions/1.2.4/templates/library/base_v2_1_35/resources.py", line 24, in __init__ self._auto_add_gpus_from_values() File "/mnt/.ix-apps/app_configs/plex/versions/1.2.4/templates/library/base_v2_1_35/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_35.error.RenderError: Expected [uuid] to be set for GPU in slot [0000:09:00.0] in [nvidia_gpu_selection]
More info...
 Error: Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/middlewared/job.py", line 515, in run
    await self.future
  File "/usr/lib/python3/dist-packages/middlewared/job.py", line 562, in __run_body
    rv = await self.middleware.run_in_thread(self.method, *args)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 622, in run_in_thread
    return await self.run_in_executor(io_thread_pool_executor, method, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 619, in run_in_executor
    return await loop.run_in_executor(pool, functools.partial(method, *args, **kwargs))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/service/crud_service.py", line 294, in nf
    rv = func(*args, **kwargs)
         ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/api/base/decorator.py", line 101, in wrapped
    result = func(*args)
             ^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/plugins/apps/crud.py", line 229, in do_update
    app = self.update_internal(job, app, data, trigger_compose=app['state'] != 'STOPPED')
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/plugins/apps/crud.py", line 259, in update_internal
    update_app_config(app_name, app['version'], new_values, custom_app=app['custom_app'])
  File "/usr/lib/python3/dist-packages/middlewared/plugins/apps/ix_apps/lifecycle.py", line 60, in update_app_config
    render_compose_templates(
  File "/usr/lib/python3/dist-packages/middlewared/plugins/apps/ix_apps/lifecycle.py", line 51, in render_compose_templates
    raise CallError(f'Failed to render compose templates: {cp.stderr}')
middlewared.service_exception.CallError: [EFAULT] Failed to render compose templates: Traceback (most recent call last):
  File "/usr/bin/apps_render_app", line 33, in <module>
    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 48, 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 31, in render_templates
    rendered_templates[i.name] = env.get_template(i.name).render(
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  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/plex/versions/1.2.4/templates/docker-compose.yaml", line 3, in top-level template code
    {% set c1 = tpl.add_container(values.consts.plex_container_name, values.plex.image_selector) %}
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/.ix-apps/app_configs/plex/versions/1.2.4/templates/library/base_v2_1_35/render.py", line 63, in add_container
    container = Container(self, name, image)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/.ix-apps/app_configs/plex/versions/1.2.4/templates/library/base_v2_1_35/container.py", line 99, in __init__
    self.deploy: Deploy = Deploy(self._render_instance)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/.ix-apps/app_configs/plex/versions/1.2.4/templates/library/base_v2_1_35/deploy.py", line 15, in __init__
    self.resources: Resources = Resources(self._render_instance)
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/.ix-apps/app_configs/plex/versions/1.2.4/templates/library/base_v2_1_35/resources.py", line 24, in __init__
    self._auto_add_gpus_from_values()
  File "/mnt/.ix-apps/app_configs/plex/versions/1.2.4/templates/library/base_v2_1_35/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_35.error.RenderError: Expected [uuid] to be set for GPU in slot [0000:09:00.0] in [nvidia_gpu_selection]

Any help would be greatly appreciated.

It should say midclt call -j app.update
With the period between app and update.

Please also include the error message you got when you ran the above (complete) command.

Edit: Also doublecheck that the app really is named “plex” internally. It’s possible to change it when you install. Check under Apps → Select the plex app in the list of installed apps → Under “Application Info” press “Edit”.

truenas% midclt call -j app.update plex ‘{“values”: {“resources”: {“gpus”: {“use_all_gpus”: false, “nvidia_gpu_selection”: {“0000:09:00.0”: {“use_gpu”: true, “uuid”: “GPU-cad985be-5158-a003-b576-a8f8c2bf479f”}}}}}}’
[EFAULT] Too many arguments (expected 2, found 12)
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 906, in call_with_audit
    result = await self._call(method, serviceobj, methodobj, params, app=app,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 715, in _call
    return await methodobj(*prepared_call.args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: CRUDService.update() takes 5 positional arguments but 15 were given

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/middlewared/api/base/server/ws_handler/rpc.py", line 323, in process_method_call
    result = await method.call(app, params)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/api/base/server/method.py", line 40, in call
    result = await self.middleware.call_with_audit(self.name, self.serviceobj, methodobj, params, app)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 917, in call_with_audit
    await log_audit_message_for_method(success)
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 897, in log_audit_message_for_method
    await self.log_audit_message_for_method(method, methodobj, params, app, True, True, success,
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 945, in log_audit_message_for_method
    'params': self.dump_args(params, methodobj),
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 747, in dump_args
    return dump_params(method.new_style_accepts, args, False)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/api/base/handler/dump_params.py", line 24, in dump_params
    return accept_params(model, args, exclude_unset=True, expose_secrets=expose_secrets)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/api/base/handler/accept.py", line 21, in accept_params
    args_as_dict = model_dict_from_list(model, args)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/api/base/handler/accept.py", line 46, in model_dict_from_list
    raise CallError(f"Too many arguments (expected {len(model.model_fields)}, found {len(args)})")
middlewared.service_exception.CallError: [EFAULT] Too many arguments (expected 2, found 12)