Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pds implicitly requires sse4.2 #158

Open
mounirlamouri opened this issue Nov 25, 2024 · 1 comment · May be fixed by #167
Open

pds implicitly requires sse4.2 #158

mounirlamouri opened this issue Nov 25, 2024 · 1 comment · May be fixed by #167

Comments

@mounirlamouri
Copy link

mounirlamouri commented Nov 25, 2024

I've been battling for a bit trying to understand why the pds service was crashing on startup on my server. After investigations, I found out that the root cause was that pds requires a CPU with sse4.2 which my server (old Atom) doesn't support.

For background, these are the symptoms:

  • the docker instance would start but pds would keep dying and restarting
  • error message in /var/log/messages
kernel: traps: node[23207] trap invalid opcode ip:7f22afe5cec3 sp:7ffc11f4e2e0 error:0 in libvips-cpp.so.42[7f22af6a4000+a69000]

After some research, it appears that libvips is used by sharp which is directly included by atproto/pds (package.json).

I would suggest to either:

  • Document that SSE4.2 is required, may by doing a check in the installer with the output of lscpu, OR
  • Change the dependency to not prevent CPUs too old to support sse4.2 to be unable to run PDS.
@mounirlamouri
Copy link
Author

It happens that sharp will use the system libvips by checking for the vips-cpp package using pkg-config. The simpler solution here, which would improve the portability and the security of the container would be to install vips-cpp on the image so when the install phase happens, sharp will use it. It does increase the time it takes to build the image because of the new packages to install and the time it takes to then build the C++ files that sharp uses. However, it's possible to only copy the libraries and reduce the actual impact on the image size.

I have it working locally and will send a PR soon.

@mounirlamouri mounirlamouri linked a pull request Nov 28, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant