Closed FerdyM closed 1 year ago
@FerdyM Please try the solution provided in this comment. If the problem persists, please let us know the use case, the MediaPipe solution you are exploring, and other relevant details so that we can help you better.
@ayushgdev Thank you very much for the swift reply, unfortunately, I haven't been able to get the provided solution working, unfortunately, the docs/instructions on how actually to utilize it have since been deleted. Please advise, thank you.
@FerdyM The comment link is working, and the comment contains two links which are also working. Which docs/instructions are you referring to as deleted?
PS, quoting the solution from the comment:
The trick is to use a shim for pthread_setname_np() using the LD_PRELOAD environment variable. What this does is allows the dynamic library linker/loader (LD) to use the custom pthread_setname_np() implementation over the default glibc implementation. You can use this convenient shim for pthread_setname_np() mentioned in the first comment: https://github.com/mitchellharper12/lambda-pthread-nameshim. To get it working run make pthread_shim.so. This will compile the shim into an ELF shared object file (dynamic library). You can then copy pthread_shim.so to /opt as part of your Docker image. Inside your Dockerfile, do something like this: RUN make pthread_shim.so && cp pthread_shim.so /opt . Afterwards specify the LD_PRELOAD environment variable in AWS Lambda:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.
Closing as stale. Please reopen if you'd like to work on this further.
Dockerfile:
` FROM public.ecr.aws/lambda/python:3.9
COPY appy.py ${LAMBDA_TASK_ROOT}
RUN yump update-y RUN yum install mesa-libGL -y
COPY requirements.txt . RUN /var/lang/bin/python3.9 -m pip install --upgrade pip RUN pip3 install -r requirements.txt --target "${LAMBDA_TASK_ROOT}"
CMD [ "app.handler" ] `
requirements.txt:
requests==2.25.1 opencv-contrib-python-headless==4.6.0.66 Pillow==8.0 mediapipe==0.9.0.1 protobuf==3.19.0
Errors:
WARNING: Logging before InitGoogleLogging() is written to STDERR E20221223 05:37:41.205829 15 threadpool_pthread_impl.cc:94] Error : Operation not permitted Failed to set name for thread: mediapipe/15 E20221223 05:37:41.262543 16 threadpool_pthread_impl.cc:94] Error : Operation not permitted Failed to set name for thread: mediapipe/16