samdauwe / webgpu-native-examples

Collection of C-language examples that demonstrate basic rendering and computation in WebGPU native.
Apache License 2.0
373 stars 21 forks source link

CMake version mismatched for Dawn #10

Closed goldragoon closed 1 year ago

goldragoon commented 1 year ago

I tried to build examples inside of the docker image like : bash ./build.sh -webgpu_native_examples

But build procedure suddenly stops by below error :

-- Dawn: using SPIRV-Headers at /webgpu-native-examples/external/dawn/dawn/third_party/vulkan-deps/spirv-headers/src
-- Dawn: using SPIRV-Tools at /webgpu-native-examples/external/dawn/dawn/third_party/vulkan-deps/spirv-tools/src
CMake Error at external/dawn/dawn/third_party/vulkan-deps/spirv-tools/src/CMakeLists.txt:15 (cmake_minimum_required):  CMake 3.17.2 or higher is required.  You are running version 3.16.3

image

I think command for installing more recent version of CMake is required for the docker file

like (it works for me!) :

# Ubuntu 20.04 (Focal Fossa)
FROM ubuntu:20.04

# reference : https://www.softwarepronto.com/2022/09/dockerubuntu-installing-latest-cmake-on.html
RUN apt-get update \
  && apt-get -y install build-essential \
  && apt-get install -y wget \
  && rm -rf /var/lib/apt/lists/* \
  && wget https://github.com/Kitware/CMake/releases/download/v3.24.1/cmake-3.24.1-Linux-x86_64.sh \
      -q -O /tmp/cmake-install.sh \
      && chmod u+x /tmp/cmake-install.sh \
      && mkdir /opt/cmake-3.24.1 \
      && /tmp/cmake-install.sh --skip-license --prefix=/opt/cmake-3.24.1 \
      && rm /tmp/cmake-install.sh \
      && ln -s /opt/cmake-3.24.1/bin/* /usr/local/bin

# Install dependencies
RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive apt-get install -yq \
        sudo \
        wget \
        git ca-certificates openssl \
        # Dev
        pkg-config build-essential python3 \
        # X11 / XCB
        libxi-dev libxcursor-dev libxinerama-dev libxrandr-dev mesa-common-dev \
        xcb libxcb-xkb-dev x11-xkb-utils libx11-xcb-dev libxkbcommon-x11-dev \
        # Libav
        libavdevice-dev \
        # Vulkan
        libvulkan1 libvulkan-dev mesa-vulkan-drivers vulkan-utils

# Remove sudoer password
RUN echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
samdauwe commented 1 year ago

Hello goldragoon,

thanks for reporting this issue and for providing the fix for the cmake version issue. I updated the docker file in this commit. The latest Dawn version seems to need a recent cmake version, good that the issue is resolved now.

With best regards, Sam

goldragoon commented 1 year ago

Thanks for fast update!