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

Alpine Linux support #2909

Closed
Pavel-Konarik opened this issue Jan 25, 2020 · 14 comments
Closed

Alpine Linux support #2909

Pavel-Konarik opened this issue Jan 25, 2020 · 14 comments
Labels
build build issues; typically submitted using template feature request request for unsupported feature or enhancement

Comments

@Pavel-Konarik
Copy link

Is your feature request related to a problem? Please describe.
onnxruntime-1.1.1-cp36-cp36m-manylinux1_x86_64.whl is not supported on Alpine 3.11

System information

  • ONNX Runtime version (you are using):
    1.1.1

Describe the solution you'd like
Include support for Alpine Linux in manylinux wheel so pip install onnxruntime works

Describe alternatives you've considered
Building from source

Additional context
ERROR: onnxruntime-1.1.1-cp36-cp36m-manylinux1_x86_64.whl is not a supported wheel on this platform.

@snnn
Copy link
Member

snnn commented Jan 25, 2020

Any hint what we should do?

@Pavel-Konarik
Copy link
Author

Pavel-Konarik commented Jan 25, 2020

Sadly I am not sure why manylinux for onnxruntime does not include support for Alpine Linux, but here are steps to quickly reproduce the error and some additional info.

Why Alpine Linux?
I am building a simple and small predictor in Docker, and alpine has much smaller image than Ubuntu
Does installing onnx give the same error?
No, pip install onnx works as intended
Steps to replicate

#Dockerfile
FROM python:3.6.10-alpine3.11

RUN apk --no-cache add wget build-base gcc git cmake gfortran musl-dev bash bash-doc bash-completion freetype-dev &&\
    apk --no-cache add jpeg-dev zlib-dev make && pip --version && pip install --upgrade pip

RUN pip install onnx==1.6.0 onnxruntime==1.1.1

Build Docker image using
docker build -t onnximage -f <Dockerfile path> .

Python version
Python 3.6.10

I am happy to provide/try anything. At the moment I am trying to compile from source.

@jywu-msft jywu-msft added the contributions welcome lower priority issues for the core ORT teams label Jan 28, 2020
@shaharv
Copy link

shaharv commented Mar 2, 2020

Unfortunately, manylinux wheels are not compatible with Alpine Linux. In fact, Alpine Linux and musl based distros are not currently not supported by python wheels:
pypa/manylinux#37

Alpine is based on musl libc, as opposed glibc, the GNU standard C library, which is used by most Linux distros and supported by manylinux. musl is a minimalistic and novel libc implementation, and as such misses many glibc features. In addition, there are subtle functional differences (such as smaller default thread stack size, dynamic linking behavior, locales implementation, etc.).

Detailed musl/glibc comparisons could be found here:

Until Alpine Linux wheel support is added, installing wheels on Alpine will have to fall back to building the wheel from source, which will probably require support in the onnxruntime wheel build script.

FYI, I created a docker image for building onnxruntime from source on Alpine 3.11 (python 3.8.2, gcc 9.2.0) - perhaps it could be useful: Dockerfile. Some minor tweaking was required to overcome some build and dependency issues, but besides that the C++ build itself was very smooth.

@Pavel-Konarik
Copy link
Author

@shaharv Thanks for the amazing explanation and the Dockerfile! You rock!

@sanmai-NL
Copy link

@Pavel-Konarik: May I suggest you reopen this issue, and take a look at pypa/manylinux#37 (comment)?

@snnn
Copy link
Member

snnn commented Aug 25, 2021

Once we get musl support from pypa/manylinux, cibuildwheel and auditwheel tools, I can help add it to our packaging pipeline.

@svenha
Copy link

svenha commented Nov 29, 2021

auditwheel 5.0.0 added musl support on 2021-09-18 (also manylinux), cibuildwheel 2.2.0 did so on 2021-10-22.

@29x10
Copy link

29x10 commented Nov 13, 2022

any update on this? still failed

@snnn
Copy link
Member

snnn commented Nov 17, 2022

Sorry the work is not started yet.

@snnn snnn added feature request request for unsupported feature or enhancement build build issues; typically submitted using template and removed contributions welcome lower priority issues for the core ORT teams labels Nov 17, 2022
@sunjingsong
Copy link

Hello, any update on this? I met similar problem on Alpine Linux to deploy ML on java server

@esandoval30
Copy link

esandoval30 commented Dec 8, 2022

+1

Facing exactly this same issue in alpine docker image running my java server app.

ldd libonnxruntime.so
/lib/ld-musl-x86_64.so.1 (0x4000000000)
libdl.so.2 => /lib/ld-musl-x86_64.so.1 (0x4000000000)
librt.so.1 => /lib/ld-musl-x86_64.so.1 (0x4000000000)
libpthread.so.0 => /lib/ld-musl-x86_64.so.1 (0x4000000000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x400271f000)
libm.so.6 => /lib/ld-musl-x86_64.so.1 (0x4000000000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x40028f7000)
libc.so.6 => /lib/ld-musl-x86_64.so.1 (0x4000000000)
ld-linux-x86-64.so.2 => /lib/ld-linux-x86-64.so.2 (0x4002910000)
Error relocating libonnxruntime.so: __snprintf_chk: symbol not found
Error relocating libonnxruntime.so: __vsnprintf_chk: symbol not found
Error relocating libonnxruntime.so: __memset_chk: symbol not found
Error relocating libonnxruntime.so: __fprintf_chk: symbol not found
Error relocating libonnxruntime.so: __memcpy_chk: symbol not found

@snnn
Copy link
Member

snnn commented Dec 8, 2022

We don't have prebuilt packages for Alpine. At this moment you still need to build it by yourself. People I know in this dev team do not have experience on Alpine, so we don't know how to do it.

@leso-kn
Copy link
Contributor

leso-kn commented Mar 24, 2023

See testing/onnxruntime, testing/onnxruntime-dev and testing/py3-onnxruntime are now available.

@svenha
Copy link

svenha commented Mar 25, 2023

See testing/onnxruntime, testing/onnxruntime-dev and testing/py3-onnxruntime are now available.

Excellent news. I installed these packages on a postmarketOS phone, added Larynx and get very good speech output from this text-to-speech system.

Maybe someone can close this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build issues; typically submitted using template feature request request for unsupported feature or enhancement
Projects
None yet
Development

No branches or pull requests

10 participants