llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.26k stars 12.09k forks source link

libomptarget :: nvptx64-nvidia-cuda test failures: error: unknown type name '__off_t' #50679

Open Meinersbur opened 3 years ago

Meinersbur commented 3 years ago
Bugzilla Link 51337
Version unspecified
OS Linux
CC @JonChesterfield,@pdhaliwal-amd

Extended Description

The following tests fail since https://reviews.llvm.org/rG713a5d12cde58a5dff90cc3e2d1e67c2a78fe52f / https://reviews.llvm.org/D104904 "[OpenMP][AMDGCN] Initial math headers support"

FAIL: libomptarget :: nvptx64-nvidia-cuda::omp_get_num_devices.c FAIL: libomptarget :: nvptx64-nvidia-cuda::omp_device_managed_memory.c FAIL: libomptarget :: nvptx64-nvidia-cuda::omp_host_pinned_memory.c FAIL: libomptarget :: nvptx64-nvidia-cuda::data_absent_at_exit.c FAIL: libomptarget :: nvptx64-nvidia-cuda::omp_get_num_devices_with_empty_target.c FAIL: libomptarget :: nvptx64-nvidia-cuda::delete_inf_refcount.c FAIL: libomptarget :: nvptx64-nvidia-cuda::pr38704.c FAIL: libomptarget :: nvptx64-nvidia-cuda::target_array_extension.c FAIL: libomptarget :: nvptx64-nvidia-cuda::target.c FAIL: libomptarget :: nvptx64-nvidia-cuda::target_data.c FAIL: libomptarget :: nvptx64-nvidia-cuda::target_data_array_extension.c FAIL: libomptarget :: nvptx64-nvidia-cuda::target_enter_data.c

First buildbot failures

openmp-offloading-cuda-project: http://meinersbur.de:8011/#/builders/1/builds/118 openmp-offloading-cuda-runtime: http://meinersbur.de:8011/#/builders/117/builds/102

One of the error messages

**** TEST 'libomptarget :: nvptx64-nvidia-cuda :: mapping/present/target.c' FAILED **** Script:

: 'RUN: at line 1'; /home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.build/./bin/clang -fopenmp -fno-experimental-isel --cuda-path=/usr/local/cuda -I /home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.src/openmp/libomptarget/test -I /home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.build/runtimes/runtimes-bins/openmp/libomptarget -L /home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -fopenmp-targets=nvptx64-nvidia-cuda /home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.src/openmp/libomptarget/test/mapping/present/target.c -o /home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.build/runtimes/runtimes-bins/openmp/libomptarget/test/nvptx64-nvidia-cuda/mapping/present/Output/target.c.tmp -fopenmp-version=51 : 'RUN: at line 2'; /home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.build/./bin/not --crash /home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.build/runtimes/runtimes-bins/openmp/libomptarget/test/nvptx64-nvidia-cuda/mapping/present/Output/target.c.tmp 2>&1 | /home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.build/./bin/FileCheck /home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.src/openmp/libomptarget/test/mapping/present/target.c

Exit Code: 1 Command Output (stdout):

$ ":" "RUN: at line 1" note: command had no output on stdout or stderr $ "/home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.build/./bin/clang" "-fopenmp" "-fno-experimental-isel" "--cuda-path=/usr/local/cuda" "-I" "/home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.src/openmp/libomptarget/test" "-I" "/home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src" "-L" "/home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.build/runtimes/runtimes-bins/openmp/libomptarget" "-L" "/home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src" "-fopenmp-targets=nvptx64-nvidia-cuda" "/home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.src/openmp/libomptarget/test/mapping/present/target.c" "-o" "/home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.build/runtimes/runtimes-bins/openmp/libomptarget/test/nvptx64-nvidia-cuda/mapping/present/Output/target.c.tmp" "-fopenmp-version=51"

command stderr:

clang-14: warning: Unknown CUDA version. cuda.h: CUDA_VERSION=11040. Assuming the latest supported version 10.1 [-Wunknown-cuda-version] In file included from /home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.src/openmp/libomptarget/test/mapping/present/target.c:6: In file included from /usr/include/stdio.h:39: /usr/include/x86_64-linux-gnu/bits/types/fpos_t.h:12:3: error: unknown type name '__off_t' off_t pos; ^ In file included from /home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.src/openmp/libomptarget/test/mapping/present/target.c:6: In file included from /usr/include/stdio.h:40: /usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h:12:3: error: unknown type name 'off64_t' off64_t pos; ^ In file included from /home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.src/openmp/libomptarget/test/mapping/present/target.c:6: In file included from /usr/include/stdio.h:43: /usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h:74:3: error: unknown type name 'off_t' off_t _old_offset; / This used to be _offset but it's too small. / ^ /usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h:89:3: error: unknown type name 'off64_t' off64_t _offset; ^ In file included from /home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.src/openmp/libomptarget/test/mapping/present/target.c:6: /usr/include/stdio.h:63:9: error: unknown type name 'off_t' typedef off_t off_t; ^ /usr/include/stdio.h:77:9: error: unknown type name 'ssize_t'; did you mean 'size_t'? typedef ssize_t ssize_t; ^ /home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.build/lib/clang/14.0.0/include/stddef.h:46:23: note: 'size_t' declared here typedef SIZE_TYPE__ size_t; ^ In file included from /home/buildbot-worker/minipc-1050ti-linux/openmp-offload-cuda-runtime/llvm.src/openmp/libomptarget/test/mapping/present/target.c:6: /usr/include/stdio.h:603:8: error: unknown type name 'ssize_t'; did you mean 'ssize_t'? extern ssize_t getdelim (char **restrict __lineptr, ^ /usr/include/stdio.h:77:19: note: 'ssize_t' declared here typedef ssize_t ssize_t; ^ /usr/include/stdio.h:606:8: error: unknown type name 'ssize_t'; did you mean 'ssize_t'? extern ssize_t getdelim (char restrict lineptr, ^ /usr/include/stdio.h:77:19: note: 'ssize_t' declared here typedef ssize_t ssize_t; ^ /usr/include/stdio.h:616:8: error: unknown type name 'ssize_t'; did you mean 'ssize_t'? extern __ssize_t getline (char restrict lineptr, ^ /usr/include/stdio.h:77:19: note: 'ssize_t' declared here typedef ssize_t ssize_t; ^ /usr/include/stdio.h:707:36: error: unknown type name 'off_t' extern int fseeko (FILE stream, off_t off, int whence); ^ /usr/include/stdio.h:712:8: error: unknown type name '__off_t' extern __off_t ftello (FILE stream) wur; ^ 11 errors generated. error: command failed with exit status: 1


pdhaliwal-amd commented 3 years ago

I have created a phab review [1] for the fix. Locally on nvptx machine, I was able to reproduce it. And wrapping the declare variant with ifdef fixed the problem.

[1] https://reviews.llvm.org/D107468

JonChesterfield commented 3 years ago

We're fairly sure at this point that the declare variant construct used in those headers for amdgpu is not working, as wrapping one of them in #ifdef fixed compilation of on nvptx.

There's another declare variant guarding includes of stdbool, stdint and a hip header which does not have the (nominally) redundant ifdef around it, going to try wrapping that locally.