Skip to content

clang: Remove requires system-linux from some driver tests #111976

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 10 commits into from
Nov 14, 2024
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
2 changes: 1 addition & 1 deletion clang/test/Driver/amdgpu-hip-system-arch.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// REQUIRES: system-linux
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The compile & test on line 47 is failing on z/OS with the following message:

clang: error: cannot determine amdgcn architecture: No AMD GPU detected in the system; consider passing it via '--offload-arch'; environment variable CLANG_TOOLCHAIN_PROGRAM_TIMEOUT specifies the tool timeout (integer secs, <=0 is infinite)

I'm not sure if there is a way to fix this (eg. wildcard in the expected output or a compiler option). If there isn't can you add:

UNSUPPORTED: system-zos

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can't really be a property of zos or any other system. It works for me on systems without AMDGPUs and other OSes. You are seeing the error after the environment variable parse error, so why did this proceed beyond that point?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should have been line 26. The error is causing the failure. The env var isn't set for that compilation.

// REQUIRES: shell
// XFAIL: target={{.*}}-zos{{.*}}

// RUN: mkdir -p %t
// RUN: cp %S/Inputs/amdgpu-arch/amdgpu_arch_fail %t/
Expand Down
1 change: 0 additions & 1 deletion clang/test/Driver/amdgpu-openmp-system-arch-fail.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// REQUIRES: system-linux
// REQUIRES: shell

// RUN: mkdir -p %t
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/nvptx-cuda-system-arch.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// REQUIRES: system-linux
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is failing on z/OS on line 28 (ARCH_sm70 check). The actual cc1 line is:

clang: warning: CUDA version is newer than the latest partially supported version 12.5 [-Wunknown-cuda-version]
clang: error: cannot determine nvptx64 architecture: No NVIDIA GPU detected in the system; consider passing it via '--offload-arch'; environment variable CLANG_TOOLCHAIN_PROGRAM_TIMEOUT specifies the tool timeout (integer secs, <=0 is infinite)
 "/plex/perry/llvm/Woz/build/bin/clang-20" "-cc1" "-triple" "nvptx64-nvidia-cuda" "-aux-triple" "x86_64-unknown-linux-gnu" "-S" "-dumpdir" "a-" "-disable-free" "-clear-ast-before-backend" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "nvptx-cuda-system-arch.c" "-mrelocation-model" "static" "-mframe-pointer=all" "-fno-rounding-math" "-no-integrated-as" "-aux-target-cpu" "x86-64" "-fcuda-is-device" "-mllvm" "-enable-memcpyopt-without-libcalls" "-fcuda-allow-variadic-functions" "-target-cpu" "sm_52" "-target-feature" "+ptx85" "-debugger-tuning=gdb" "-fno-dwarf-directory-asm" "-fdebug-compilation-dir=/plex/perry/llvm/Woz/llvm-project/clang/test/Driver" "-resource-dir" "/plex/perry/llvm/Woz/build/lib/clang/20" "-internal-isystem" "/plex/perry/llvm/Woz/build/lib/clang/20/include/cuda_wrappers" "-include" "__clang_cuda_runtime_wrapper.h" "-internal-isystem" "/plex/perry/llvm/Woz/build/lib/clang/20/include" "-internal-isystem" "/usr/local/include" "-internal-externc-isystem" "/include" "-internal-externc-isystem" "/usr/include" "-internal-isystem" "/plex/perry/llvm/Woz/llvm-project/clang/test/Driver/Inputs/CUDA_102/usr/local/cuda/include" "-internal-isystem" "/plex/perry/llvm/Woz/build/lib/clang/20/include" "-internal-isystem" "/usr/local/include" "-internal-externc-isystem" "/include" "-internal-externc-isystem" "/usr/include" "-fdeprecated-macro" "-fno-autolink" "-ferror-limit" "19" "-nogpulib" "-fgnuc-version=4.2.1" "-mno-csect" "-fskip-odr-check-in-gmf" "-fcxx-exceptions" "-fexceptions" "-fexec-charset" "UTF-8" "-fcolor-diagnostics" "-cuid=15151f95f8ae4b17" "-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o" "/plex/perry/tmp/nvptx-cuda-system-arch-sm_52-77f5c9.s" "-x" "cuda" "/plex/perry/llvm/Woz/llvm-project/clang/test/Driver/nvptx-cuda-system-arch.c"

This has sm_52 as the target_gpu instead of sm_70. Can you either fix it or add:

UNSUPPORTED: system-zos

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The result should definitely be sm_70, that's what the provided script produces

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. By fixing it, I was referring to the code in clang that determines this value. If it's easy to make the test pass on z/OS great. If not marking it as unsupported works too. This applies to my other comment too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the output from a shell script in clang/test/Driver/Inputs/nvptx-arch/nvptx_arch_sm_70

How could the zos test find a different result

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm looking into that question. The first thing I noticed was the temp file is being created and read as a binary file. I also noticed that the output of the script is not being redirected into the temp file. I'll get a PR up to fix these problems once I get it solved.

I think that mean the only issue on z/OS is not related to these tests. Could you mark the 3 failing tests as XFAIL for system-zos. I'll remove that once I have the problem fixed.

// REQUIRES: shell
// XFAIL: target={{.*}}-zos{{.*}}

// RUN: mkdir -p %t
// RUN: cp %S/Inputs/nvptx-arch/nvptx_arch_fail %t/
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/openmp-system-arch.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// REQUIRES: system-linux
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is failing on z/OS on line 33 with the error:

clang: error: failed to deduce triple for target architecture 'native'; specify the triple using '-fopenmp-targets' and '-Xopenmp-target' instead

Not deducing the target gpu causes wrong -target-cpu to be specified.

If it can be fixed great. If not can you add:

UNSUPPORTED: system-zos

// REQUIRES: shell
// XFAIL: target={{.*}}-zos{{.*}}

// RUN: mkdir -p %t
// RUN: cp %S/Inputs/amdgpu-arch/amdgpu_arch_fail %t/
Expand Down