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

Segmentation fault on clGetPlatformIds #125

Open
KosmasF opened this issue Dec 24, 2024 · 2 comments
Open

Segmentation fault on clGetPlatformIds #125

KosmasF opened this issue Dec 24, 2024 · 2 comments

Comments

@KosmasF
Copy link

KosmasF commented Dec 24, 2024

The code:
cl_int ret = clGetPlatformIDs(0, nullptr, &ret_num_platforms);

AddressSanitizer:DEADLYSIGNAL

==5083==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000008 (pc 0x7dbd45d0aa7f bp 0x7ffca79b71b0 sp 0x7ffca79b5140 T0)
==5083==The signal is caused by a READ memory access.
==5083==Hint: address points to the zero page.
#0 0x7dbd45d0aa7f in Intel::OpenCL::Framework::PlatformModule::GetPlatformInfo(_cl_platform_id*, unsigned int, unsigned long, void*, unsigned long*) /netbatch/donb41412_00/runDir/93/20180921_000000/llvm/projects/opencl/utils/cl_sys_utils/export/cl_shared_ptr.h:361
#1 0x7dbd45c6239d in clGetPlatformInfo /netbatch/donb41412_00/runDir/93/20180921_000000/llvm/projects/opencl/framework/cl_framework.cpp:330
#2 0x7dbd4a805cda (/usr/lib/libOpenCL.so.1+0xbcda) (BuildId: 8236fcb4223c046c8dd27fd62d9398c0a5b5beb4)
#3 0x7dbd4a80727c (/usr/lib/libOpenCL.so.1+0xd27c) (BuildId: 8236fcb4223c046c8dd27fd62d9398c0a5b5beb4)
#4 0x7dbd4a809354 in clGetPlatformIDs (/usr/lib/libOpenCL.so.1+0xf354) (BuildId: 8236fcb4223c046c8dd27fd62d9398c0a5b5beb4)
#5 0x575a8dc54f21 in Setup() /home/usr/Documents/Chess/OpenCL/GPU.cpp:114
#6 0x575a8dc54b57 in GPU() /home/usr/Documents/Chess/OpenCL/GPU.cpp:12
#7 0x575a8dc7f86a in __static_initialization_and_destruction_0 /home/usr/Documents/Physics/player.h:52
#8 0x575a8dc7f992 in _GLOBAL__sub_I__Z13Signals_Setupv /home/usr/Documents/Physics/Signals.cpp:28
#9 0x7dbd49034f43 in __libc_start_main (/usr/lib/libc.so.6+0x25f43) (BuildId: 98b3d8e0b8c534c769cb871c438b4f8f3a8e4bf3)
#10 0x575a8dc54a44 in _start (/home/usr/Documents/Physics/main+0x4ea44) (BuildId: ddc9e1e8133d801b815c1a6de299a4a1418f75f3)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /netbatch/donb41412_00/runDir/93/20180921_000000/llvm/projects/opencl/utils/cl_sys_utils/export/cl_shared_ptr.h:361 in Intel::OpenCL::Framework::PlatformModule::GetPlatformInfo(_cl_platform_id*, unsigned int, unsigned long, vo

Code is built from this repo for arch linux

@bashbaug
Copy link
Contributor

bashbaug commented Jan 7, 2025

Hi, it's not clear to me what you are running to produce this output. Can you please provide more detail?

If possible, can you also please provide information about the OpenCL devices in your system? You can find this by running clinfo, which is built as part of the OpenCL SDK, and is also provided by many OS package managers. For now, it's OK to just list the platforms and devices on your system with clinfo -l. For example:

$ clinfo -l
Platform #0: Intel(R) OpenCL
 `-- Device #0: 12th Gen Intel(R) Core(TM) i9-12900K

@KosmasF
Copy link
Author

KosmasF commented Jan 15, 2025

Minimum reproducible example:

#include <CL/cl.h>

int main() {
    cl_uint ret_num_platforms = 0;
    cl_int ret = clGetPlatformIDs(0, nullptr, &ret_num_platforms);

    return 0;
}

Also regarding hardware:

Platform #0: Intel(R) OpenCL Graphics
 `-- Device #0: Intel(R) Iris(R) Xe Graphics
Platform #1: Intel(R) CPU Runtime for OpenCL(TM) Applications
 `-- Device #0: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
Platform #2: rusticl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants