Skip to content

Commit d95c34f

Browse files
committed
Add vulkan sample image
Signed-off-by: Evan Lezar <[email protected]>
1 parent cf206d6 commit d95c34f

File tree

3 files changed

+71
-2
lines changed

3 files changed

+71
-2
lines changed

.github/workflows/image.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
- deviceQuery
4141
- nvbandwidth
4242
- simpleMultiGPU
43+
- vulkan
4344
exclude:
4445
- dist: ubi9
4546
sample: deviceQuery
@@ -49,6 +50,8 @@ jobs:
4950
sample: nvbandwidth
5051
- dist: ubi9
5152
sample: simpleMultiGPU
53+
- dist: ubi9
54+
sample: vulkan
5255

5356
steps:
5457
- uses: actions/checkout@v4

deployments/container/Makefile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,19 @@ TEST_TARGETS := $(patsubst %,test-%, $(DISTRIBUTIONS))
5555

5656
# Certain samples do not allow multi-arch images. We disable them here.
5757
# TODO: Does it make more sense to set this at a CI-level?
58-
ifeq ($(SAMPLE),nbody)
58+
AMD64_SAMPLES = vulkan
59+
ARM64_SAMPLES =
60+
SINGLE_ARCH_SAMPLES = nbody $(AMD64_SAMPLES) $(ARM64_SAMPLES)
61+
ifeq ($(SAMPLE),$(filter $(SAMPLE),$(SINGLE_ARCH_SAMPLES)))
5962
BUILD_MULTI_ARCH_IMAGES = false
63+
# Certain samples are only supported on AMD64.
64+
ifeq ($(SAMPLE),$(filter $(SAMPLE),$(AMD64_SAMPLES)))
65+
ARCH = amd64
66+
endif
67+
# Certain samples are only supported on AMD64.
68+
ifeq ($(SAMPLE),$(filter $(SAMPLE),$(ARM64_SAMPLES)))
69+
ARCH = arm64
70+
endif
6071
endif
6172

6273
ifneq ($(BUILD_MULTI_ARCH_IMAGES),true)
@@ -87,7 +98,7 @@ endif
8798

8899
build-%: DIST = $(*)
89100
# For the following samples, we use specific Dockerfiles:
90-
ifeq ($(SAMPLE),$(filter $(SAMPLE),nbody nvbandwidth))
101+
ifeq ($(SAMPLE),$(filter $(SAMPLE),nbody nvbandwidth vulkan))
91102
build-%: DOCKERFILE = $(CURDIR)/deployments/container/$(SAMPLE)/Dockerfile
92103
else
93104
build-%: DOCKERFILE = $(CURDIR)/deployments/container/Dockerfile.$(DOCKERFILE_SUFFIX)
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
FROM nvcr.io/nvidia/cuda:12.8.1-base-ubuntu22.04 AS builder
17+
18+
ENV DEBIAN_FRONTEND=noninteractive
19+
RUN apt-get update -y && apt-get install -y --no-install-recommends \
20+
wget \
21+
&& \
22+
rm -rf /var/lib/apt/lists/*
23+
24+
# See instructions from https://vulkan.lunarg.com/doc/sdk/1.4.309.0/linux/getting_started_ubuntu.html
25+
RUN wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | tee /etc/apt/trusted.gpg.d/lunarg.asc \
26+
&& \
27+
wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list http://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list \
28+
&& \
29+
apt update -y \
30+
&& \
31+
apt install -y --no-install-recommends vulkan-sdk \
32+
&& \
33+
rm -rf /var/lib/apt/lists/*
34+
35+
# TODO: Should we include this in the list above.
36+
RUN apt-get update && apt-get install -y --no-install-recommends \
37+
git \
38+
make \
39+
cmake \
40+
pkg-config \
41+
gcc \
42+
g++ \
43+
&& rm -rf /var/lib/apt/lists/*
44+
45+
WORKDIR /build
46+
47+
ARG BUILD_EXAMPLES="computeheadless renderheadless"
48+
ENV BUILD_EXAMPLES=$BUILD_EXAMPLES
49+
50+
# TODO: We should update to the official samples
51+
RUN git clone --recursive https://github.com/SaschaWillems/Vulkan.git \
52+
&& cd Vulkan && mkdir -p build && cd build \
53+
&& cmake .. \
54+
&& make ${BUILD_EXAMPLES}
55+

0 commit comments

Comments
 (0)