Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,20 @@ if ! nvidia-smi > /dev/null 2>&1; then
echo "WARNING: The NVIDIA Driver was not detected. GPU functionality will not be available."
fi

# Conditionally force Mesa for software rendering.
# Commit dd662d8 added __GLX_VENDOR_LIBRARY_NAME=mesa to fix window creation on
# setups without NVIDIA GLX passthrough (e.g. CPU-only or WSL2 without graphics
# bindings). However, forcing Mesa breaks native NVIDIA GLX passthrough because
# Mesa tries to load the nvidia-drm DRI driver, which is not present in the
# container, leading to Zink/Vulkan swapchain errors.
# Only set it when NVIDIA GLX libraries are absent and the user hasn't
# explicitly configured it.
if [ -z "${__GLX_VENDOR_LIBRARY_NAME+x}" ]; then
if ! ldconfig -p 2>/dev/null | grep -q "libGLX_nvidia.so.0"; then
export __GLX_VENDOR_LIBRARY_NAME=mesa
echo "INFO: NVIDIA GLX libraries not found. Forcing Mesa for software rendering."
fi
fi

# keep container running
exec "$@"
3 changes: 1 addition & 2 deletions puffertank.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ RUN echo "export PS1=$''" >> ~/.bashrc \
&& echo "alias diff='diff --color --palette=':ad=36:de=31:ln=33''" >> ~/.bashrc \
&& echo "alias pip='uv pip'" >> ~/.bashrc \
&& echo ". /puffertank/venv/bin/activate" >> ~/.bashrc \
&& echo "cd /puffertank/pufferlib" >> ~/.bashrc \
&& echo "export __GLX_VENDOR_LIBRARY_NAME=mesa" >> ~/.bashrc
&& echo "cd /puffertank/pufferlib" >> ~/.bashrc

RUN apt-get clean
CMD ["/bin/bash"]