Skip to content

Commit

Permalink
feat: added files required for Nvidia Container toolkit
Browse files Browse the repository at this point in the history
Allows ensure-groups to also work on normal files/folders
  • Loading branch information
ABeltramo committed Nov 21, 2023
1 parent 1bef802 commit 81f9b52
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 5 deletions.
65 changes: 65 additions & 0 deletions images/base-app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,71 @@ RUN apt-get update -y && \
$REQUIRED_PACKAGES && \
rm -rf /var/lib/apt/lists/*

###########
# NVIDIA
###
# Expose NVIDIA libraries and paths
ENV PATH /usr/local/nvidia/bin:${PATH}
ENV LD_LIBRARY_PATH /usr/lib/x86_64-linux-gnu:/usr/lib/i386-linux-gnu${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}:/usr/local/nvidia/lib:/usr/local/nvidia/lib64
# Make all NVIDIA GPUs visible by default
ENV NVIDIA_VISIBLE_DEVICES all
# All NVIDIA driver capabilities should preferably be used, check `NVIDIA_DRIVER_CAPABILITIES` inside the container if things do not work
ENV NVIDIA_DRIVER_CAPABILITIES all
# Disable VSYNC for NVIDIA GPUs
ENV __GL_SYNC_TO_VBLANK 0

COPY <<-EOT /usr/share/glvnd/egl_vendor.d/10_nvidia.json
{
"file_format_version" : "1.0.0",
"ICD" : {
"library_path" : "libEGL_nvidia.so.0"
}
}
EOT

COPY <<-EOT /usr/share/glvnd/egl_vendor.d/10_nvidia.json
{
"file_format_version" : "1.0.0",
"ICD" : {
"library_path" : "libEGL_nvidia.so.0"
}
}
EOT

COPY <<-EOT /etc/vulkan/icd.d/nvidia_icd.json
{
"file_format_version" : "1.0.0",
"ICD": {
"library_path": "libGLX_nvidia.so.0",
"api_version" : "1.3.205"
}
}
EOT

COPY <<-EOT /etc/OpenCL/vendors/nvidia.icd
libnvidia-opencl.so.1
EOT

COPY <<-EOT /usr/share/egl/egl_external_platform.d/15_nvidia_gbm.json
{
"file_format_version" : "1.0.0",
"ICD" : {
"library_path" : "libnvidia-egl-gbm.so.1"
}
}
EOT

COPY <<-EOT /usr/share/egl/egl_external_platform.d/10_nvidia_wayland.json
{
"file_format_version" : "1.0.0",
"ICD" : {
"library_path" : "libnvidia-egl-wayland.so.1"
}
}
EOT

###########

#################################
# GAMESCOPE
####
Expand Down
5 changes: 0 additions & 5 deletions images/base/overlay/opt/gow/ensure-groups
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ source /opt/gow/bash-lib/utils.sh
declare -A group_map

for dev in "$@"; do
# Only process $dev if it's a character device
if [ ! -c "$dev" ]; then
continue
fi

dev_group=$(stat -c "%G" "$dev")
dev_gid=$(stat -c "%g" "$dev")

Expand Down

0 comments on commit 81f9b52

Please sign in to comment.