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

Enable multithreading to use std::thread: Operation not permitted #283

Closed
servesh opened this issue Nov 14, 2024 · 5 comments · Fixed by #293
Closed

Enable multithreading to use std::thread: Operation not permitted #283

servesh opened this issue Nov 14, 2024 · 5 comments · Fixed by #293
Assignees
Labels
component-intel_gpu PRs and Issues related to the intel_gpu component type-bug Issues discussing bugs or PRs fixing bugs

Comments

@servesh
Copy link

servesh commented Nov 14, 2024

Using latest papi (i.e., papi-7.2.0b1) with the following commands:

$ ./configure --with-components="intel_gpu" CC=gcc
$ make
$ make install

I see,

./papi_avail 
terminate called after throwing an instance of 'std::system_error'
  what():  Enable multithreading to use std::thread: Operation not permitted
Aborted

Passing CFLAGS="-lpthread" doesn't help.

@servesh
Copy link
Author

servesh commented Nov 14, 2024

A workaround for now is to load libpthread.so with ldpreload,

$ LD_PRELOAD=/usr/lib64/libpthread.so ./papi_avail
Available PAPI preset and user defined events plus hardware information.
--------------------------------------------------------------------------------
PAPI version             : 7.2.0.0
Operating system         : Linux 5.14.21-150400.24.55-default
Vendor string and code   : GenuineIntel (1, 0x1)
Model string and code    : Intel(R) Xeon(R) CPU Max 9470C (143, 0x8f)
CPU revision             : 8.000000
CPUID                    : Family/Model/Stepping 6/143/8, 0x06/0x8f/0x08
CPU Max MHz              : 2001
CPU Min MHz              : 800
Total cores              : 208
SMT threads per core     : 2
Cores per socket         : 52
Sockets                  : 2
Cores per NUMA region    : 52
NUMA regions             : 4
Running in a VM          : no
Number Hardware Counters : 20
Max Multiplex Counters   : 384
Fast counter read (rdpmc): yes
--------------------------------------------------------------------------------

================================================================================
  PAPI Preset Events
================================================================================
    Name        Code    Avail Deriv Description (Note)
PAPI_L1_DCM  0x80000000  Yes   No   Level 1 data cache misses
PAPI_L1_ICM  0x80000001  Yes   No   Level 1 instruction cache misses
PAPI_L2_DCM  0x80000002  Yes   No   Level 2 data cache misses
PAPI_L2_ICM  0x80000003  Yes   No   Level 2 instruction cache misses
PAPI_L3_DCM  0x80000004  No    No   Level 3 data cache misses
PAPI_L3_ICM  0x80000005  No    No   Level 3 instruction cache misses
PAPI_L1_TCM  0x80000006  Yes   Yes  Level 1 cache misses
PAPI_L2_TCM  0x80000007  Yes   No   Level 2 cache misses
...

@Treece-Burgess
Copy link
Contributor

I am unable to recreate this issue on a machine with Intel Xeon Gold 6430. Could you give me more details such as:

  • glibc version (ldd --version)
  • system and architecture (uname -a)
  • compiler and compiler version you tried to build PAPI with
  • gpu architecture

That will help me try to reproduce the issue on a machine I may have access to.

@Treece-Burgess
Copy link
Contributor

@servesh Following up with this.

@jkwack
Copy link

jkwack commented Nov 19, 2024

Hi, folks.
I discussed it with Servesh before, so let me keep you updated.

The followings are what I tried. without LD_PRELOAD, it failed as follows:

$ ./configure --with-components="intel_gpu" --prefix=/home/jkwack/jk_tmp/papi/build/ CC=gcc
$ make clean
$ make 
$ make install
$ cd ../build/bin
$ ./papi_avail 
terminate called after throwing an instance of 'std::system_error'
  what():  Enable multithreading to use std::thread: Operation not permitted
Aborted
$ export LD_PRELOAD=/usr/lib64/libpthread.so
$ ./papi_avail 
Available PAPI preset and user defined events plus hardware information.
--------------------------------------------------------------------------------
PAPI version             : 7.2.0.0
Operating system         : Linux 5.14.21-150400.24.55-default
Vendor string and code   : GenuineIntel (1, 0x1)
Model string and code    : Intel(R) Xeon(R) CPU Max 9470C (143, 0x8f)
CPU revision             : 8.000000
…

Here is what you requested:

$ ldd --version
ldd (GNU libc) 2.31
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

$ uname -a
Linux x1921c2s3b0n0 5.14.21-150400.24.55-default #1 SMP PREEMPT_DYNAMIC Mon Mar 27 15:25:48 UTC 2023 (cc75cf8) x86_64 x86_64 x86_64 GNU/Linux

$ gcc --version
gcc (Spack GCC) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@dbarry9 dbarry9 self-assigned this Dec 10, 2024
@dbarry9 dbarry9 linked a pull request Dec 11, 2024 that will close this issue
3 tasks
@dbarry9
Copy link
Contributor

dbarry9 commented Dec 12, 2024

Hello @servesh and @jkwack, could you please see if PR #293 fixes this issue for you?

@Treece-Burgess Treece-Burgess added component-intel_gpu PRs and Issues related to the intel_gpu component type-bug Issues discussing bugs or PRs fixing bugs labels Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component-intel_gpu PRs and Issues related to the intel_gpu component type-bug Issues discussing bugs or PRs fixing bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants