mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Update cuda-tests for ARM workloads
Add image for ARM workloads for cuda-tests and mark tests that work on ARM. Most tests don't work due to cross-compiling between sbma and aarch64. However, a few do. Add an image to support them.
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
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 []
|
||||
+38
-2
@@ -69,6 +69,16 @@ var (
|
||||
containersPerCPU = flag.Float64("cuda_containers_per_cpu", defaultContainersPerCPU, "number of parallel execution containers to spawn per CPU (floating point values allowed)")
|
||||
)
|
||||
|
||||
var testSuiteCompatibility = map[string]Compatibility{
|
||||
"0_Introduction": &NoCrossCompile{},
|
||||
"1_Utilities": &NoCrossCompile{},
|
||||
"2_Concepts_and_Techniques": &NoCrossCompile{},
|
||||
"3_CUDA_Features": &NoCrossCompile{},
|
||||
"4_CUDA_Libraries": &NoCrossCompile{},
|
||||
"5_Domain_Specific": &NoCrossCompile{},
|
||||
"6_Performance": &NoCrossCompile{},
|
||||
}
|
||||
|
||||
// testCompatibility maps test names to their compatibility data.
|
||||
// Unmapped test names are assumed to be fully compatible.
|
||||
var testCompatibility = map[string]Compatibility{
|
||||
@@ -371,6 +381,23 @@ func (*RequiresNvSci) IsExpectedFailure(ctx context.Context, env *TestEnvironmen
|
||||
return nil
|
||||
}
|
||||
|
||||
type NoCrossCompile struct{}
|
||||
|
||||
func (*NoCrossCompile) WillFail(ctx context.Context, env *TestEnvironment) string {
|
||||
return "Test not supported on ARM. Cross compiled libraries not supported."
|
||||
}
|
||||
|
||||
func (*NoCrossCompile) IsExpectedFailure(ctx context.Context, env *TestEnvironment, logs string, _ int ) error {
|
||||
if !strings.HasPrefix(runtime.GOARCH, "arm") {
|
||||
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
|
||||
}
|
||||
|
||||
// multiCompatibility implements `Compatibility` with multiple possible
|
||||
// Compatibility implementations.
|
||||
type multiCompatibility struct {
|
||||
@@ -574,8 +601,17 @@ func GetEnvironment(ctx context.Context, t *testing.T) (*TestEnvironment, error)
|
||||
// It returns a skip reason (or empty if the test was not skipped), and
|
||||
// an error if the test fails.
|
||||
func runSampleTest(ctx context.Context, t *testing.T, testName string, te *TestEnvironment, cp *dockerutil.ContainerPool) (string, error) {
|
||||
compat, found := testCompatibility[testName]
|
||||
if !found {
|
||||
compatibilities := []Compatibility{}
|
||||
if compat, found := testCompatibility[testName]; found {
|
||||
compatibilities = append(compatibilities, compat)
|
||||
}
|
||||
for suite, comp := range testSuiteCompatibility {
|
||||
if strings.HasPrefix(testName, suite) {
|
||||
compatibilities = append(compatibilities, comp)
|
||||
}
|
||||
}
|
||||
compat := MultiCompatibility(compatibilities...)
|
||||
if len(compatibilities) == 0 {
|
||||
compat = &FullyCompatible{}
|
||||
}
|
||||
willFailReason := compat.WillFail(ctx, te)
|
||||
|
||||
Reference in New Issue
Block a user