utensils / docker-opengl Goto Github PK
View Code? Open in Web Editor NEWMulti-Arch Docker - Mesa 3D OpenGL Software Rendering (Gallium) - LLVMpipe, and OpenSWR Drivers
License: MIT License
Multi-Arch Docker - Mesa 3D OpenGL Software Rendering (Gallium) - LLVMpipe, and OpenSWR Drivers
License: MIT License
# apk add mesa-demos
# glxinfo | grep OpenGL
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: llvmpipe (LLVM 10.0.0, 256 bits)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 20.0.6 (git-4c59d9944a)
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.1 Mesa 20.0.6 (git-4c59d9944a)
OpenGL shading language version string: 1.40
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 20.0.6 (git-4c59d9944a)
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
OpenGL ES profile extensions:
# glxinfo -l | grep MAX_TEXTURE_SIZE
GL_MAX_TEXTURE_SIZE = 8192
GL_MAX_TEXTURE_SIZE = 8192
Hello! Could you post a precompiled stable version for i386 in release build? Thank you in advance!
I try to run note ffmpeg-concat with transitions on top of this image. i did
all mp4 will be converted into raw, but applying transition will result in "failed to create OpenGL context".
I try to find the reason, but i can't find any GLX-extension loaded by XvFB.
xdpyinfo just displays the following extensions:
number of extensions: 22
BIG-REQUESTS
Composite
DAMAGE
DOUBLE-BUFFER
Generic Event Extension
MIT-SCREEN-SAVER
MIT-SHM
Present
RANDR
RECORD
RENDER
SECURITY
SHAPE
SYNC
X-Resource
XC-MISC
XFIXES
XINERAMA
XInputExtension
XKEYBOARD
XTEST
XVideo
Any Ideas?
THX, Volker
for reference I've used your source, and updated to last versions, sharing here for anyone looking for it.
N.B. I have no idea what I'm doing but it works for me
# Base Docker Image
ARG BASE_IMAGE=alpine:edge
FROM ${BASE_IMAGE} as builder
# Install all needed build deps for Mesa3D
ARG LLVM_VERSION=15
RUN set -xe; \
apk add --no-cache \
autoconf \
automake \
bison \
build-base \
cmake \
elfutils-dev \
expat-dev \
flex \
gettext \
git \
glproto \
libdrm-dev \
libtool \
libva-dev \
libx11-dev \
libxcb-dev \
libxdamage-dev \
libxext-dev \
libxfixes-dev \
libxrandr-dev \
libxshmfence-dev \
libxt-dev \
libxvmc-dev \
libxxf86vm-dev \
llvm${LLVM_VERSION} \
llvm${LLVM_VERSION}-dev \
llvm-libunwind-dev \
eudev-libs \
makedepend \
meson \
py-mako \
py3-libxml2 \
py3-mako \
python3 \
python3-dev \
talloc-dev \
wayland-dev \
wayland-protocols \
xorg-server-dev \
xorgproto \
zlib-dev \
zstd-dev;
# Clone Mesa source repo. (this step caches)
# Due to ongoing packaging issues we build from git vs tar packages
# Refer to https://bugs.freedesktop.org/show_bug.cgi?id=107865
ARG MESA_VERSION=22.2.0
RUN set -xe; \
mkdir -p /var/tmp/build; \
cd /var/tmp/build/; \
git clone --depth=1 --branch=mesa-${MESA_VERSION} https://gitlab.freedesktop.org/mesa/mesa.git;
# Build Mesa from source.
ARG BUILD_TYPE=release
ARG BUILD_OPTIMIZATION=3
RUN set -xe; \
cd /var/tmp/build/mesa; \
libtoolize; \
if [ "$(uname -m)" == "aarch64" ] || [ "$(uname -m)" == "armv7l" ]; \
then \
galium_drivers=swrast; \
else \
galium_drivers=swrast,swr; \
fi ;\
meson \
--buildtype=${BUILD_TYPE} \
--prefix=/usr/local \
--sysconfdir=/etc \
-D b_ndebug=true \
-D egl=true \
-D gallium-nine=false \
-D gallium-xvmc=false \
-D gbm=true \
-D gles1=false \
-D gles2=true \
-D opengl=true \
-D dri-drivers-path=/usr/local/lib/xorg/modules/dri \
-D dri-drivers= \
-D dri3=true \
-D egl=false \
-D gallium-drivers="$galium_drivers" \
-D gbm=false \
-D glx=dri \
-D llvm=true \
-D lmsensors=false \
-D optimization=${BUILD_OPTIMIZATION} \
-D osmesa=true \
-D platforms=x11,wayland \
-D shared-glapi=true \
-D shared-llvm=true \
-D vulkan-drivers= \
build/; \
ninja -C build/ -j $(getconf _NPROCESSORS_ONLN); \
ninja -C build/ install
# Copy our entrypoint into the container.
COPY ./entrypoint.sh /usr/local/bin/entrypoint.sh
# Create fresh image from alpine
ARG BASE_IMAGE=alpine:edge
FROM ${BASE_IMAGE}
# Copy the Mesa build & entrypoint script from previous stage
COPY --from=builder /usr/local /usr/local
# Install runtime dependencies for Mesa and link xorg dri modules
ARG LLVM_VERSION=15
RUN set -xe; \
apk --update add --no-cache \
binutils \
expat \
llvm${LLVM_VERSION}-libs \
setxkbmap \
xdpyinfo \
xrandr \
xvfb \
xvfb-run \
zstd-libs; \
ln -sf /usr/local/lib/xorg/modules/dri/* /usr/lib/xorg/modules/dri/
# Setup our environment variables.
ENV \
DISPLAY=":99" \
GALLIUM_DRIVER="llvmpipe" \
LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" \
LIBGL_ALWAYS_SOFTWARE="1" \
LP_DEBUG="" \
LP_NO_RAST="false" \
LP_NUM_THREADS="" \
LP_PERF="" \
MESA_VERSION="${MESA_VERSION}" \
XVFB_WHD="1920x1080x24"
❯ make all
unknown flag: --build-arg
See 'docker --help'.
Running the "make stable" command to build this image hangs on step 5/16 for a long time on the very first line of this snippet and then errors out in the following lines
CXX rasterizer/core/backends/libswrAVX2_la-gen_rasterizer0.lo g++: fatal error: Killed signal terminated program cc1plus compilation terminated. make[5]: *** [Makefile:3374: rasterizer/core/libswrAVX2_la-backend_sample.lo] Error 1 make[5]: *** Waiting for unfinished jobs.... In file included from ./rasterizer/core/format_conversion.h:28, from rasterizer/memory/StoreTile.h:34, from rasterizer/memory/StoreTile_TileY.cpp:28: ./rasterizer/core/format_types.h: In lambda function: ./rasterizer/core/format_types.h:1416:26: warning: array subscript 4 is above array bounds of 'const uint32_t [4]' {aka 'const unsigned int [4]'} [-Warray-bounds] return MyBpc[comp]; ^ ./rasterizer/core/format_types.h:1404:29: warning: array subscript 4 is above array bounds of 'const SWR_TYPE [4]' [-Warray-bounds] return CompType[comp]; ^ ./rasterizer/core/format_types.h: In lambda function: ./rasterizer/core/format_types.h:1416:26: warning: array subscript 4 is above array bounds of 'const uint32_t [4]' {aka 'const unsigned int [4]'} [-Warray-bounds] return MyBpc[comp]; ^ ./rasterizer/core/format_types.h:1404:29: warning: array subscript 4 is above array bounds of 'const SWR_TYPE [4]' [-Warray-bounds] return CompType[comp]; ^ ./rasterizer/core/format_types.h: In lambda function: ./rasterizer/core/format_types.h:1416:26: warning: array subscript 4 is above array bounds of 'const uint32_t [4]' {aka 'const unsigned int [4]'} [-Warray-bounds] return MyBpc[comp]; ^ ./rasterizer/core/format_types.h:1404:29: warning: array subscript 4 is above array bounds of 'const SWR_TYPE [4]' [-Warray-bounds] return CompType[comp]; ^ make[4]: *** [Makefile:1892: all] Error 2 make[5]: Leaving directory '/var/tmp/build/mesa/src/gallium/drivers/swr' make[4]: Leaving directory '/var/tmp/build/mesa/src/gallium/drivers/swr' make[3]: *** [Makefile:633: all-recursive] Error 1 make[3]: Leaving directory '/var/tmp/build/mesa/src/gallium' make[2]: *** [Makefile:897: all-recursive] Error 1 make[2]: Leaving directory '/var/tmp/build/mesa/src' make[1]: *** [Makefile:682: all] Error 2 make[1]: Leaving directory '/var/tmp/build/mesa/src' make: *** [Makefile:694: all-recursive] Error 1 The command '/bin/sh -c set -xe; cd /var/tmp/build/mesa; git checkout mesa-${MESA_VERSION}; libtoolize; autoreconf --install; ./configure --enable-glx=gallium-xlib --with-gallium-drivers=swrast,swr --disable-dri --disable-gbm --disable-egl --enable-gallium-osmesa --enable-autotools --enable-llvm --with-llvm-prefix=/usr/lib/llvm7/ --prefix=/usr/local; make -j$(getconf _NPROCESSORS_ONLN); make install;' returned a non-zero code: 2 make: *** [19.0.8] Error 2
I did not make any changes to the Dockerfile or Makefile, I just cloned the repo and in terminal in that folder, ran the 'make stable' command. Not sure if it has anything to do with the Mesa version being checked out or not
Hello everybody!
I'm trying to use this image as a base for a custom docker container on Gitlab-CI. I noticed builds don't terminate and executing a simple command locally does not terminate aswell.
I'm guessing the issue is somewhere in entrypoint.sh, but I haven't found anything more specific yet.
Any ideas would be greatly appreciated.
Best,
Jonathan
Hello. I wish to run a 3D software what requires RHEL/CentOS 7. I want to create a CentOS 7 image with llvmpipe integrated so that the 3D software can run in headless servers. Seems like your image is the closest one to what I need. So is the building script repeatable on other Linux distributions? Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.