Skip to content

Reapply "[CUDA] Fix a couple of driver tests that really weren't bein… #94000

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
May 31, 2024

Conversation

pogo59
Copy link
Collaborator

@pogo59 pogo59 commented May 31, 2024

…g run" (#93988)"

This reverts commit 6416958.
Fix bots by using different options.

…g run" (llvm#93988)"

This reverts commit 6416958.
Fix bots by using different options.
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' labels May 31, 2024
@llvmbot
Copy link
Member

llvmbot commented May 31, 2024

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clang-driver

Author: Paul T Robinson (pogo59)

Changes

…g run" (#93988)"

This reverts commit 6416958.
Fix bots by using different options.


Full diff: https://github.com/llvm/llvm-project/pull/94000.diff

2 Files Affected:

  • (modified) clang/test/Driver/offloading-interoperability.c (+1-4)
  • (modified) clang/test/Driver/openmp-offload-gpu.c (+1-5)
diff --git a/clang/test/Driver/offloading-interoperability.c b/clang/test/Driver/offloading-interoperability.c
index 6f6daf31a392e..67e5ea26ede4d 100644
--- a/clang/test/Driver/offloading-interoperability.c
+++ b/clang/test/Driver/offloading-interoperability.c
@@ -1,10 +1,7 @@
-// REQUIRES: powerpc-registered-target
-// REQUIRES: nvptx-registered-target
-
 //
 // Verify that CUDA device commands do not get OpenMP flags.
 //
-// RUN: not %clang -### -x cuda --target=powerpc64le-linux-gnu -std=c++11 --cuda-gpu-arch=sm_35 -fopenmp=libomp %s 2>&1 \
+// RUN: %clang -### -x cuda --target=powerpc64le-linux-gnu -std=c++11 --cuda-gpu-arch=sm_35 -nocudainc -nocudalib -fopenmp=libomp %s 2>&1 \
 // RUN:   | FileCheck %s --check-prefix NO-OPENMP-FLAGS-FOR-CUDA-DEVICE
 //
 // NO-OPENMP-FLAGS-FOR-CUDA-DEVICE:      "-cc1" "-triple" "nvptx64-nvidia-cuda"
diff --git a/clang/test/Driver/openmp-offload-gpu.c b/clang/test/Driver/openmp-offload-gpu.c
index d21db7019a1aa..0b98aaf6ba53c 100644
--- a/clang/test/Driver/openmp-offload-gpu.c
+++ b/clang/test/Driver/openmp-offload-gpu.c
@@ -2,11 +2,6 @@
 /// Perform several driver tests for OpenMP offloading
 ///
 
-// REQUIRES: x86-registered-target
-// REQUIRES: powerpc-registered-target
-// REQUIRES: nvptx-registered-target
-// REQUIRES: amdgpu-registered-target
-
 /// ###########################################################################
 
 /// Check -Xopenmp-target uses one of the archs provided when several archs are used.
@@ -305,6 +300,7 @@
 // CHECK-EMIT-LLVM-IR-BC: "-cc1"{{.*}}"-triple" "nvptx64-nvidia-cuda"{{.*}}"-emit-llvm-bc"
 
 // RUN:   %clang -### -fopenmp=libomp --offload-arch=sm_89 \
+// RUN:          --no-cuda-version-check \
 // RUN:          -nogpulib %s -o openmp-offload-gpu 2>&1 \
 // RUN:   | FileCheck -check-prefix=DRIVER_EMBEDDING %s
 

@pogo59 pogo59 merged commit 3b81d9d into llvm:main May 31, 2024
6 of 8 checks passed
@erichkeane
Copy link
Collaborator

I've been having this fail in my local build for a few days now:

******************** TEST 'Clang :: Driver/offloading-interoperability.c' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 4: /local/home/ekeane/llvm-project/build/bin/clang -### -x cuda --target=powerpc64le-linux-gnu -std=c++11 --cuda-gpu-arch=sm_35 -nocudainc -nocudalib -fopenmp=libomp /local/home/ekeane/llvm-project/clang/test/Driver/offloading-interoperability.c 2>&1    | /local/home/ekeane/llvm-project/build/bin/FileCheck /local/home/ekeane/llvm-project/clang/test/Driver/offloading-interoperability.c --check-prefix NO-OPENM
P-FLAGS-FOR-CUDA-DEVICE
+ /local/home/ekeane/llvm-project/build/bin/clang -### -x cuda --target=powerpc64le-linux-gnu -std=c++11 --cuda-gpu-arch=sm_35 -nocudainc -nocudalib -fopenmp=libomp /local/home/ekeane/llvm-project/clang/test/Driver/offloading-interoperability.c
+ /local/home/ekeane/llvm-project/build/bin/FileCheck /local/home/ekeane/llvm-project/clang/test/Driver/offloading-interoperability.c --check-prefix NO-OPENMP-FLAGS-FOR-CUDA-DEVICE

--

********************

I've got an AMD epyc machine, so I don't think it is a machine problem, but also the output doesn't really tell me anything?

@pogo59
Copy link
Collaborator Author

pogo59 commented Jun 3, 2024

Yeah lit is not so good at this; it means clang exited with an error, but lit is somehow eating the error message. @erichkeane If you could run that clang command manually and report the output, that would be extremely helpful.

@erichkeane
Copy link
Collaborator

Bizarrely if I run the piped version, I get no error:

ekeane@dev-epyc4:/local/home/ekeane/llvm-project/build$ /local/home/ekeane/llvm-project/build/bin/clang -### -x cuda --target=powerpc64le-linux-gnu -std=c++11 --cuda-gpu-arch=sm_35 -nocudainc -nocudalib -fopenmp=libomp /local/home/ekeane/llvm-project/clang/test/Driver/offloading-interoperability.c 2>&1    | /local/home/ekeane/llvm-project/build/bin/FileCheck /local/home/ekeane/llvm-project/clang/test/Driver/offloading-in
teroperability.c --check-prefix NO-OPENMP-FLAGS-FOR-CUDA-DEVICE
ekeane@dev-epyc4:/local/home/ekeane/llvm-project/build$ echo $?
0

Not piped version I get:

ekeane@dev-epyc4:/local/home/ekeane/llvm-project/build$ /local/home/ekeane/llvm-project/build/bin/clang -### -x cuda --target=powerpc64le-linux-gnu -std=c++11 --cuda-gpu-arch=sm_35 -nocudainc -nocudalib -fopenmp=libomp /local/home/ekeane/llvm-project/clang/test/Driver/offloading-interoperability.c
clang version 19.0.0git (https://github.com/erichkeane/llvm-project.git a7356fdfa7973e19008fda95c8e1e6ed7ac049d3)
Target: powerpc64le-unknown-linux-gnu
Thread model: posix
InstalledDir: /local/home/ekeane/llvm-project/build/bin
Build config: +unoptimized, +assertions
clang: error: GPU arch sm_35 is supported by CUDA versions between 7.0 and 11.8 (inclusive), but installation at /usr/local/cuda is 12.3; use '--cuda-path' to specify a different CUDA install, pass a different GPU arch with '--cuda-gpu-arch', or pass '--no-cuda-version-check'
 "/local/home/ekeane/llvm-project/build/bin/clang-19" "-cc1" "-triple" "nvptx64-nvidia-cuda" "-aux-triple" "powerpc64le-unknown-linux-gnu" "-S" "-dumpdir" "a-" "-disable-free" "-clear-ast-before-backend" "-main-file-name" "offloading-interoperability.c" "-mrelocation-model" "static" "-mframe-pointer=all" "-fno-rounding-math" "-no-integrated-as" "-aux-target-cpu" "ppc64le" "-fcuda-is-device" "-mllvm" "-enable-memcpyopt-wi
thout-libcalls" "-fcuda-allow-variadic-functions" "-target-cpu" "sm_35" "-target-feature" "+ptx83" "-debugger-tuning=gdb" "-fno-dwarf-directory-asm" "-fdebug-compilation-dir=/local/home/ekeane/llvm-project/build" "-resource-dir" "/local/home/ekeane/llvm-project/build/lib/clang/19" "-internal-isystem" "/local/home/ekeane/llvm-project/build/lib/clang/19/include/cuda_wrappers" "-internal-isystem" "/local/home/ekeane/llvm-pr
oject/build/lib/clang/19/include/ppc_wrappers" "-internal-isystem" "/local/home/ekeane/llvm-project/build/lib/clang/19/include" "-internal-isystem" "/usr/local/include" "-internal-externc-isystem" "/include" "-internal-externc-isystem" "/usr/include" "-internal-isystem" "/local/home/ekeane/llvm-project/build/lib/clang/19/include/ppc_wrappers" "-internal-isystem" "/local/home/ekeane/llvm-project/build/lib/clang/19/include
" "-internal-isystem" "/usr/local/include" "-internal-externc-isystem" "/include" "-internal-externc-isystem" "/usr/include" "-std=c++11" "-fdeprecated-macro" "-fno-autolink" "-ferror-limit" "19" "-nogpulib" "-fno-signed-char" "-fgnuc-version=4.2.1" "-fskip-odr-check-in-gmf" "-fcxx-exceptions" "-fexceptions" "-fcolor-diagnostics" "-cuid=24ba0afc7304b70d" "-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o" "/tmp/offloading-interoperabil
ity-sm_35-6a2c33.s" "-x" "cuda" "/local/home/ekeane/llvm-project/clang/test/Driver/offloading-interoperability.c"
 "/usr/local/cuda/bin/ptxas" "-m64" "-O0" "--gpu-name" "sm_35" "--output-file" "/tmp/offloading-interoperability-sm_35-618b9f.cubin" "/tmp/offloading-interoperability-sm_35-6a2c33.s"
 "/usr/local/cuda/bin/fatbinary" "-64" "--create" "/tmp/offloading-interoperability-02eb3f.fatbin" "--image=profile=sm_35,file=/tmp/offloading-interoperability-sm_35-618b9f.cubin" "--image=profile=compute_35,file=/tmp/offloading-interoperability-sm_35-6a2c33.s"
 "/local/home/ekeane/llvm-project/build/bin/clang-19" "-cc1" "-triple" "powerpc64le-unknown-linux-gnu" "-target-sdk-version=12.3" "-fcuda-allow-variadic-functions" "-aux-triple" "nvptx64-nvidia-cuda" "-emit-obj" "-dumpdir" "a-" "-disable-free" "-clear-ast-before-backend" "-main-file-name" "offloading-interoperability.c" "-mrelocation-model" "pic" "-pic-level" "2" "-pic-is-pie" "-mframe-pointer=all" "-fmath-errno" "-ffp-c
ontract=on" "-fno-rounding-math" "-mconstructor-aliases" "-funwind-tables=2" "-target-cpu" "ppc64le" "-mfloat-abi" "hard" "-target-abi" "elfv2" "-debugger-tuning=gdb" "-fdebug-compilation-dir=/local/home/ekeane/llvm-project/build" "-fcoverage-compilation-dir=/local/home/ekeane/llvm-project/build" "-resource-dir" "/local/home/ekeane/llvm-project/build/lib/clang/19" "-internal-isystem" "/local/home/ekeane/llvm-project/buil
d/lib/clang/19/include/cuda_wrappers" "-internal-isystem" "/local/home/ekeane/llvm-project/build/lib/clang/19/include/ppc_wrappers" "-internal-isystem" "/local/home/ekeane/llvm-project/build/lib/clang/19/include" "-internal-isystem" "/usr/local/include" "-internal-externc-isystem" "/include" "-internal-externc-isystem" "/usr/include" "-internal-isystem" "/local/home/ekeane/llvm-project/build/lib/clang/19/include/ppc_wrap
pers" "-internal-isystem" "/local/home/ekeane/llvm-project/build/lib/clang/19/include" "-internal-isystem" "/usr/local/include" "-internal-externc-isystem" "/include" "-internal-externc-isystem" "/usr/include" "-std=c++11" "-fdeprecated-macro" "-ferror-limit" "19" "-fopenmp" "-nogpulib" "-fno-signed-char" "-fgnuc-version=4.2.1" "-fskip-odr-check-in-gmf" "-fcxx-exceptions" "-fexceptions" "-fcolor-diagnostics" "-fcuda-incl
ude-gpubinary" "/tmp/offloading-interoperability-02eb3f.fatbin" "-cuid=24ba0afc7304b70d" "-faddrsig" "-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o" "/tmp/offloading-interoperability-a9c0fb.o" "-x" "cuda" "/local/home/ekeane/llvm-project/clang/test/Driver/offloading-interoperability.c"
 "/usr/bin/ld" "-z" "relro" "--hash-style=gnu" "--eh-frame-hdr" "-m" "elf64lppc" "-pie" "-dynamic-linker" "/lib64/ld64.so.2" "-o" "a.out" "Scrt1.o" "crti.o" "crtbeginS.o" "-L/lib/../lib64" "-L/usr/lib/../lib64" "-L/lib" "-L/usr/lib" "/tmp/offloading-interoperability-a9c0fb.o" "-lomp" "-L/local/home/ekeane/llvm-project/build/lib" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lpthread" "-lc" "-lgcc" "--as-needed" "-lg
cc_s" "--no-as-needed" "crtendS.o" "crtn.o"

@pogo59
Copy link
Collaborator Author

pogo59 commented Jun 3, 2024

If you add --no-cuda-version-check does the error go away?

@erichkeane
Copy link
Collaborator

Yep! I added it to the 'run' line as well, and adding it there fixes the test on my machine. So I suspect that would be the fix?

pogo59 added a commit to pogo59/llvm-project that referenced this pull request Jun 3, 2024
See llvm#94000 for a report of a downstream failure, this fixes it.
@pogo59 pogo59 mentioned this pull request Jun 3, 2024
pogo59 added a commit that referenced this pull request Jun 3, 2024
See #94000 for a report of a downstream failure, this fixes it.
@pogo59
Copy link
Collaborator Author

pogo59 commented Jun 3, 2024

Let's hope so! Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants