Skip to content
This repository was archived by the owner on May 25, 2023. It is now read-only.
This repository was archived by the owner on May 25, 2023. It is now read-only.

"Failed to load NIF library" when running Docker container #8

@jy-tan

Description

@jy-tan

I'm working on an app that uses exFaiss, running into issues with deployment. I can build the Docker image but when i try to run the container it dies immediately with:

"Failed to load NIF library /app/lib/ex_faiss-0.1.0/priv/libex_faiss: '/app/lib/ex_faiss-0.1.0/priv/lib/libfaiss.so: undefined symbol: _Z9vaddq_u1612__Uint16x8_tS_'"

Dockerfile:

FROM elixir:1.14.3-otp-24-slim as builder

RUN apt-get update \
    && apt-get install -y \
     build-essential \
     git curl cmake \
     libblas-dev liblapack-dev \
    && apt-get clean

ENV MIX_ENV=prod

RUN mix local.rebar --force && \
    mix local.hex --force

COPY mix.exs .
COPY mix.lock .

RUN mix deps.get --only $MIX_ENV && \
    mix deps.compile

COPY config ./config
COPY priv ./priv
COPY lib ./lib

RUN mix release

FROM debian:bullseye-slim

RUN apt-get update \
    && apt-get install -y libblas-dev liblapack-dev libgomp1 cmake

WORKDIR /usr/app

COPY --from=builder _build/prod/rel/octomind/ .

CMD ["bin/octomind", "start"]
Full error report
=SUPERVISOR REPORT==== 4-Mar-2023::04:23:05.482765 ===
    supervisor: {local,kernel_sup}
    errorContext: start_error
    reason: {on_load_function_failed,'Elixir.ExFaiss.NIF',
                {error,
                    {load_failed,
                        "Failed to load NIF library /usr/app/lib/ex_faiss-0.1.0/priv/libex_faiss: '/usr/app/lib/ex_faiss-0.1.0/priv/lib/libfaiss.so: undefined symbol: _Z9vaddq_u1612__Uint16x8_tS_'"}}}
    offender: [{pid,undefined},
               {id,kernel_safe_sup},
               {mfargs,{supervisor,start_link,
                                   [{local,kernel_safe_sup},kernel,safe]}},
               {restart_type,permanent},
               {significant,false},
               {shutdown,infinity},
               {child_type,supervisor}]

=CRASH REPORT==== 4-Mar-2023::04:23:05.482810 ===
  crasher:
    initial call: supervisor:kernel/1
    pid: <0.2128.0>
    registered_name: []
    exception exit: {on_load_function_failed,'Elixir.ExFaiss.NIF',
                        {error,
                            {load_failed,
                                "Failed to load NIF library /usr/app/lib/ex_faiss-0.1.0/priv/libex_faiss: '/usr/app/lib/ex_faiss-0.1.0/priv/lib/libfaiss.so: undefined symbol: _Z9vaddq_u1612__Uint16x8_tS_'"}}}
      in function  init:run_on_load_handlers/0 
      in call from kernel:init/1 (kernel.erl, line 189)
      in call from supervisor:init/1 (supervisor.erl, line 330)
      in call from gen_server:init_it/2 (gen_server.erl, line 423)
      in call from gen_server:init_it/6 (gen_server.erl, line 390)
    ancestors: [kernel_sup,<0.2102.0>]
    message_queue_len: 0
    messages: []
    links: [<0.2104.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 987
    stack_size: 28
    reductions: 270
  neighbours:

=CRASH REPORT==== 4-Mar-2023::04:23:06.492776 ===
  crasher:
    initial call: application_master:init/4
    pid: <0.2101.0>
    registered_name: []
    exception exit: {{shutdown,
                      {failed_to_start_child,kernel_safe_sup,
                       {on_load_function_failed,'Elixir.ExFaiss.NIF',
                        {error,
                         {load_failed,
                          "Failed to load NIF library /usr/app/lib/ex_faiss-0.1.0/priv/libex_faiss: '/usr/app/lib/ex_faiss-0.1.0/priv/lib/libfaiss.so: undefined symbol: _Z9vaddq_u1612__Uint16x8_tS_'"}}}}},
                     {kernel,start,[normal,[]]}}
      in function  application_master:init/4 (application_master.erl, line 142)
    ancestors: [<0.2100.0>]
    message_queue_len: 1
    messages: [{'EXIT',<0.2102.0>,normal}]
    links: [<0.2100.0>,<0.2099.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 1598
    stack_size: 28
    reductions: 235
  neighbours:

=INFO REPORT==== 4-Mar-2023::04:23:06.495438 ===
    application: kernel
    exited: {{shutdown,
                 {failed_to_start_child,kernel_safe_sup,
                     {on_load_function_failed,'Elixir.ExFaiss.NIF',
                         {error,
                             {load_failed,
                                 "Failed to load NIF library /usr/app/lib/ex_faiss-0.1.0/priv/libex_faiss: '/usr/app/lib/ex_faiss-0.1.0/priv/lib/libfaiss.so: undefined symbol: _Z9vaddq_u1612__Uint16x8_tS_'"}}}}},
             {kernel,start,[normal,[]]}}
    type: permanent

{"Kernel pid terminated",application_controller,"{application_start_failure,kernel,{{shutdown,{failed_to_start_child,kernel_safe_sup,{on_load_function_failed,'Elixir.ExFaiss.NIF',{error,{load_failed,\"Failed to load NIF library /usr/app/lib/ex_faiss-0.1.0/priv/libex_faiss: '/usr/app/lib/ex_faiss-0.1.0/priv/lib/libfaiss.so: undefined symbol: _Z9vaddq_u1612__Uint16x8_tS_'\"}}}}},{kernel,start,[normal,[]]}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,kernel,{{shutdown,{failed_to_start_child,kernel_safe_sup,{on_load_function_failed,'Elixir.ExFaiss.NIF',{error,{load_failed,"Failed to load NIF library /usr/app/lib/ex_faiss-0.1.0/priv/libex_faiss: '/usr/app/lib/ex_faiss-0.1.0/priv/lib/libfaiss.so: undefined symbol: _Z9vaddq_u1612__Uint16x8_tS_'"}}}}},{kernel,start,[normal,[]]}}})

Crash dump is being written to: erl_crash.dump...done
=SUPERVISOR REPORT==== 4-Mar-2023::04:23:40.861177 ===
    supervisor: {local,kernel_sup}
    errorContext: start_error
    reason: {on_load_function_failed,'Elixir.ExFaiss.NIF',
                {error,
                    {load_failed,
                        "Failed to load NIF library /usr/app/lib/ex_faiss-0.1.0/priv/libex_faiss: '/usr/app/lib/ex_faiss-0.1.0/priv/lib/libfaiss.so: undefined symbol: _Z9vaddq_u1612__Uint16x8_tS_'"}}}
    offender: [{pid,undefined},
               {id,kernel_safe_sup},
               {mfargs,{supervisor,start_link,
                                   [{local,kernel_safe_sup},kernel,safe]}},
               {restart_type,permanent},
               {significant,false},
               {shutdown,infinity},
               {child_type,supervisor}]

=CRASH REPORT==== 4-Mar-2023::04:23:40.861952 ===
  crasher:
    initial call: supervisor:kernel/1
    pid: <0.2128.0>
    registered_name: []
    exception exit: {on_load_function_failed,'Elixir.ExFaiss.NIF',
                        {error,
                            {load_failed,
                                "Failed to load NIF library /usr/app/lib/ex_faiss-0.1.0/priv/libex_faiss: '/usr/app/lib/ex_faiss-0.1.0/priv/lib/libfaiss.so: undefined symbol: _Z9vaddq_u1612__Uint16x8_tS_'"}}}
      in function  init:run_on_load_handlers/0 
      in call from kernel:init/1 (kernel.erl, line 189)
      in call from supervisor:init/1 (supervisor.erl, line 330)
      in call from gen_server:init_it/2 (gen_server.erl, line 423)
      in call from gen_server:init_it/6 (gen_server.erl, line 390)
    ancestors: [kernel_sup,<0.2102.0>]
    message_queue_len: 0
    messages: []
    links: [<0.2104.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 987
    stack_size: 28
    reductions: 270
  neighbours:

=CRASH REPORT==== 4-Mar-2023::04:23:41.866610 ===
  crasher:
    initial call: application_master:init/4
    pid: <0.2101.0>
    registered_name: []
    exception exit: {{shutdown,
                      {failed_to_start_child,kernel_safe_sup,
                       {on_load_function_failed,'Elixir.ExFaiss.NIF',
                        {error,
                         {load_failed,
                          "Failed to load NIF library /usr/app/lib/ex_faiss-0.1.0/priv/libex_faiss: '/usr/app/lib/ex_faiss-0.1.0/priv/lib/libfaiss.so: undefined symbol: _Z9vaddq_u1612__Uint16x8_tS_'"}}}}},
                     {kernel,start,[normal,[]]}}
      in function  application_master:init/4 (application_master.erl, line 142)
    ancestors: [<0.2100.0>]
    message_queue_len: 1
    messages: [{'EXIT',<0.2102.0>,normal}]
    links: [<0.2100.0>,<0.2099.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 1598
    stack_size: 28
    reductions: 235
  neighbours:

=INFO REPORT==== 4-Mar-2023::04:23:41.868296 ===
    application: kernel
    exited: {{shutdown,
                 {failed_to_start_child,kernel_safe_sup,
                     {on_load_function_failed,'Elixir.ExFaiss.NIF',
                         {error,
                             {load_failed,
                                 "Failed to load NIF library /usr/app/lib/ex_faiss-0.1.0/priv/libex_faiss: '/usr/app/lib/ex_faiss-0.1.0/priv/lib/libfaiss.so: undefined symbol: _Z9vaddq_u1612__Uint16x8_tS_'"}}}}},
             {kernel,start,[normal,[]]}}
    type: permanent

Kernel pid terminated (application_controller) ({application_start_failure,kernel,{{shutdown,{failed_to_start_child,kernel_safe_sup,{on_load_function_failed,'Elixir.ExFaiss.NIF',{error,{load_failed,"Failed to load NIF library /usr/app/lib/ex_faiss-0.1.0/priv/libex_faiss: '/usr/app/lib/ex_faiss-0.1.0/priv/lib/libfaiss.so: undefined symbol: _Z9vaddq_u1612__Uint16x8_tS_'"}}}}},{kernel,start,[normal,[]]}}})

Crash dump is being written to: erl_crash.dump...done
{"Kernel pid terminated",application_controller,"{application_start_failure,kernel,{{shutdown,{failed_to_start_child,kernel_safe_sup,{on_load_function_failed,'Elixir.ExFaiss.NIF',{error,{load_failed,\"Failed to load NIF library /usr/app/lib/ex_faiss-0.1.0/priv/libex_faiss: '/usr/app/lib/ex_faiss-0.1.0/priv/lib/libfaiss.so: undefined symbol: _Z9vaddq_u1612__Uint16x8_tS_'\"}}}}},{kernel,start,[normal,[]]}}}"}

Greatly appreciate any help on this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions