Fix broken cuda tests

PiperOrigin-RevId: 734342887
This commit is contained in:
Zach Koopmans
2025-03-06 17:11:19 -08:00
committed by gVisor bot
parent d01514263b
commit 4ce00d28f6
3 changed files with 7 additions and 53 deletions
-46
View File
@@ -1,46 +0,0 @@
FROM nvidia/cuda:12.2.2-devel-ubuntu22.04
# From: https://github.com/NVIDIA/cuda-samples/releases
# Ideally, pick a release that matches the CUDA version of the image above.
ARG CUDA_SAMPLES_VERSION=v12.2
WORKDIR /
COPY *.cu *.h *.sh *.go *.cc /
ENV PATH=$PATH:/usr/local/nvidia/bin
RUN export DEBIAN_FRONTEND=noninteractive; \
apt-get update && \
apt-get install -y \
build-essential \
cmake \
freeglut3 freeglut3-dev \
git \
golang \
imagemagick \
libegl-dev \
libfreeimage3 libfreeimage-dev \
libfreeimageplus3 libfreeimageplus-dev \
libgles2-mesa-dev \
libglfw3 libglfw3-dev \
libglu1-mesa libglu1-mesa-dev \
libxi-dev \
libxmu-dev \
llvm \
mpich \
pkg-config \
x11-xserver-utils \
xdotool \
xvfb \
zlib1g zlib1g-dev \
&& \
chmod 555 /*.sh && \
git clone --depth=1 --branch="$CUDA_SAMPLES_VERSION" --single-branch \
https://github.com/NVIDIA/cuda-samples.git /cuda-samples && \
go install \
github.com/TheZoraiz/ascii-image-converter@d05a757c5e02ab23e97b6f6fca4e1fbeb10ab559 && \
mv "$HOME/go/bin/ascii-image-converter" /usr/bin/ && \
gcc -o /unsupported_ioctl /unsupported_ioctl.cc && \
go build -o /run_sample /run_sample.go
# Override entrypoint to nothing, otherwise all invocations will have
# a copyright notice printed, which breaks parsing the stdout logs.
ENTRYPOINT []
+7 -7
View File
@@ -384,18 +384,18 @@ func (*RequiresNvSci) IsExpectedFailure(ctx context.Context, env *TestEnvironmen
type NoCrossCompile struct{}
func (*NoCrossCompile) WillFail(ctx context.Context, env *TestEnvironment) string {
return "Test not supported on ARM. Cross compiled libraries not supported."
if strings.HasPrefix(runtime.GOARCH, "arm") {
return "Test not supported on ARM. Cross compiled libraries not supported."
}
return ""
}
func (*NoCrossCompile) IsExpectedFailure(ctx context.Context, env *TestEnvironment, logs string, _ int) error {
if !strings.HasPrefix(runtime.GOARCH, "arm") {
crossCompileString := "cross compiling from sbsa to aarch64 is not supported!"
if strings.Contains(logs, crossCompileString) {
return nil
}
crossCompileString := "cross compiling from sbsa to aarch64 is not supported!"
if strings.Contains(logs, "") {
return fmt.Errorf("found string in logs: %s", crossCompileString)
}
return nil
return fmt.Errorf("expected log message %q not found: logs: %q", crossCompileString, logs)
}
// multiCompatibility implements `Compatibility` with multiple possible