Skip to content
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

CTS stream_api_core test segfault #3588

Closed
alexbatashev opened this issue Apr 21, 2021 · 10 comments
Closed

CTS stream_api_core test segfault #3588

alexbatashev opened this issue Apr 21, 2021 · 10 comments
Labels
bug Something isn't working CTS Impacts Khronos SYCL CTS cuda CUDA back-end runtime Runtime library related issue

Comments

@alexbatashev
Copy link
Contributor

alexbatashev commented Apr 21, 2021

Describe the bug
stream_api_core test results in segmentation fault:

--- stream_api_core
hello world!hello world!c9999, 9999, 99, 9999, 99, 99, 99999999, 9999, 99, 999955  5  5  5  5  5  5 -5 +5 -5  5  55.00000e+005.00000e+00  5Segmentation fault (core dumped)

To Reproduce
Note: Due to a recent uplift of minimal supported C++ standard, one should modify this line to require C++17.

  1. Get SYCL with CUDA support (GSG) and SYCL-CTS
  2. Build CTS tests
cd SYCL-CTS
mkdir build && cd build
cmake -GNinja  -DSYCL_IMPLEMENTATION=Intel_SYCL -DINTEL_SYCL_ROOT=<path to built sycl> -Dopencl_platform_name=nvidia -Dopencl_device_name=opencl_gpu -DCMAKE_BUILD_TYPE=Release -DINTEL_SYCL_FLAGS="-Xsycl-target-backend;--cuda-gpu-arch=sm_50" -DCMAKE_EXE_LINKER_FLAGS=" -Wl,-no-relax " -DINTEL_SYCL_TRIPLE=nvptx64-nvidia-cuda-sycldevice -DSYCL_CTS_ENABLE_OPENCL_INTEROP_TESTS=Off -DSYCL_CTS_ENABLE_DOUBLE_TESTS=On -DSYCL_CTS_ENABLE_HALF_TESTS=On ..
ninja test_stream
  1. Run tests
./bin/test_stream -p nvidia -d opencl_gpu  --test stream_api_core

Environment:

OS version: Ubuntu 18.04.5 LTS (Bionic Beaver)
CUDA version:

nvidia-smi

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 435.21       Driver Version: 435.21       CUDA Version: 10.1     |
|-------------------------------+----------------------+----------------------+

Additional context
Backtrace:

#0  0x00007ffff533d10f in ?? () from /usr/lib/x86_64-linux-gnu/libcuda.so.1
#1  0x00007ffff5220ce1 in ?? () from /usr/lib/x86_64-linux-gnu/libcuda.so.1
#2  0x00007ffff538e9a0 in cuCtxSetCurrent () from /usr/lib/x86_64-linux-gnu/libcuda.so.1
#3  0x00007ffff62cf2a4 in (anonymous namespace)::ScopedContext::ScopedContext(_pi_context*) ()
   from lib/libpi_cuda.so
#4  0x00007ffff62d1fdb in cuda_piEventsWait ()
   from lib/libpi_cuda.so
#5  0x00007ffff7a73277 in cl::sycl::detail::event_impl::waitInternal() const ()
   from lib/libsycl.so.5
#6  0x00007ffff7ae9c58 in cl::sycl::detail::DispatchHostTask::operator()() const ()
   from lib/libsycl.so.5
#7  0x00007ffff7aca006 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<cl::sycl::detail::ThreadPool::start()::{lambda()#1}> > >::_M_run() () from lib/libsycl.so.5
#8  0x00007ffff738b15f in std::execute_native_thread_routine (__p=0x12e38e0) at ../../../../../gcc-7.5.0/libstdc++-v3/src/c++11/thread.cc:83
#9  0x00007ffff65076db in start_thread (arg=0x7fffd4ffd700) at pthread_create.c:463
#10 0x00007ffff6a4471f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
@alexbatashev alexbatashev added bug Something isn't working cuda CUDA back-end CTS Impacts Khronos SYCL CTS labels Apr 21, 2021
@steffenlarsen
Copy link
Contributor

That definitely shouldn't happen! Do you have the specific commits you're working off of, for both intel/llvm and the CTS?

@alexbatashev
Copy link
Contributor Author

@steffenlarsen I used SYCL build from 04/16 (should be around this tag https://github.com/intel/llvm/releases/tag/sycl-nightly%2F20210416) and the latest CTS, that I checked out today.

@steffenlarsen
Copy link
Contributor

Thank you! I'm currently trying to build as instructed, but I'm getting some errors. Just to make sure I'm not trying to fix the wrong problems, are you on SYCL-1.2.1/master or SYCL-2020 of the CTS?

@alexbatashev
Copy link
Contributor Author

Thank you! I'm currently trying to build as instructed, but I'm getting some errors. Just to make sure I'm not trying to fix the wrong problems, are you on SYCL-1.2.1/master or SYCL-2020 of the CTS?

I'm on SYCL-1.2.1/master. I just checked again. Due to a recent uplift of minimal requirements, some headers are no longer compatible with C++11. So, I modified this line some time ago and completely forgot about it. I'll update both reports.

BTW, the issue is also reproducible on March SYCL builds, but I didn't check with older versions.

@steffenlarsen
Copy link
Contributor

That did the trick, thanks! I am able to reproduce the issue and will do some investigation.

@bader
Copy link
Contributor

bader commented Apr 22, 2021

@alexbatashev, can you switch to SYCL-2020 branch, please?
I think recent DPC++ changes might make it incompatible with SYCL-1.2.1/master branch.

The C++ version has been updated in the SYCL-2020 branch https://github.com/KhronosGroup/SYCL-CTS/blob/SYCL-2020/CMakeLists.txt#L5.

@alexbatashev
Copy link
Contributor Author

Switching to SYCL-2020 branch fixes C++17 issue, but the test still segfaults

@AerialMantis AerialMantis added the runtime Runtime library related issue label Aug 23, 2021
@npmiller
Copy link
Contributor

I'm not able to reproduce this, are you still seeing these crashes?

Looking at the stack trace I highly suspect this was fixed as part of: #4442

We might be able to close this ticket.

@bader
Copy link
Contributor

bader commented Nov 30, 2021

@yuxianch, could you confirm that stream test is passing on Linux, please?

@yuxianch
Copy link

yuxianch commented Dec 1, 2021

Yes, the stream test stream_api_core is passing on Linux with latest compiler(https://github.com/intel/llvm.git 7700edb) and CUDA backend.

@bader bader closed this as completed Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CTS Impacts Khronos SYCL CTS cuda CUDA back-end runtime Runtime library related issue
Projects
None yet
Development

No branches or pull requests

6 participants