|
| 1 | +diff --git a/Dockerfile b/Dockerfile |
| 2 | +index 5366c8ab7..4f32f0213 100644 |
| 3 | +--- a/Dockerfile |
| 4 | ++++ b/Dockerfile |
| 5 | +@@ -23,7 +23,6 @@ |
| 6 | + ARG ONNX_RUNTIME_VERSION=1.15.1_23.08 |
| 7 | + ARG LIBTORCH_VERSION=2.1.0_23.08 |
| 8 | + ARG TORCHVISION_VERSION=0.16.0_23.08 |
| 9 | +-ARG VULKAN_SDK_VERSION=1.3.216.0 |
| 10 | + ARG GRPC_VERSION=1.54.2 |
| 11 | + ARG UCX_VERSION=1.15.0 |
| 12 | + ARG GXF_VERSION=4.0_20240409_bc03d9d |
| 13 | +@@ -123,29 +122,6 @@ RUN ARCH=$(uname -m) && if [ "$ARCH" = "aarch64" ]; then ARCH="${ARCH}-${GPU_TYP |
| 14 | + RUN mkdir -p ${TORCHVISION_VERSION} |
| 15 | + RUN tar -xf torchvision.tgz -C ${TORCHVISION_VERSION} --strip-components 1 |
| 16 | + |
| 17 | +-############################################################ |
| 18 | +-# Vulkan SDK |
| 19 | +-# |
| 20 | +-# Use the SDK because we need the newer Vulkan headers and the newer shader compiler than provided |
| 21 | +-# by the Ubuntu deb packages. These are compile time dependencies, we still use the Vulkan loaded |
| 22 | +-# and the Vulkan validation layer as runtime components provided by Ubuntu packages because that's |
| 23 | +-# what the user will have on their installations. |
| 24 | +-############################################################ |
| 25 | +-FROM build-tools as vulkansdk-builder |
| 26 | +-ARG VULKAN_SDK_VERSION |
| 27 | +- |
| 28 | +-WORKDIR /opt/vulkansdk |
| 29 | +- |
| 30 | +-# Note there is no aarch64 binary version to download, therefore for aarch64 we also download the x86_64 version which |
| 31 | +-# includes the source. Then remove the binaries and e7ab9314build the aarch64 version from source. |
| 32 | +-RUN curl -S -# -O -L https://sdk.lunarg.com/sdk/download/${VULKAN_SDK_VERSION}/linux/vulkansdk-linux-x86_64-${VULKAN_SDK_VERSION}.tar.gz |
| 33 | +-RUN tar -xzf vulkansdk-linux-x86_64-${VULKAN_SDK_VERSION}.tar.gz |
| 34 | +-RUN if [ $(uname -m) = "aarch64" ]; then \ |
| 35 | +- cd ${VULKAN_SDK_VERSION} \ |
| 36 | +- && rm -rf x86_64 \ |
| 37 | +- && ./vulkansdk shaderc glslang headers; \ |
| 38 | +- fi |
| 39 | +- |
| 40 | + ############################################################ |
| 41 | + # gRPC libraries and binaries |
| 42 | + ############################################################ |
| 43 | +@@ -275,18 +251,6 @@ ENV TORCHVISION=/opt/torchvision/${TORCHVISION_VERSION} |
| 44 | + COPY --from=torchvision-downloader ${TORCHVISION} ${TORCHVISION} |
| 45 | + ENV CMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}:${TORCHVISION}" |
| 46 | + |
| 47 | +-# Copy Vulkan SDK |
| 48 | +-ARG VULKAN_SDK_VERSION |
| 49 | +-ENV VULKAN_SDK=/opt/vulkansdk/${VULKAN_SDK_VERSION} |
| 50 | +-COPY --from=vulkansdk-builder ${VULKAN_SDK}/x86_64/ ${VULKAN_SDK} |
| 51 | +-# We need to use the headers and shader compiler of the SDK but want to link against the |
| 52 | +-# Vulkan loader provided by the Ubuntu package. Therefore create a link in the SDK directory |
| 53 | +-# pointing to the system Vulkan loader library. |
| 54 | +-RUN rm -f ${VULKAN_SDK}/lib/libvulkan.so* \ |
| 55 | +- && ln -s /lib/$(uname -m)-linux-gnu/libvulkan.so.1 ${VULKAN_SDK}/lib/libvulkan.so |
| 56 | +-ENV PATH="${PATH}:${VULKAN_SDK}/bin" |
| 57 | +-ENV CMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}:${VULKAN_SDK}" |
| 58 | +- |
| 59 | + # Copy gRPC |
| 60 | + ARG GRPC_VERSION |
| 61 | + ENV GRPC=/opt/grpc/${GRPC_VERSION} |
| 62 | +@@ -327,8 +291,8 @@ RUN install -m 0755 -d /etc/apt/keyrings \ |
| 63 | + # valgrind - static analysis |
| 64 | + # xvfb - testing on headless systems |
| 65 | + # libx* - X packages |
| 66 | +-# libvulkan1 - for Vulkan apps (Holoviz) |
| 67 | +-# vulkan-validationlayers, spirv-tools - for Vulkan validation layer (enabled for Holoviz in debug mode) |
| 68 | ++# libvulkan-dev, glslang-tools - for Vulkan apps (Holoviz) |
| 69 | ++# vulkan-validationlayers - for Vulkan validation layer (enabled for Holoviz in debug mode) |
| 70 | + # libwayland-dev, libxkbcommon-dev, pkg-config - GLFW compile dependency for Wayland support |
| 71 | + # libdecor-0-plugin-1-cairo - GLFW runtime dependency for Wayland window decorations |
| 72 | + # libegl1 - to run headless Vulkan apps |
| 73 | +@@ -349,9 +313,9 @@ RUN apt-get update \ |
| 74 | + libxi-dev="2:1.8-*" \ |
| 75 | + libxinerama-dev="2:1.1.4-*" \ |
| 76 | + libxrandr-dev="2:1.5.2-*" \ |
| 77 | +- libvulkan1="1.3.204.1-*" \ |
| 78 | ++ libvulkan-dev="1.3.204.1-*" \ |
| 79 | ++ glslang-tools="11.8.0+1.3.204.0-*" \ |
| 80 | + vulkan-validationlayers="1.3.204.1-*" \ |
| 81 | +- spirv-tools="2022.1+1.3.204.0-*" \ |
| 82 | + libwayland-dev="1.20.0-*" \ |
| 83 | + libxkbcommon-dev="1.4.0-*" \ |
| 84 | + pkg-config="0.29.2-*" \ |
| 85 | +diff --git a/modules/holoviz/src/glfw_window.cpp b/modules/holoviz/src/glfw_window.cpp |
| 86 | +index a2eaec0c1..6d40e5a5b 100644 |
| 87 | +--- a/modules/holoviz/src/glfw_window.cpp |
| 88 | ++++ b/modules/holoviz/src/glfw_window.cpp |
| 89 | +@@ -261,7 +261,9 @@ vk::SurfaceKHR GLFWWindow::create_surface(vk::PhysicalDevice physical_device, |
| 90 | + VkSurfaceKHR surface; |
| 91 | + const vk::Result result = |
| 92 | + vk::Result(glfwCreateWindowSurface(instance, impl_->window_, nullptr, &surface)); |
| 93 | +- vk::resultCheck(result, "Failed to create glfw window surface"); |
| 94 | ++ if (result != vk::Result::eSuccess) { |
| 95 | ++ vk::throwResultException(result, "Failed to create glfw window surface"); |
| 96 | ++ } |
| 97 | + return surface; |
| 98 | + } |
| 99 | + |
| 100 | +diff --git a/modules/holoviz/src/vulkan/vulkan_app.cpp b/modules/holoviz/src/vulkan/vulkan_app.cpp |
| 101 | +index b398cf97c..d91db9da9 100644 |
| 102 | +--- a/modules/holoviz/src/vulkan/vulkan_app.cpp |
| 103 | ++++ b/modules/holoviz/src/vulkan/vulkan_app.cpp |
| 104 | +@@ -1333,7 +1333,7 @@ void Vulkan::Impl::cleanup_transfer_jobs() { |
| 105 | + |
| 106 | + it->fence_triggered_ = true; |
| 107 | + } else if (result != vk::Result::eNotReady) { |
| 108 | +- vk::resultCheck(result, "Failed to get upload fence status"); |
| 109 | ++ vk::throwResultException(result, "Failed to get upload fence status"); |
| 110 | + } |
| 111 | + } |
| 112 | + |
| 113 | +@@ -1351,7 +1351,7 @@ void Vulkan::Impl::cleanup_transfer_jobs() { |
| 114 | + it = next; |
| 115 | + continue; |
| 116 | + } else if (result != vk::Result::eNotReady) { |
| 117 | +- vk::resultCheck(result, "Failed to get frame fence status"); |
| 118 | ++ vk::throwResultException(result, "Failed to get frame fence status"); |
| 119 | + } |
| 120 | + } else { |
| 121 | + // this is a stale transfer buffer (no end_transfer_pass()?), remove it |
| 122 | +@@ -1382,7 +1382,7 @@ void Vulkan::Impl::prepare_frame() { |
| 123 | + if (result != vk::Result::eSuccess) { |
| 124 | + // This allows Aftermath to do things and exit below |
| 125 | + usleep(1000); |
| 126 | +- vk::resultCheck(result, "Failed to wait for frame fences"); |
| 127 | ++ vk::throwResultException(result, "Failed to wait for frame fences"); |
| 128 | + exit(-1); |
| 129 | + } |
| 130 | + |
| 131 | +@@ -1414,7 +1414,9 @@ void Vulkan::Impl::submit_frame() { |
| 132 | + |
| 133 | + const vk::Result result = |
| 134 | + vk::Result(nvvk_.batch_submission_.execute(wait_fences_[image_index].get(), 0b0000'0001)); |
| 135 | +- vk::resultCheck(result, "Failed to execute bach submission"); |
| 136 | ++ if (result != vk::Result::eSuccess) { |
| 137 | ++ vk::throwResultException(result, "Failed to execute bach submission"); |
| 138 | ++ } |
| 139 | + |
| 140 | + // Presenting frame |
| 141 | + fb_sequence_.present(queue_gct_); |
| 142 | +@@ -2514,7 +2516,7 @@ void Vulkan::Impl::read_framebuffer(ImageFormat fmt, uint32_t width, uint32_t he |
| 143 | + if (result != vk::Result::eSuccess) { |
| 144 | + // This allows Aftermath to do things and exit below |
| 145 | + usleep(1000); |
| 146 | +- vk::resultCheck(result, "Failed to wait for frame fences"); |
| 147 | ++ vk::throwResultException(result, "Failed to wait for frame fences"); |
| 148 | + exit(-1); |
| 149 | + } |
| 150 | + |
| 151 | +@@ -2569,7 +2571,9 @@ void Vulkan::Impl::read_framebuffer(ImageFormat fmt, uint32_t width, uint32_t he |
| 152 | + // submit the command buffer |
| 153 | + const vk::Result result = |
| 154 | + vk::Result(nvvk_.batch_submission_.execute(read_job.fence_.get(), 0b0000'0001)); |
| 155 | +- vk::resultCheck(result, "Failed to execute bach submission"); |
| 156 | ++ if (result != vk::Result::eSuccess) { |
| 157 | ++ vk::throwResultException(result, "Failed to execute bach submission"); |
| 158 | ++ } |
| 159 | + |
| 160 | + // copy the buffer to CUDA memory |
| 161 | + { |
0 commit comments