Skip to content

Commit

Permalink
[NFC][SYCL] Set some target restrictions for some tests (#12505)
Browse files Browse the repository at this point in the history
A few tests in the driver area require amdgpu or nvptx targets to be
built in order to properly run. Add these requirements to the tests.
  • Loading branch information
mdtoguchi authored Jan 29, 2024
1 parent 2f56926 commit a934d57
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions clang/test/Driver/sycl-offload-amdgcn.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/// Tests specific to `-fsycl-targets=amdgcn-amd-amdhsa`

// UNSUPPORTED: system-windows
// REQUIRES: amdgpu-registered-target

// Check that the offload arch is required
// RUN: not %clangxx -### -std=c++11 -target x86_64-unknown-linux-gnu -fsycl \
Expand Down
2 changes: 2 additions & 0 deletions clang/test/Driver/sycl-triple-dae-flags.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// REQUIRES: nvptx-registered-target, amdgpu-registered-target

// RUN: %clangxx -### -fsycl -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx906 -fsycl-dead-args-optimization -nogpulib %s 2> %t.rocm.out
// RUN: FileCheck %s --input-file %t.rocm.out
// CHECK-NOT: -fenable-sycl-dae
Expand Down
2 changes: 2 additions & 0 deletions clang/test/Driver/sycl-unsupported-arch.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// REQUIRES: amdgpu-registered-target

/// Verify that compiler passes are correctly determined
// RUN: %clangxx -fsycl -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfx600 -nogpulib -c -ccc-print-phases %s 2>&1 | FileCheck %s --check-prefix=CHECK-PHASES
// CHECK-PHASES: offload, "device-sycl (amdgcn-amd-amdhsa:gfx600)"
Expand Down

2 comments on commit a934d57

@aelovikov-intel
Copy link
Contributor

Choose a reason for hiding this comment

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

CUDA testing on self-hosted runner failed in nightly testing on this commit:

Failed Tests (2):
  SYCL :: Assert/assert_in_multiple_tus.cpp
  SYCL :: Assert/assert_in_multiple_tus_one_ndebug.cpp
FAIL: SYCL :: Assert/assert_in_multiple_tus.cpp (36 of [18](https://github.com/intel/llvm/actions/runs/7705678196/job/21000305638#step:21:19)52)
******************** TEST 'SYCL :: Assert/assert_in_multiple_tus.cpp' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 9
/__w/llvm/llvm/toolchain/bin//clang++   -fsycl -fsycl-targets=nvptx64-nvidia-cuda /__w/llvm/llvm/llvm/sycl/test-e2e/Assert/assert_in_multiple_tus.cpp -DSYCL_FALLBACK_ASSERT=1 -I /__w/llvm/llvm/llvm/sycl/test-e2e/Assert/Inputs /__w/llvm/llvm/llvm/sycl/test-e2e/Assert/Inputs/kernels_in_file2.cpp -o /__w/llvm/llvm/build-e2e/Assert/Output/assert_in_multiple_tus.cpp.tmp.out
# executed command: /__w/llvm/llvm/toolchain/bin//clang++ -fsycl -fsycl-targets=nvptx64-nvidia-cuda /__w/llvm/llvm/llvm/sycl/test-e2e/Assert/assert_in_multiple_tus.cpp -DSYCL_FALLBACK_ASSERT=1 -I /__w/llvm/llvm/llvm/sycl/test-e2e/Assert/Inputs /__w/llvm/llvm/llvm/sycl/test-e2e/Assert/Inputs/kernels_in_file2.cpp -o /__w/llvm/llvm/build-e2e/Assert/Output/assert_in_multiple_tus.cpp.tmp.out
# note: command had no output on stdout or stderr
# RUN: at line 10
env SYCL_PI_CUDA_ENABLE_IMAGE_SUPPORT=1 ONEAPI_DEVICE_SELECTOR=cuda:gpu  /__w/llvm/llvm/build-e2e/Assert/Output/assert_in_multiple_tus.cpp.tmp.out &> /__w/llvm/llvm/build-e2e/Assert/Output/assert_in_multiple_tus.cpp.tmp.txt ; /__w/llvm/llvm/toolchain/bin/FileCheck /__w/llvm/llvm/llvm/sycl/test-e2e/Assert/assert_in_multiple_tus.cpp --input-file /__w/llvm/llvm/build-e2e/Assert/Output/assert_in_multiple_tus.cpp.tmp.txt
# executed command: env SYCL_PI_CUDA_ENABLE_IMAGE_SUPPORT=1 ONEAPI_DEVICE_SELECTOR=cuda:gpu /__w/llvm/llvm/build-e2e/Assert/Output/assert_in_multiple_tus.cpp.tmp.out
# .---redirected output from '/__w/llvm/llvm/build-e2e/Assert/Output/assert_in_multiple_tus.cpp.tmp.txt'
# | 
# | UR CUDA ERROR:
# | 	Value:           710
# | 	Name:            CUDA_ERROR_ASSERT
# | 	Description:     device-side assert triggered
# | 	Function:        buildProgram
# | 	Source Location: /__w/llvm/llvm/build/_deps/unified-runtime-src/source/adapters/cuda/program.cpp:149
# | 
# | terminate called after throwing an instance of 'sycl::_V1::compile_program_error'
# |   what():  The program was built for 1 devices
# | Build program log for 'NVIDIA GeForce RTX 3090':
# |  -999 (Unknown PI error)
# `-----------------------------
# note: command had no output on stdout or stderr
# error: command failed with exit status: -6
# executed command: /__w/llvm/llvm/toolchain/bin/FileCheck /__w/llvm/llvm/llvm/sycl/test-e2e/Assert/assert_in_multiple_tus.cpp --input-file /__w/llvm/llvm/build-e2e/Assert/Output/assert_in_multiple_tus.cpp.tmp.txt
# .---command stderr------------
# | /__w/llvm/llvm/llvm/sycl/test-e2e/Assert/assert_in_multiple_tus.cpp:15:11: error: CHECK: expected string not found in input
# | // CHECK: {{.*}}kernels_in_file2.cpp:15: int calculus(int): {{global id: \[5|block: \[1}},0,0], {{local id|thread}}: [1,0,0]
# |           ^
# | /__w/llvm/llvm/build-e2e/Assert/Output/assert_in_multiple_tus.cpp.tmp.txt:1:1: note: scanning from here
# | 
# | ^
# | 
# | Input file: /__w/llvm/llvm/build-e2e/Assert/Output/assert_in_multiple_tus.cpp.tmp.txt
# | Check file: /__w/llvm/llvm/llvm/sycl/test-e2e/Assert/assert_in_multiple_tus.cpp
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |           1:  
# | check:15     X error: no match found
# |           2: UR CUDA ERROR: 
# | check:15     ~~~~~~~~~~~~~~~
# |           3:  Value: 710 
# | check:15     ~~~~~~~~~~~~
# |           4:  Name: CUDA_ERROR_ASSERT 
# | check:15     ~~~~~~~~~~~~~~~~~~~~~~~~~
# |           5:  Description: device-side assert triggered 
# | check:15     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           6:  Function: buildProgram 
# | check:15     ~~~~~~~~~~~~~~~~~~~~~~~~
# |           .
# |           .
# |           .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

********************
FAIL: SYCL :: Assert/assert_in_multiple_tus_one_ndebug.cpp (37 of 1852)
******************** TEST 'SYCL :: Assert/assert_in_multiple_tus_one_ndebug.cpp' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 9
/__w/llvm/llvm/toolchain/bin//clang++   -DSYCL_FALLBACK_ASSERT=1 -fsycl -fsycl-targets=nvptx64-nvidia-cuda -DDEFINE_NDEBUG_INFILE2 -I /__w/llvm/llvm/llvm/sycl/test-e2e/Assert/Inputs /__w/llvm/llvm/llvm/sycl/test-e2e/Assert/assert_in_multiple_tus.cpp /__w/llvm/llvm/llvm/sycl/test-e2e/Assert/Inputs/kernels_in_file2.cpp -o /__w/llvm/llvm/build-e2e/Assert/Output/assert_in_multiple_tus_one_ndebug.cpp.tmp.out
# executed command: /__w/llvm/llvm/toolchain/bin//clang++ -DSYCL_FALLBACK_ASSERT=1 -fsycl -fsycl-targets=nvptx64-nvidia-cuda -DDEFINE_NDEBUG_INFILE2 -I /__w/llvm/llvm/llvm/sycl/test-e2e/Assert/Inputs /__w/llvm/llvm/llvm/sycl/test-e2e/Assert/assert_in_multiple_tus.cpp /__w/llvm/llvm/llvm/sycl/test-e2e/Assert/Inputs/kernels_in_file2.cpp -o /__w/llvm/llvm/build-e2e/Assert/Output/assert_in_multiple_tus_one_ndebug.cpp.tmp.out
# note: command had no output on stdout or stderr
# RUN: at line 11
env SYCL_PI_CUDA_ENABLE_IMAGE_SUPPORT=1 ONEAPI_DEVICE_SELECTOR=cuda:gpu  /__w/llvm/llvm/build-e2e/Assert/Output/assert_in_multiple_tus_one_ndebug.cpp.tmp.out &> /__w/llvm/llvm/build-e2e/Assert/Output/assert_in_multiple_tus_one_ndebug.cpp.tmp.txt ; /__w/llvm/llvm/toolchain/bin/FileCheck /__w/llvm/llvm/llvm/sycl/test-e2e/Assert/assert_in_multiple_tus_one_ndebug.cpp --input-file /__w/llvm/llvm/build-e2e/Assert/Output/assert_in_multiple_tus_one_ndebug.cpp.tmp.txt
# executed command: env SYCL_PI_CUDA_ENABLE_IMAGE_SUPPORT=1 ONEAPI_DEVICE_SELECTOR=cuda:gpu /__w/llvm/llvm/build-e2e/Assert/Output/assert_in_multiple_tus_one_ndebug.cpp.tmp.out
# .---redirected output from '/__w/llvm/llvm/build-e2e/Assert/Output/assert_in_multiple_tus_one_ndebug.cpp.tmp.txt'
# | 
# | UR CUDA ERROR:
# | 	Value:           710
# | 	Name:            CUDA_ERROR_ASSERT
# | 	Description:     device-side assert triggered
# | 	Function:        buildProgram
# | 	Source Location: /__w/llvm/llvm/build/_deps/unified-runtime-src/source/adapters/cuda/program.cpp:149
# | 
# | terminate called after throwing an instance of 'sycl::_V1::compile_program_error'
# |   what():  The program was built for 1 devices
# | Build program log for 'NVIDIA GeForce RTX 3090':
# |  -999 (Unknown PI error)
# `-----------------------------
# note: command had no output on stdout or stderr
# error: command failed with exit status: -6
# executed command: /__w/llvm/llvm/toolchain/bin/FileCheck /__w/llvm/llvm/llvm/sycl/test-e2e/Assert/assert_in_multiple_tus_one_ndebug.cpp --input-file /__w/llvm/llvm/build-e2e/Assert/Output/assert_in_multiple_tus_one_ndebug.cpp.tmp.txt
# .---command stderr------------
# | /__w/llvm/llvm/llvm/sycl/test-e2e/Assert/assert_in_multiple_tus_one_ndebug.cpp:16:11: error: CHECK: expected string not found in input
# | // CHECK: {{.*}}assert_in_multiple_tus.hpp:[20](https://github.com/intel/llvm/actions/runs/7705678196/job/21000305638#step:21:21): int checkFunction(): {{global id: \[5|block: \[1}},0,0],
# |           ^
# | /__w/llvm/llvm/build-e2e/Assert/Output/assert_in_multiple_tus_one_ndebug.cpp.tmp.txt:1:1: note: scanning from here
# | 
# | ^
# | 
# | Input file: /__w/llvm/llvm/build-e2e/Assert/Output/assert_in_multiple_tus_one_ndebug.cpp.tmp.txt
# | Check file: /__w/llvm/llvm/llvm/sycl/test-e2e/Assert/assert_in_multiple_tus_one_ndebug.cpp
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |           1:  
# | check:16     X error: no match found
# |           2: UR CUDA ERROR: 
# | check:16     ~~~~~~~~~~~~~~~
# |           3:  Value: [71](https://github.com/intel/llvm/actions/runs/7705678196/job/21000305638#step:21:72)0 
# | check:16     ~~~~~~~~~~~~
# |           4:  Name: CUDA_ERROR_ASSERT 
# | check:16     ~~~~~~~~~~~~~~~~~~~~~~~~~
# |           5:  Description: device-side assert triggered 
# | check:16     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           6:  Function: buildProgram 
# | check:16     ~~~~~~~~~~~~~~~~~~~~~~~~
# |           .
# |           .
# |           .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

Haven't seen that in the days before the latest run. @intel/llvm-reviewers-cuda does it ring any bells? If not, I'm going to ignore it unless it will fail tomorrow too.

@npmiller
Copy link
Contributor

Choose a reason for hiding this comment

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

Haven't seen that in the days before the latest run. intel/llvm-reviewers-cuda does it ring any bells? If not, I'm going to ignore it unless it will fail tomorrow too.

@aelovikov-intel I'm not sure why they failed there but these tests are notoriously flaky, there's a couple tickets open for them:

Looking at the log it does seem that an assert was correctly triggered, but then the output didn't match what was expected. We might need to just mark them as unsupported.

Please sign in to comment.