Skip to content

Commit

Permalink
Updated swiftshader image to rebuild with latest
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro Saucedo <[email protected]>
  • Loading branch information
axsaucedo committed Nov 20, 2022
1 parent 57ffe86 commit 26c5dc8
Showing 1 changed file with 24 additions and 15 deletions.
39 changes: 24 additions & 15 deletions docker-builders/Swiftshader.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
FROM ubuntu:18.04

ARG VULKAN_SDK_VERSION

# Using FROM reference as COPY command doesn't support args
FROM axsauze/vulkan-sdk:$VULKAN_SDK_VERSION as vulkansdk-image

# Ubuntu as actual image base
FROM ubuntu:22.04

# Repeating ARG for context in this image
ARG VULKAN_SDK_VERSION

# Base packages from default ppa
RUN apt-get update -y
Expand All @@ -7,28 +17,27 @@ RUN apt-get install -y gnupg
RUN apt-get install -y ca-certificates
RUN apt-get install -y software-properties-common

# Repository to latest cmake
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add -
RUN apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main'

# Repository for latest git (needed for gh actions)
RUN add-apt-repository -y ppa:git-core/ppa

# Refresh repositories
RUN apt update -y

# Build dependencies
RUN apt install -y git
RUN apt-get install -y cmake g++
RUN apt-get install -y libvulkan-dev

# Setup Vulkan
ENV VULKAN_SDK="/VulkanSDK/${VULKAN_SDK_VERSION}/x86_64"
ENV PATH="${VULKAN_SDK}/bin:${PATH}"
ENV LD_LIBRARY_PATH="${VULKAN_SDK}/lib"
ENV VK_LAYER_PATH="${VULKAN_SDK}/etc/explicit_layer.d"

COPY --from=vulkansdk-image ${VULKAN_SDK} ${VULKAN_SDK}

# Dependencies for swiftshader
RUN apt-get install -y g++-8 gcc-8
# RUN apt-get install -y g++-8 gcc-8
RUN apt-get install -y gcc
RUN apt-get install -y libx11-dev zlib1g-dev
RUN apt-get install -y libxext-dev

# Run swiftshader via env VK_ICD_FILENAMES=/swiftshader/vk_swiftshader_icd.json
RUN git clone https://github.com/google/swiftshader swiftshader-build
RUN CC="/usr/bin/gcc-8" CXX="/usr/bin/g++-8" cmake swiftshader-build/. -Bswiftshader-build/build/
RUN cmake --build swiftshader-build/build/. --parallel
RUN cmake swiftshader-build/. -Bswiftshader-build/build/
RUN cmake --build swiftshader-build/build/. --parallel 8
RUN cp -r swiftshader-build/build/Linux/ swiftshader/

0 comments on commit 26c5dc8

Please sign in to comment.