Skip to content

Commit bb08e96

Browse files
zkoopmansgvisor-bot
authored andcommitted
Make GPU smoke tests work on ARM
PiperOrigin-RevId: 781128259
1 parent 237f2d7 commit bb08e96

File tree

3 files changed

+37
-12
lines changed

3 files changed

+37
-12
lines changed

images/gpu/cuda-tests-12-8/Dockerfile.x86_64 renamed to images/gpu/cuda-tests-12-8/Dockerfile

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,26 @@ RUN export DEBIAN_FRONTEND=noninteractive; \
2323
mpich \
2424
pkg-config \
2525
vim \
26+
wget \
2627
x11-xserver-utils \
2728
xdotool \
2829
xvfb \
29-
zlib1g zlib1g-dev
30+
zlib1g zlib1g-dev \
31+
&& apt -y purge 'golang*'
3032

3133
RUN git clone --depth=1 --branch=v12.8 --single-branch \
3234
https://github.com/NVIDIA/cuda-samples.git /cuda-samples && cd /cuda-samples
3335

34-
RUN apt install -y wget && apt -y purge golang*
35-
36-
RUN wget https://go.dev/dl/go1.24.1.linux-amd64.tar.gz && \
37-
tar -C /usr/local -xzf go1.24.1.linux-amd64.tar.gz && \
38-
ln -s /usr/local/go/bin/go /usr/local/bin/go
39-
4036
ADD *.cu *.h *.sh *.go *.cc /
4137

42-
RUN chmod 555 /*.sh && gcc -o /unsupported_ioctl /unsupported_ioctl.cc && \
38+
RUN chmod 555 /*.sh && /install_go.sh && rm /install_go.sh && \
39+
gcc -o /unsupported_ioctl /unsupported_ioctl.cc && \
4340
go install \
4441
github.com/TheZoraiz/ascii-image-converter@d05a757c5e02ab23e97b6f6fca4e1fbeb10ab559 && \
4542
mv "$HOME/go/bin/ascii-image-converter" /usr/bin/ && \
46-
go build -o /run_sample /run_sample.go
47-
48-
RUN mkdir /cuda-samples/build && cd /cuda-samples/build && \
49-
cmake ..
43+
go build -o /run_sample /run_sample.go && \
44+
mkdir /cuda-samples/build && cd /cuda-samples/build && \
45+
cmake ..
5046

5147
# Override entrypoint to nothing, otherwise all invocations will have
5248
# a copyright notice printed, which breaks parsing the stdout logs.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
# Copyright 2025 The gVisor Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
ARCH="amd64"
18+
19+
if [[ "$(uname -m)" == "aarch64" ]]; then
20+
ARCH="arm64"
21+
fi
22+
23+
wget "https://go.dev/dl/go1.24.1.linux-${ARCH}.tar.gz" && \
24+
tar -C /usr/local -xzf "go1.24.1.linux-${ARCH}.tar.gz" && \
25+
ln -s /usr/local/go/bin/go /usr/local/bin/go

test/gpu/smoke_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package smoke_test
1717

1818
import (
1919
"context"
20+
"runtime"
2021
"strings"
2122
"testing"
2223

@@ -48,6 +49,9 @@ func TestNvidiaSmi(t *testing.T) {
4849

4950
func TestGPUHello(t *testing.T) {
5051
ctx := context.Background()
52+
if strings.HasPrefix(runtime.GOARCH, "arm") {
53+
t.Skip("Test does not cross compile on arm")
54+
}
5155
runGPUHello(ctx, t, "gpu/cuda-tests")
5256
}
5357

0 commit comments

Comments
 (0)