Skip to content

Make GPU smoke tests work on ARM #11876

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,26 @@ RUN export DEBIAN_FRONTEND=noninteractive; \
mpich \
pkg-config \
vim \
wget \
x11-xserver-utils \
xdotool \
xvfb \
zlib1g zlib1g-dev
zlib1g zlib1g-dev \
&& apt -y purge 'golang*'

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

RUN apt install -y wget && apt -y purge golang*

RUN wget https://go.dev/dl/go1.24.1.linux-amd64.tar.gz && \
tar -C /usr/local -xzf go1.24.1.linux-amd64.tar.gz && \
ln -s /usr/local/go/bin/go /usr/local/bin/go

ADD *.cu *.h *.sh *.go *.cc /

RUN chmod 555 /*.sh && gcc -o /unsupported_ioctl /unsupported_ioctl.cc && \
RUN chmod 555 /*.sh && /install_go.sh && rm /install_go.sh && \
gcc -o /unsupported_ioctl /unsupported_ioctl.cc && \
go install \
github.com/TheZoraiz/ascii-image-converter@d05a757c5e02ab23e97b6f6fca4e1fbeb10ab559 && \
mv "$HOME/go/bin/ascii-image-converter" /usr/bin/ && \
go build -o /run_sample /run_sample.go

RUN mkdir /cuda-samples/build && cd /cuda-samples/build && \
cmake ..
go build -o /run_sample /run_sample.go && \
mkdir /cuda-samples/build && cd /cuda-samples/build && \
cmake ..

# Override entrypoint to nothing, otherwise all invocations will have
# a copyright notice printed, which breaks parsing the stdout logs.
Expand Down
25 changes: 25 additions & 0 deletions images/gpu/cuda-tests-12-8/install_go.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# Copyright 2025 The gVisor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

ARCH="amd64"

if [[ "$(uname -m)" == "aarch64" ]]; then
ARCH="arm64"
fi

wget "https://go.dev/dl/go1.24.1.linux-${ARCH}.tar.gz" && \
tar -C /usr/local -xzf "go1.24.1.linux-${ARCH}.tar.gz" && \
ln -s /usr/local/go/bin/go /usr/local/bin/go
4 changes: 4 additions & 0 deletions test/gpu/smoke_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package smoke_test

import (
"context"
"runtime"
"strings"
"testing"

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

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

Expand Down
Loading