[RFC] CommandLine: Allow loading >1 library linking to the same libLLVM version

Background

Investigating an issue, that I was having for years, I’ve come across the problem, that CommandLine does not allow loading more than one library linking to the same libLLVM version. Instead it aborts. The comment above the abort seems to indicate, that this is unrecoverable.

llvm/lib/Support/CommandLine.cpp

    // Fail hard if there were errors. These are strictly unrecoverable and
    // indicate serious issues such as conflicting option names or an
    // incorrectly
    // linked LLVM distribution.
    if (HadErrors)
      report_fatal_error("inconsistency in registered CommandLine options");

So I tested that hypothesis by toying around and provide the result in [⚙ D141019 Support/CommandLine: replace argument mapping error with a warning]. It does not hold. Problem with this revision is, that this now allows loading of libLLVM any times including that of different versions plus it allows duplicate options. So this is not a solution.

Related issues

  1. cl::opt + LLVM_BUILD_LLVM_DYLIB is completely broken · Issue #23326 · llvm/llvm-project · GitHub
  2. Inconsistency in commandline options with multiple OpenCL vendor libraries installed · Issue #29935 · llvm/llvm-project · GitHub

Related topics

Related topics seem to relate to mixing static/dynamic LLVM libraries or mixing versions mostly. This topic relates to linking (indirectly) against the same libLLVM library multiple times.

  1. Opt: Option registered more than once!
  2. Can something be done with the "inconsistency in registered CommandLine options" error
  3. LLVM as a shared library
  4. Flang and LLVM_BUILD_LLVM_DYLIB=ON

Problem instances

Mesa with Clover and RocM installed

The problem can be reproduced by installing mesa with the Clover OpenCL implementation (-Dgallium-opencl=icd) and rocm-opencl-runtime at the same time. Both link to libLLVM, so clinfo will abort reproducibly on such systems.

LLVM is compiled with:

-DBUILD_SHARED_LIBS=OFF
-DLLVM_BUILD_LLVM_DYLIB=ON
-DLLVM_LINK_LLVM_DYLIB=ON

Clover linkage:

$ ldd /usr/lib64/libMesaOpenCL.so.1.0.0
…
            libLLVM-15.so => /usr/lib/llvm/15/lib64/libLLVM-15.so
…

RocM linkage:

$ ldd /usr/lib64/libamd_comgr.so.2.4.0
…
            libLLVM-15.so => /usr/lib/llvm/15/lib64/libLLVM-15.so
…

Without revision:

$ clinfo
mesa: CommandLine Error: Option 'h' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options
Aborted

With revision:

$ clinfo
warning: mesa: CommandLine Error: Option 'h' registered more than once!
Number of platforms                               2
  Platform Name                                   Clover
  Platform Vendor                                 Mesa
  Platform Version                                OpenCL 1.1 Mesa 22.2.3
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd
  Platform Extensions function suffix             MESA

  Platform Name                                   AMD Accelerated Parallel Processing
  Platform Vendor                                 Advanced Micro Devices, Inc.
  Platform Version                                OpenCL 2.1 AMD-APP.dbg (3486.0)
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd cl_amd_event_callback
  Platform Extensions function suffix             AMD
  Platform Host timer resolution                  1ns
…

With the revision also darktable-cltest works:

[dt_get_sysresource_level] switched to 1 as `default'
  total mem:       257576MB
  mipmap cache:    32197MB
  available mem:   128788MB
  singlebuff:      2012MB
  OpenCL tune mem: OFF
  OpenCL pinned:   OFF
[opencl_init] opencl related configuration options:
[opencl_init] opencl: ON
[opencl_init] opencl_scheduling_profile: 'very fast GPU'
[opencl_init] opencl_library: 'default path'
[opencl_init] opencl_device_priority: '*/!0,*/*/*'
[opencl_init] opencl_mandatory_timeout: 400
[opencl_init] opencl_synch_cache: false
[opencl_init] opencl library 'libOpenCL' found on your system and loaded
warning: mesa: CommandLine Error: Option 'h' registered more than once!
[opencl_init] found 2 platforms
[opencl_init] found 2 devices

[dt_opencl_device_init]
   DEVICE:                   0: 'AMD Radeon RX 5500 XT (navi14, LLVM 15.0.6, DRM 3.48, 6.0.16-gentoo)', NEW
   CANONICAL NAME:           amdradeonrx5500xtnavi14llvm1506drm3486016gentoo
   PLATFORM NAME & VENDOR:   Clover, Mesa
   DRIVER VERSION:           22.2.3
   DEVICE VERSION:           OpenCL 1.1 Mesa 22.2.3
   DEVICE_TYPE:              GPU
   *** The OpenCL driver doesn't provide image support. See also 'clinfo' output ***

[dt_opencl_device_init]
   DEVICE:                   1: 'gfx1012:xnack-'
   CANONICAL NAME:           gfx1012xnack
   PLATFORM NAME & VENDOR:   AMD Accelerated Parallel Processing, Advanced Micro Devices, Inc.
   DRIVER VERSION:           3486.0 (HSA1.1,LC)
   DEVICE VERSION:           OpenCL 2.0
   DEVICE_TYPE:              GPU
   GLOBAL MEM SIZE:          8176 MB
   MAX MEM ALLOC:            6950 MB
   MAX IMAGE SIZE:           16384 x 16384
   MAX WORK GROUP SIZE:      256
   MAX WORK ITEM DIMENSIONS: 3
   MAX WORK ITEM SIZES:      [ 1024 1024 1024 ]
   ASYNC PIXELPIPE:          NO
   PINNED MEMORY TRANSFER:   NO
   MEMORY TUNING:            NO
   FORCED HEADROOM:          400
   AVOID ATOMICS:            NO
   MICRO NAP:                250
   ROUNDUP WIDTH:            16
   ROUNDUP HEIGHT:           16
   CHECK EVENT HANDLES:      128
   PERFORMANCE:              2.107083
   DEFAULT DEVICE:           NO
   KERNEL DIRECTORY:         /usr/share/darktable/kernels
   CL COMPILER OPTION:       -cl-fast-relaxed-math
   KERNEL LOADING TIME:       0.0195 sec
[opencl_init] OpenCL successfully initialized.
[opencl_init] here are the internal numbers and names of OpenCL devices available to darktable:
[opencl_init]           0       'gfx1012:xnack-'
[opencl_init] FINALLY: opencl is AVAILABLE on this system.
[opencl_init] initial status of opencl enabled flag is ON.
[opencl_init] set scheduling profile for very fast GPU.
[dt_opencl_update_priorities] these are your device priorities:
[dt_opencl_update_priorities]           image   preview export  thumbs  preview2
[dt_opencl_update_priorities]           0       0       0       0       0
[dt_opencl_update_priorities] show if opencl use is mandatory for a given pixelpipe:
[dt_opencl_update_priorities]           image   preview export  thumbs  preview2
[dt_opencl_update_priorities]           1       1       1       1       1
[opencl_synchronization_timeout] synchronization timeout set to 0

I chose Clover and RocM because it is the easiest to reproduce setup and you most likely do not need an amdgpu device for it. Note, that compiling one of the two libraries with the patched LLVM will result in no error or warning at all. Both have to be either be compiled with or without the patch/revision.

mpv utilizing hardware decoding and OpenCL

Using this on a system with solely RocM also reproduces the issue. mpv is compiled with vapoursynth support and using the plugin SVP. [1] SVP can run with and without OpenCL, so it must be activated via “Application settings”‣“GPU acceleration”‣“Your OpenCL device”.

mpv config must include:

no-resume-playback
input-ipc-server=/tmp/mpvsocket
hr-seek-framedrop=no
hwdec=vaapi-copy
hwdec-codecs=all

For Intel this is not reproducible, because their hardware decoding implementation does not link against libLLVM. Nouveau links against libLLVM with VA, but does not offer a OpenCL implementation. rusticl will link against it, so once it matures, it should be also reproducible with Intel GPUs.

Linkage mesa radeonsi vaapi driver

$ ldd /usr/lib64/va/drivers/radeonsi_drv_video.so
…
         libLLVM-15.so => /usr/lib/llvm/15/lib64/libLLVM-15.so
…

Linkage RocM comgr

$ ldd /usr/lib64/libamd_comgr.so.2.4.0
…
         libLLVM-15.so => /usr/lib/llvm/15/lib64/libLLVM-15.so

mpv execution without revision:

(+) Video --vid=1 (*) (vp9 3840x2160 23.976fps)
 (+) Audio --aid=1 --alang=eng (*) (opus 2ch 48000Hz)
File tags:
 Uploader: LLVM
 Channel_URL: https://www.youtube.com/channel/UCv2_41bSAa5Y_8BacJUZfjQ
Using hardware decoding (vaapi-copy).
AO: [alsa] 48000Hz stereo 2ch float
VO: [gpu] 3840x2160 nv12
[xrandr] output DisplayPort-0 mode=5120x1440 old rate=96.04 refresh rates =    119.97 + 120.05    96.04*   72.00    60.00    50.00    48.01   100.00    60.00    59.98    30.00    25.00    24.00    23.98  scale =  1
[xrandr] container fps is 23.976024627686Hz, for output DisplayPort-0 mode 5120x1440 the best fitting display fps rate is 96.04Hz
[autoconvert] Converting nv12 -> yuv420p
mesa: CommandLine Error: Option 'h' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options
Aborted

mpv execution with revision:

$ mpv https://www.youtube.com/watch?v=VbFqA9rvxPs
(+) Video --vid=1 (*) (vp9 3840x2160 23.976fps)
 (+) Audio --aid=1 --alang=eng (*) (opus 2ch 48000Hz)
File tags:
 Uploader: LLVM
 Channel_URL: https://www.youtube.com/channel/UCv2_41bSAa5Y_8BacJUZfjQ
Using hardware decoding (vaapi-copy).
AO: [alsa] 48000Hz stereo 2ch float
VO: [gpu] 3840x2160 nv12
[xrandr] output DisplayPort-0 mode=5120x1440 old rate=60.00 refresh rates =    119.97 + 120.05    96.04    72.00    60.00    50.00    48.01   100.00    60.00*   59.98    30.00    25.00    24.00    23.98  scale =  1
[xrandr] container fps is 23.976024627686Hz, for output DisplayPort-0 mode 5120x1440 the best fitting display fps rate is 96.04Hz
[autoconvert] Converting nv12 -> yuv420p
warning: mesa: CommandLine Error: Option 'h' registered more than once!
VO: [gpu] 3840x2160 yuv420p
AV: 00:00:03 / 00:45:44 (0%) A-V:  0.016 DS: 1.980/3 Dropped: 5 Cache: 5.9s/3MB

Exiting... (Quit)
[xrandr] switching output DisplayPort-0 that was set for replay to mode 5120x1440 at 96.04Hz and 1.0 scaling back to mode 5120x1440 with refresh rate 60.00Hz and 1 scaling
  1. SVP:Linux - SmoothVideo Project (SVP) - frame doubling interpolation

Proposal

In my understanding the behaviour so far has been:

  1. Abort when linking dynamically/statically against different LLVM versions.
  2. Abort when linking dynamically/statically against the same LLVM versions.
  3. Abort if a statically linked libLLVM is mixed with a dynamically linked one. This follows from 2 and might be desirable to continue.

I’d like to propose that 2 is just warned for the dynamic case, but I’m not sure how to achieve this. The linked revision so far just allows all cases, which will likely lead to broken software.

To prevent 1, a version option should precede any CommandLine call. I could use a hint, where this could be emitted, since I’m not familiar with the LLVM project. Maybe there is a base module that calls CommandLine with the argument string.

Afterwards the check could be something like this:

// somewhere defined at building and included by CommandLine.h
#define LLVM_VERSION "some version string"
// CommandLine.cpp
#include "llvm/Support/WithColor.h"
class CommandLineParser {
public:
  //...
  bool SameVersion = false;
  //...
  void addOption(Option *O, SubCommand *SC) {
	bool HadErrors = false;

	if (O->hasArgStr()) {
	  if (O->ArgStr == "version" && O->ValueStr == LLVM_VERSION)
		SameVersion = true;
	  // If it's a DefaultOption, check to make sure it isn't already there.
	  if (O->isDefaultOption() &&
		  SC->OptionsMap.find(O->ArgStr) != SC->OptionsMap.end())
		return;

	  // Add argument to the argument map!
	  if (!SC->OptionsMap.insert(std::make_pair(O->ArgStr, O)).second) {
		if (SameVersion) {
		  WithColor::warning() << ProgramName << ": CommandLine Error: Option '" << O->ArgStr
							   << "' registered more than once!\n";
		} else {
		  errs() << ProgramName << ": CommandLine Error: Option '" << O->ArgStr
				 << "' registered more than once!\n";
		  HadErrors = true;
		}
	  }
	}
	// ...
  }
}

It is still less than ideal, because this allows duplicate options as soon as a second library with the same version has been encountered. In general, while being at it, two refinements come into mind:

  1. Print a version mismatch when it occurs, including the involved versions. Older versions, that do not include a version string could just be declared as <16.x
  2. Print the names/symbols or whatever information we have at runtime about the two or more libraries loading libLLVM. This could help distributions, developers and end users in dealing with such issues.

So, all in all I wanted to point out the issue. I can’t provide a fully working solution here, so I’d appreciate any hints on that matter. If someone steps up to solve this problem on .* own, I would not mind. After all I’m just an end user investigating a software issue and while I have a C, bash and an embarrassing C# hat lying around, I unfortunately lack the ones for C++ and python.

Looking forward to your thoughts excluding those, why I dare to break stuff. Already have them on my mind. :wink:

Maybe just set a private name for your build, so the system linker sees them as being entirely separate modules? As done here for example: Yggdrasil/9999-llvm-symver-jlprefix.patch at 80d832c7c02bcb52e787a883ee312e1d8eae223a · JuliaPackaging/Yggdrasil · GitHub

Thanks for your input.

Is this applicable for system LLVM? My impression is, that this is used for a bundled library, but how would distributions providing the system’s LLVM fix this? Gentoo devs for instance tend to remove bundled libraries, if they see any way fit for that.

I don’t quite get how this happens actually?
This error is triggers when the option “h” is registered, which happens in the constructor of the cl::opt, triggered in this case by the call to initCommonOptions() in llvm/lib/Support/CommandLine.cpp (inserting into the GlobalParser in the same file).
And multiple calls to initCommonOptions() won’t re-initialize this option either. So are there two copies of the options in the binaries? Where do they come from?

I don’t think so, but if you know a good (hex/ascii) search term for looking up the option strings in the binaries, I could look that up.

My best guess so far is, that loading a second library linking against libLLVM additionally to one already loaded causes reinitialization of existing options, thus leading to the error.

If there were duplicate options in one executable/library it would not load alone, but that in fact is possible.

My best guess so far is, that loading a second library linking against libLLVM additionally to one already loaded causes reinitialization of existing options, thus leading to the error.

That’s a reasonable guess, but we rely on global constructor in the LLVM library and my assumption was that these would get executed only when the library is loaded, regardless how many library are linked to it.
Is it possible that these get re-executed because of some uses of dlopen instead of direct linking?
I’m not sure how to defend against this.

That could be possible, but does dlopen transitively load all of the dlopened library dependencies? If so, well, then that might be the reason. Here is, what a quick search turned up:

It seems indeed, that the libraries linking to libLLVM are dlopened. I’d say, if we can’t prevent that, we have to deal with the results.

Thinking more about the parser problem, I’d rather suggest now the following:

  1. Introduce a new CommandLine option which is always the first on library loading named for example ‘version-lib’
  2. Use that as a delimiter.
  3. Split the option string with it and then check each library’s options for duplicate ones.

This could work better, but is there anything else to consider or am I missing something? In terms of robustness and flexibility for developers it could be useful, if LLVM gained the ability to be loaded more often. It still should warn about it, but if it can’t be defended, it needs to be handled.

Well we have to be cautious about not chasing the symptoms instead of the root cause. Re-executing the global constructors for already loaded objects may get us weird behaviors far outside of command line options.
I don’t think it is reasonable to workaround the problem without first confirming exactly what’s happening and why.

Sounds reasonable. So how could I debug that? The searches did not yield any direct dlopen calls to libLLVM, so it would be most reasonable to catch it when it happens. Since I’m coding controller stuff mostly in C, I’m not familiar with gdb debugging, so I could use a few pointers.

Should I get debugging symbols only in LLVM or also the involved libraries? Can I get enough information on abort or must I use breakpoints? Is there some good quick start documentation on gdb, which I could use? It’s not, that I can not look all of that up or try out, it just takes a little longer. This might need some time and as of tomorrow I’ll have a lot less, but I’ll try to use the evenings and weekends.

There are a few ways to figure it out, I would likely change the void addOption(Option *O, bool ProcessDefaultOption = false) method that way:

  void addOption(Option *O, bool ProcessDefaultOption = false) {
    if (O->ArgStr == "h")
      llvm::errs() << "adding option 'h'\n";
   ...

Which give a good line to put a breakpoint on. Then I’d rebuild LLVM in debug mode and run the faulty binary in gdb with a breakpoint on this line, printing the backtrace the first and second time it gets hit.

Thanks for the pointer, I’ll give it a try. Considering my free time today and in the next days though, it might take till Tuesday evening in my London time zone. Should not take longer.

I think this thread is about a solution to the problem of multiple LLVM libs: Making LLVM play nice(r) when used as a shared library in a plugin setting

If I remember correctly, linking LLVM statically also solves the symptoms, so to solve your concrete case, if you link LLVM statically in ROCm, blender should be fine (loading llvm dynamically from mesa and statically from ROCm).

Unfortunately it does. Might take until the weekend. I had to downgrade to 15.0.6 because rocm-comgr does not compile with 15.x branch anymore. opencl-c.h is missing in clang’s resource dir. I’m currently rebuilding with debug symbols in llvm, clang and lld, which should be sufficient. Compressing the debug symbols is single-threaded though, so it takes significantly longer.

With the suggested insertion I get this output three times. I probably should move it after the default option check, such that we only get the non-ignored option registration attempts.

Thanks Flakebi, this looks relevant and I could not find the thread with my search terms. OpenCL and vapoursynth are both (like) plugin environments, so this might address the issues I’m describing. I might give backporting to 15.0.6 a try once I get to it, because, as said, rocm-comgr won’t compile otherwise and Gentoo packages refuse to link against 16.x.

Here you go. Is this sufficient information?

$ env LANG=C gdb clinfo
GNU gdb (Gentoo 12.1 vanilla) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from clinfo...
(No debugging symbols found in clinfo)
(gdb) break CommandLine.cpp:213
No symbol table is loaded.  Use the "file" command.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (CommandLine.cpp:213) pending.
(gdb) run
Starting program: /usr/bin/clinfo
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffe71ff6c0 (LWP 11881)]

Thread 1 "clinfo" hit Breakpoint 1, (anonymous namespace)::CommandLineParser::addOption (this=this@entry=0x5555555891c0, O=O@entry=0x555555618620, SC=0x5555555893f0) at /usr/src/debug/sys-devel/llvm-15.0.6/llvm/lib/Support/CommandLine.cpp:213
213             errs() << "adding option 'h'\n";
(gdb) backtrace
#0  (anonymous namespace)::CommandLineParser::addOption (this=this@entry=0x5555555891c0, O=O@entry=0x555555618620, SC=0x5555555893f0) at /usr/src/debug/sys-devel/llvm-15.0.6/llvm/lib/Support/CommandLine.cpp:213
#1  0x00007fffeb7c0dff in (anonymous namespace)::CommandLineParser::addOption (ProcessDefaultOption=true, O=0x555555618620, this=0x5555555891c0) at /usr/src/debug/sys-devel/llvm-15.0.6/llvm/lib/Support/CommandLine.cpp:268
#2  (anonymous namespace)::CommandLineParser::ParseCommandLineOptions (LongOptionsUseDoubleDash=<optimized out>, Errs=0x7ffff31a2180 <llvm::nulls()::S>, Overview=..., argv=0x7fffffffc550, argc=2, this=0x5555555891c0)
    at /usr/src/debug/sys-devel/llvm-15.0.6/llvm/lib/Support/CommandLine.cpp:1474
#3  llvm::cl::ParseCommandLineOptions (argc=<optimized out>, argv=<optimized out>, Overview=..., Errs=0x7ffff31a2180 <llvm::nulls()::S>, EnvVar=<optimized out>, LongOptionsUseDoubleDash=false) at /usr/src/debug/sys-devel/llvm-15.0.6/llvm/lib/Support/CommandLine.cpp:1402
#4  0x00007fffeb7c3125 in LLVMParseCommandLineOptions (argc=argc@entry=2, argv=argv@entry=0x7fffffffc790, Overview=Overview@entry=0x0) at /usr/src/debug/sys-devel/llvm-15.0.6/llvm/lib/Support/CommandLine.cpp:2741
#5  0x00007fffe7a50d0f in ac_init_llvm_target () at ../mesa-22.2.3/src/amd/llvm/ac_llvm_util.c:66
#6  0x00007ffff7e320fa in ?? () from /lib64/libc.so.6
#7  0x00007fffe796e993 in si_init_compiler (sscreen=sscreen@entry=0x5555556116b0, compiler=compiler@entry=0x5555556121f0) at ../mesa-22.2.3/src/gallium/drivers/radeonsi/si_pipe.c:150
#8  0x00007fffe796ee28 in radeonsi_screen_create_impl (ws=ws@entry=0x5555556026f0, config=config@entry=0x7fffffffc9d0) at ../mesa-22.2.3/src/gallium/drivers/radeonsi/si_pipe.c:1143
#9  0x00007fffe7a1966f in amdgpu_winsys_create (fd=fd@entry=5, config=config@entry=0x7fffffffc9d0, screen_create=screen_create@entry=0x7fffe796ea00 <radeonsi_screen_create_impl>) at ../mesa-22.2.3/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c:550
#10 0x00007fffe796fc22 in radeonsi_screen_create (fd=5, config=0x7fffffffc9d0) at ../mesa-22.2.3/src/gallium/drivers/radeonsi/si_pipe.c:1474
#11 0x00007fffe7830c57 in pipe_radeonsi_create_screen (fd=<optimized out>, config=<optimized out>) at ../mesa-22.2.3/src/gallium/auxiliary/target-helpers/drm_helper.h:221
#12 0x00007ffff7a79033 in pipe_loader_create_screen_vk (dev=0x5555555e5d90, sw_vk=<optimized out>) at ../mesa-22.2.3/src/gallium/auxiliary/pipe-loader/pipe_loader.c:171
#13 0x00007ffff7a653c2 in clover::device::device (this=this@entry=0x555555600be0, platform=..., ldev=ldev@entry=0x5555555e5d90) at ../mesa-22.2.3/src/gallium/frontends/clover/core/device.cpp:141
#14 0x00007ffff7a72fe8 in clover::create<clover::device, clover::platform&, pipe_loader_device*&> () at ../mesa-22.2.3/src/gallium/frontends/clover/util/pointer.hpp:240
#15 clover::platform::platform (this=this@entry=0x7ffff7bde0c0 <(anonymous namespace)::_clover_platform>) at ../mesa-22.2.3/src/gallium/frontends/clover/core/platform.cpp:41
#16 0x00007ffff7a3c5ea in __static_initialization_and_destruction_0 (__priority=65535, __initialize_p=1) at ../mesa-22.2.3/src/gallium/frontends/clover/api/platform.cpp:34
#17 0x00007ffff7fcdd9e in ?? () from /lib64/ld-linux-x86-64.so.2
#18 0x00007ffff7fcde8c in ?? () from /lib64/ld-linux-x86-64.so.2
#19 0x00007ffff7ef17c5 in _dl_catch_exception () from /lib64/libc.so.6
#20 0x00007ffff7fd44e6 in ?? () from /lib64/ld-linux-x86-64.so.2
#21 0x00007ffff7ef1764 in _dl_catch_exception () from /lib64/libc.so.6
#22 0x00007ffff7fd487b in ?? () from /lib64/ld-linux-x86-64.so.2
#23 0x00007ffff7e290c8 in ?? () from /lib64/libc.so.6
#24 0x00007ffff7ef1764 in _dl_catch_exception () from /lib64/libc.so.6
#25 0x00007ffff7ef182f in _dl_catch_error () from /lib64/libc.so.6
#26 0x00007ffff7e28b98 in ?? () from /lib64/libc.so.6
#27 0x00007ffff7e29181 in dlopen () from /lib64/libc.so.6
#28 0x00007ffff7f88d81 in ?? () from /usr/lib64/libOpenCL.so.1
#29 0x00007ffff7f833f7 in ?? () from /usr/lib64/libOpenCL.so.1
#30 0x00007ffff7f888c2 in ?? () from /usr/lib64/libOpenCL.so.1
#31 0x00007ffff7f88aa2 in ?? () from /usr/lib64/libOpenCL.so.1
--Type <RET> for more, q to quit, c to continue without paging--c
#32 0x00007ffff7e320fa in ?? () from /lib64/libc.so.6
#33 0x00007ffff7f845e3 in clGetPlatformIDs () from /usr/lib64/libOpenCL.so.1
#34 0x000055555555b4b5 in ?? ()
#35 0x00007ffff7dcc34c in ?? () from /lib64/libc.so.6
#36 0x00007ffff7dcc3fc in __libc_start_main () from /lib64/libc.so.6
#37 0x000055555555bac1 in ?? ()
(gdb) continue
Continuing.
adding option 'h'

Thread 1 "clinfo" hit Breakpoint 1, (anonymous namespace)::CommandLineParser::addOption (this=this@entry=0x5555555891c0, O=O@entry=0x555555618620, SC=0x555555589340) at /usr/src/debug/sys-devel/llvm-15.0.6/llvm/lib/Support/CommandLine.cpp:213
213             errs() << "adding option 'h'\n";
(gdb) backtrace
#0  (anonymous namespace)::CommandLineParser::addOption (this=this@entry=0x5555555891c0, O=O@entry=0x555555618620, SC=0x555555589340) at /usr/src/debug/sys-devel/llvm-15.0.6/llvm/lib/Support/CommandLine.cpp:213
#1  0x00007fffeb7bc6e8 in (anonymous namespace)::CommandLineParser::addOption (this=this@entry=0x5555555891c0, O=O@entry=0x555555618620, SC=0x5555555893f0) at /usr/src/debug/sys-devel/llvm-15.0.6/llvm/lib/Support/CommandLine.cpp:253
#2  0x00007fffeb7c0dff in (anonymous namespace)::CommandLineParser::addOption (ProcessDefaultOption=true, O=0x555555618620, this=0x5555555891c0) at /usr/src/debug/sys-devel/llvm-15.0.6/llvm/lib/Support/CommandLine.cpp:268
#3  (anonymous namespace)::CommandLineParser::ParseCommandLineOptions (LongOptionsUseDoubleDash=<optimized out>, Errs=0x7ffff31a2180 <llvm::nulls()::S>, Overview=..., argv=0x7fffffffc550, argc=2, this=0x5555555891c0)
    at /usr/src/debug/sys-devel/llvm-15.0.6/llvm/lib/Support/CommandLine.cpp:1474
#4  llvm::cl::ParseCommandLineOptions (argc=<optimized out>, argv=<optimized out>, Overview=..., Errs=0x7ffff31a2180 <llvm::nulls()::S>, EnvVar=<optimized out>, LongOptionsUseDoubleDash=false) at /usr/src/debug/sys-devel/llvm-15.0.6/llvm/lib/Support/CommandLine.cpp:1402
#5  0x00007fffeb7c3125 in LLVMParseCommandLineOptions (argc=argc@entry=2, argv=argv@entry=0x7fffffffc790, Overview=Overview@entry=0x0) at /usr/src/debug/sys-devel/llvm-15.0.6/llvm/lib/Support/CommandLine.cpp:2741
#6  0x00007fffe7a50d0f in ac_init_llvm_target () at ../mesa-22.2.3/src/amd/llvm/ac_llvm_util.c:66
#7  0x00007ffff7e320fa in ?? () from /lib64/libc.so.6
#8  0x00007fffe796e993 in si_init_compiler (sscreen=sscreen@entry=0x5555556116b0, compiler=compiler@entry=0x5555556121f0) at ../mesa-22.2.3/src/gallium/drivers/radeonsi/si_pipe.c:150
#9  0x00007fffe796ee28 in radeonsi_screen_create_impl (ws=ws@entry=0x5555556026f0, config=config@entry=0x7fffffffc9d0) at ../mesa-22.2.3/src/gallium/drivers/radeonsi/si_pipe.c:1143
#10 0x00007fffe7a1966f in amdgpu_winsys_create (fd=fd@entry=5, config=config@entry=0x7fffffffc9d0, screen_create=screen_create@entry=0x7fffe796ea00 <radeonsi_screen_create_impl>) at ../mesa-22.2.3/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c:550
#11 0x00007fffe796fc22 in radeonsi_screen_create (fd=5, config=0x7fffffffc9d0) at ../mesa-22.2.3/src/gallium/drivers/radeonsi/si_pipe.c:1474
#12 0x00007fffe7830c57 in pipe_radeonsi_create_screen (fd=<optimized out>, config=<optimized out>) at ../mesa-22.2.3/src/gallium/auxiliary/target-helpers/drm_helper.h:221
#13 0x00007ffff7a79033 in pipe_loader_create_screen_vk (dev=0x5555555e5d90, sw_vk=<optimized out>) at ../mesa-22.2.3/src/gallium/auxiliary/pipe-loader/pipe_loader.c:171
#14 0x00007ffff7a653c2 in clover::device::device (this=this@entry=0x555555600be0, platform=..., ldev=ldev@entry=0x5555555e5d90) at ../mesa-22.2.3/src/gallium/frontends/clover/core/device.cpp:141
#15 0x00007ffff7a72fe8 in clover::create<clover::device, clover::platform&, pipe_loader_device*&> () at ../mesa-22.2.3/src/gallium/frontends/clover/util/pointer.hpp:240
#16 clover::platform::platform (this=this@entry=0x7ffff7bde0c0 <(anonymous namespace)::_clover_platform>) at ../mesa-22.2.3/src/gallium/frontends/clover/core/platform.cpp:41
#17 0x00007ffff7a3c5ea in __static_initialization_and_destruction_0 (__priority=65535, __initialize_p=1) at ../mesa-22.2.3/src/gallium/frontends/clover/api/platform.cpp:34
#18 0x00007ffff7fcdd9e in ?? () from /lib64/ld-linux-x86-64.so.2
#19 0x00007ffff7fcde8c in ?? () from /lib64/ld-linux-x86-64.so.2
#20 0x00007ffff7ef17c5 in _dl_catch_exception () from /lib64/libc.so.6
#21 0x00007ffff7fd44e6 in ?? () from /lib64/ld-linux-x86-64.so.2
#22 0x00007ffff7ef1764 in _dl_catch_exception () from /lib64/libc.so.6
#23 0x00007ffff7fd487b in ?? () from /lib64/ld-linux-x86-64.so.2
#24 0x00007ffff7e290c8 in ?? () from /lib64/libc.so.6
#25 0x00007ffff7ef1764 in _dl_catch_exception () from /lib64/libc.so.6
#26 0x00007ffff7ef182f in _dl_catch_error () from /lib64/libc.so.6
#27 0x00007ffff7e28b98 in ?? () from /lib64/libc.so.6
#28 0x00007ffff7e29181 in dlopen () from /lib64/libc.so.6
#29 0x00007ffff7f88d81 in ?? () from /usr/lib64/libOpenCL.so.1
#30 0x00007ffff7f833f7 in ?? () from /usr/lib64/libOpenCL.so.1
#31 0x00007ffff7f888c2 in ?? () from /usr/lib64/libOpenCL.so.1
--Type <RET> for more, q to quit, c to continue without paging--c
#32 0x00007ffff7f88aa2 in ?? () from /usr/lib64/libOpenCL.so.1
#33 0x00007ffff7e320fa in ?? () from /lib64/libc.so.6
#34 0x00007ffff7f845e3 in clGetPlatformIDs () from /usr/lib64/libOpenCL.so.1
#35 0x000055555555b4b5 in ?? ()
#36 0x00007ffff7dcc34c in ?? () from /lib64/libc.so.6
#37 0x00007ffff7dcc3fc in __libc_start_main () from /lib64/libc.so.6
#38 0x000055555555bac1 in ?? ()
(gdb) continue
Continuing.
adding option 'h'
[New Thread 0x7fffe69fe6c0 (LWP 11930)]
[New Thread 0x7fffe61fd6c0 (LWP 11931)]
[New Thread 0x7fffe59fc6c0 (LWP 11932)]
[New Thread 0x7fffe49ff6c0 (LWP 11933)]
[New Thread 0x7ffecfdff6c0 (LWP 11937)]
[Thread 0x7ffecfdff6c0 (LWP 11937) exited]

Thread 1 "clinfo" hit Breakpoint 1, (anonymous namespace)::CommandLineParser::addOption (this=this@entry=0x5555555891c0, O=O@entry=0x7ffecf5044a0 <SectionHeadersShorter>, SC=0x555555589340) at /usr/src/debug/sys-devel/llvm-15.0.6/llvm/lib/Support/CommandLine.cpp:213
213             errs() << "adding option 'h'\n";
(gdb) backtrace
#0  (anonymous namespace)::CommandLineParser::addOption (this=this@entry=0x5555555891c0, O=O@entry=0x7ffecf5044a0 <SectionHeadersShorter>, SC=0x555555589340) at /usr/src/debug/sys-devel/llvm-15.0.6/llvm/lib/Support/CommandLine.cpp:213
#1  0x00007fffeb7bd1cb in (anonymous namespace)::CommandLineParser::addOption (ProcessDefaultOption=false, O=0x7ffecf5044a0 <SectionHeadersShorter>, this=0x5555555891c0) at /usr/src/debug/sys-devel/llvm-15.0.6/llvm/lib/Support/CommandLine.cpp:265
#2  (anonymous namespace)::CommandLineParser::addOption (ProcessDefaultOption=false, O=0x7ffecf5044a0 <SectionHeadersShorter>, this=0x5555555891c0) at /usr/src/debug/sys-devel/llvm-15.0.6/llvm/lib/Support/CommandLine.cpp:258
#3  llvm::cl::Option::addArgument (this=this@entry=0x7ffecf5044a0 <SectionHeadersShorter>) at /usr/src/debug/sys-devel/llvm-15.0.6/llvm/lib/Support/CommandLine.cpp:449
#4  0x00007ffecec55e68 in llvm::cl::alias::done (this=this@entry=0x7ffecf5044a0 <SectionHeadersShorter>) at /usr/lib/llvm/15/include/llvm/Support/CommandLine.h:1875
#5  0x00007ffecec56a6a in llvm::cl::alias::alias<char [2], llvm::cl::desc, llvm::cl::aliasopt> (this=0x7ffecf5044a0 <SectionHeadersShorter>) at /usr/lib/llvm/15/include/llvm/Support/CommandLine.h:1893
#6  0x00007ffecec1153f in __static_initialization_and_destruction_0 (__priority=65535, __initialize_p=1) at /usr/src/debug/dev-libs/rocm-comgr-5.3.3/ROCm-CompilerSupport-rocm-5.3.3/lib/comgr/src/comgr-objdump.cpp:180
#7  0x00007ffff7fcdd9e in ?? () from /lib64/ld-linux-x86-64.so.2
#8  0x00007ffff7fcde8c in ?? () from /lib64/ld-linux-x86-64.so.2
#9  0x00007ffff7ef17c5 in _dl_catch_exception () from /lib64/libc.so.6
#10 0x00007ffff7fd44e6 in ?? () from /lib64/ld-linux-x86-64.so.2
#11 0x00007ffff7ef1764 in _dl_catch_exception () from /lib64/libc.so.6
#12 0x00007ffff7fd487b in ?? () from /lib64/ld-linux-x86-64.so.2
#13 0x00007ffff7e290c8 in ?? () from /lib64/libc.so.6
#14 0x00007ffff7ef1764 in _dl_catch_exception () from /lib64/libc.so.6
#15 0x00007ffff7ef182f in _dl_catch_error () from /lib64/libc.so.6
#16 0x00007ffff7e28b98 in ?? () from /lib64/libc.so.6
#17 0x00007ffff7e29181 in dlopen () from /lib64/libc.so.6
#18 0x00007fffe7704107 in amd::Os::loadLibrary (libraryname=libraryname@entry=0x7fffe77b310b "libamd_comgr.so.2") at /usr/src/debug/dev-libs/rocm-opencl-runtime-5.3.3/ROCclr-rocm-5.3.3/os/os.cpp:76
#19 0x00007fffe7767b91 in amd::Comgr::LoadLib () at /usr/src/debug/dev-libs/rocm-opencl-runtime-5.3.3/ROCclr-rocm-5.3.3/device/comgrctx.cpp:37
#20 0x00007ffff7e320fa in ?? () from /lib64/libc.so.6
#21 0x00007fffe76ed5f1 in __gthread_once (__func=<optimized out>, __once=<optimized out>) at /usr/lib/gcc/x86_64-pc-linux-gnu/11/include/g++-v11/x86_64-pc-linux-gnu/bits/gthr-default.h:700
#22 std::call_once<bool (&)()> (__f=<optimized out>, __once=...) at /usr/lib/gcc/x86_64-pc-linux-gnu/11/include/g++-v11/mutex:783
#23 amd::Device::ValidateComgr (this=this@entry=0x555555794b80) at /usr/src/debug/dev-libs/rocm-opencl-runtime-5.3.3/ROCclr-rocm-5.3.3/device/device.cpp:533
#24 0x00007fffe772fec1 in roc::Device::create (this=0x555555794b80) at /usr/src/debug/dev-libs/rocm-opencl-runtime-5.3.3/ROCclr-rocm-5.3.3/device/rocm/rocdevice.cpp:639
#25 0x00007fffe7730a39 in roc::Device::init () at /usr/src/debug/dev-libs/rocm-opencl-runtime-5.3.3/ROCclr-rocm-5.3.3/device/rocm/rocdevice.cpp:489
#26 0x00007fffe76ed053 in amd::Device::init () at /usr/src/debug/dev-libs/rocm-opencl-runtime-5.3.3/ROCclr-rocm-5.3.3/device/device.cpp:454
#27 0x00007fffe772100e in amd::Runtime::init () at /usr/src/debug/dev-libs/rocm-opencl-runtime-5.3.3/ROCclr-rocm-5.3.3/platform/runtime.cpp:75
#28 0x00007fffe76c5615 in ShouldLoadPlatform () at /usr/src/debug/dev-libs/rocm-opencl-runtime-5.3.3/ROCm-OpenCL-Runtime-rocm-5.3.3/amdocl/cl_icd.cpp:224
#29 operator() (__closure=<optimized out>) at /usr/src/debug/dev-libs/rocm-opencl-runtime-5.3.3/ROCm-OpenCL-Runtime-rocm-5.3.3/amdocl/cl_icd.cpp:274
#30 std::__invoke_impl<void, clIcdGetPlatformIDsKHR(cl_uint, _cl_platform_id**, cl_uint*)::<lambda()> > (__f=...) at /usr/lib/gcc/x86_64-pc-linux-gnu/11/include/g++-v11/bits/invoke.h:61
#31 std::__invoke<clIcdGetPlatformIDsKHR(cl_uint, _cl_platform_id**, cl_uint*)::<lambda()> > (__fn=...) at /usr/lib/gcc/x86_64-pc-linux-gnu/11/include/g++-v11/bits/invoke.h:96
#32 operator() (__closure=<optimized out>) at /usr/lib/gcc/x86_64-pc-linux-gnu/11/include/g++-v11/mutex:776
--Type <RET> for more, q to quit, c to continue without paging--c
#33 operator() (__closure=<optimized out>) at /usr/lib/gcc/x86_64-pc-linux-gnu/11/include/g++-v11/mutex:712
#34 _FUN () at /usr/lib/gcc/x86_64-pc-linux-gnu/11/include/g++-v11/mutex:712
#35 0x00007ffff7e320fa in ?? () from /lib64/libc.so.6
#36 0x00007fffe76c66eb in __gthread_once (__func=<optimized out>, __once=0x7fffe77f6080 <clIcdGetPlatformIDsKHR::initOnce>) at /usr/lib/gcc/x86_64-pc-linux-gnu/11/include/g++-v11/x86_64-pc-linux-gnu/bits/gthr-default.h:700
#37 std::call_once<clIcdGetPlatformIDsKHR(cl_uint, _cl_platform_id**, cl_uint*)::<lambda()> > (__once=..., __f=...) at /usr/lib/gcc/x86_64-pc-linux-gnu/11/include/g++-v11/mutex:783
#38 clIcdGetPlatformIDsKHR (num_entries=<optimized out>, platforms=0x0, num_platforms=0x7fffffffd39c) at /usr/src/debug/dev-libs/rocm-opencl-runtime-5.3.3/ROCm-OpenCL-Runtime-rocm-5.3.3/amdocl/cl_icd.cpp:274
#39 0x00007ffff7f834b0 in ?? () from /usr/lib64/libOpenCL.so.1
#40 0x00007ffff7f888c2 in ?? () from /usr/lib64/libOpenCL.so.1
#41 0x00007ffff7f88aa2 in ?? () from /usr/lib64/libOpenCL.so.1
#42 0x00007ffff7e320fa in ?? () from /lib64/libc.so.6
#43 0x00007ffff7f845e3 in clGetPlatformIDs () from /usr/lib64/libOpenCL.so.1
#44 0x000055555555b4b5 in ?? ()
#45 0x00007ffff7dcc34c in ?? () from /lib64/libc.so.6
#46 0x00007ffff7dcc3fc in __libc_start_main () from /lib64/libc.so.6
#47 0x000055555555bac1 in ?? ()
(gdb) continue
Continuing.
adding option 'h'
mesa: CommandLine Error: Option 'h' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options

Thread 1 "clinfo" received signal SIGABRT, Aborted.
0x00007ffff7e2ec3c in ?? () from /lib64/libc.so.6
(gdb) backtrace
#0  0x00007ffff7e2ec3c in ?? () from /lib64/libc.so.6
#1  0x00007ffff7de0ff2 in raise () from /lib64/libc.so.6
#2  0x00007ffff7dcb473 in abort () from /lib64/libc.so.6
#3  0x00007fffeb4c574f in llvm::report_fatal_error (Reason=..., GenCrashDiag=<optimized out>) at /usr/src/debug/sys-devel/llvm-15.0.6/llvm/lib/Support/ErrorHandling.cpp:123
#4  0x00007fffeb7e0671 in llvm::report_fatal_error (Reason=Reason@entry=0x7fffef642a80 "inconsistency in registered CommandLine options", GenCrashDiag=GenCrashDiag@entry=true) at /usr/src/debug/sys-devel/llvm-15.0.6/llvm/lib/Support/ErrorHandling.cpp:83
#5  0x00007fffeb7bc7b3 in (anonymous namespace)::CommandLineParser::addOption (this=this@entry=0x5555555891c0, O=O@entry=0x7ffecf5044a0 <SectionHeadersShorter>, SC=0x555555589340) at /usr/src/debug/sys-devel/llvm-15.0.6/llvm/lib/Support/CommandLine.cpp:245
#6  0x00007fffeb7bd1cb in (anonymous namespace)::CommandLineParser::addOption (ProcessDefaultOption=false, O=0x7ffecf5044a0 <SectionHeadersShorter>, this=0x5555555891c0) at /usr/src/debug/sys-devel/llvm-15.0.6/llvm/lib/Support/CommandLine.cpp:265
#7  (anonymous namespace)::CommandLineParser::addOption (ProcessDefaultOption=false, O=0x7ffecf5044a0 <SectionHeadersShorter>, this=0x5555555891c0) at /usr/src/debug/sys-devel/llvm-15.0.6/llvm/lib/Support/CommandLine.cpp:258
#8  llvm::cl::Option::addArgument (this=this@entry=0x7ffecf5044a0 <SectionHeadersShorter>) at /usr/src/debug/sys-devel/llvm-15.0.6/llvm/lib/Support/CommandLine.cpp:449
#9  0x00007ffecec55e68 in llvm::cl::alias::done (this=this@entry=0x7ffecf5044a0 <SectionHeadersShorter>) at /usr/lib/llvm/15/include/llvm/Support/CommandLine.h:1875
#10 0x00007ffecec56a6a in llvm::cl::alias::alias<char [2], llvm::cl::desc, llvm::cl::aliasopt> (this=0x7ffecf5044a0 <SectionHeadersShorter>) at /usr/lib/llvm/15/include/llvm/Support/CommandLine.h:1893
#11 0x00007ffecec1153f in __static_initialization_and_destruction_0 (__priority=65535, __initialize_p=1) at /usr/src/debug/dev-libs/rocm-comgr-5.3.3/ROCm-CompilerSupport-rocm-5.3.3/lib/comgr/src/comgr-objdump.cpp:180
#12 0x00007ffff7fcdd9e in ?? () from /lib64/ld-linux-x86-64.so.2
#13 0x00007ffff7fcde8c in ?? () from /lib64/ld-linux-x86-64.so.2
#14 0x00007ffff7ef17c5 in _dl_catch_exception () from /lib64/libc.so.6
#15 0x00007ffff7fd44e6 in ?? () from /lib64/ld-linux-x86-64.so.2
#16 0x00007ffff7ef1764 in _dl_catch_exception () from /lib64/libc.so.6
#17 0x00007ffff7fd487b in ?? () from /lib64/ld-linux-x86-64.so.2
#18 0x00007ffff7e290c8 in ?? () from /lib64/libc.so.6
#19 0x00007ffff7ef1764 in _dl_catch_exception () from /lib64/libc.so.6
#20 0x00007ffff7ef182f in _dl_catch_error () from /lib64/libc.so.6
#21 0x00007ffff7e28b98 in ?? () from /lib64/libc.so.6
#22 0x00007ffff7e29181 in dlopen () from /lib64/libc.so.6
#23 0x00007fffe7704107 in amd::Os::loadLibrary (libraryname=libraryname@entry=0x7fffe77b310b "libamd_comgr.so.2") at /usr/src/debug/dev-libs/rocm-opencl-runtime-5.3.3/ROCclr-rocm-5.3.3/os/os.cpp:76
#24 0x00007fffe7767b91 in amd::Comgr::LoadLib () at /usr/src/debug/dev-libs/rocm-opencl-runtime-5.3.3/ROCclr-rocm-5.3.3/device/comgrctx.cpp:37
#25 0x00007ffff7e320fa in ?? () from /lib64/libc.so.6
#26 0x00007fffe76ed5f1 in __gthread_once (__func=<optimized out>, __once=<optimized out>) at /usr/lib/gcc/x86_64-pc-linux-gnu/11/include/g++-v11/x86_64-pc-linux-gnu/bits/gthr-default.h:700
#27 std::call_once<bool (&)()> (__f=<optimized out>, __once=...) at /usr/lib/gcc/x86_64-pc-linux-gnu/11/include/g++-v11/mutex:783
#28 amd::Device::ValidateComgr (this=this@entry=0x555555794b80) at /usr/src/debug/dev-libs/rocm-opencl-runtime-5.3.3/ROCclr-rocm-5.3.3/device/device.cpp:533
#29 0x00007fffe772fec1 in roc::Device::create (this=0x555555794b80) at /usr/src/debug/dev-libs/rocm-opencl-runtime-5.3.3/ROCclr-rocm-5.3.3/device/rocm/rocdevice.cpp:639
#30 0x00007fffe7730a39 in roc::Device::init () at /usr/src/debug/dev-libs/rocm-opencl-runtime-5.3.3/ROCclr-rocm-5.3.3/device/rocm/rocdevice.cpp:489
#31 0x00007fffe76ed053 in amd::Device::init () at /usr/src/debug/dev-libs/rocm-opencl-runtime-5.3.3/ROCclr-rocm-5.3.3/device/device.cpp:454
#32 0x00007fffe772100e in amd::Runtime::init () at /usr/src/debug/dev-libs/rocm-opencl-runtime-5.3.3/ROCclr-rocm-5.3.3/platform/runtime.cpp:75
--Type <RET> for more, q to quit, c to continue without paging--c
#33 0x00007fffe76c5615 in ShouldLoadPlatform () at /usr/src/debug/dev-libs/rocm-opencl-runtime-5.3.3/ROCm-OpenCL-Runtime-rocm-5.3.3/amdocl/cl_icd.cpp:224
#34 operator() (__closure=<optimized out>) at /usr/src/debug/dev-libs/rocm-opencl-runtime-5.3.3/ROCm-OpenCL-Runtime-rocm-5.3.3/amdocl/cl_icd.cpp:274
#35 std::__invoke_impl<void, clIcdGetPlatformIDsKHR(cl_uint, _cl_platform_id**, cl_uint*)::<lambda()> > (__f=...) at /usr/lib/gcc/x86_64-pc-linux-gnu/11/include/g++-v11/bits/invoke.h:61
#36 std::__invoke<clIcdGetPlatformIDsKHR(cl_uint, _cl_platform_id**, cl_uint*)::<lambda()> > (__fn=...) at /usr/lib/gcc/x86_64-pc-linux-gnu/11/include/g++-v11/bits/invoke.h:96
#37 operator() (__closure=<optimized out>) at /usr/lib/gcc/x86_64-pc-linux-gnu/11/include/g++-v11/mutex:776
#38 operator() (__closure=<optimized out>) at /usr/lib/gcc/x86_64-pc-linux-gnu/11/include/g++-v11/mutex:712
#39 _FUN () at /usr/lib/gcc/x86_64-pc-linux-gnu/11/include/g++-v11/mutex:712
#40 0x00007ffff7e320fa in ?? () from /lib64/libc.so.6
#41 0x00007fffe76c66eb in __gthread_once (__func=<optimized out>, __once=0x7fffe77f6080 <clIcdGetPlatformIDsKHR::initOnce>) at /usr/lib/gcc/x86_64-pc-linux-gnu/11/include/g++-v11/x86_64-pc-linux-gnu/bits/gthr-default.h:700
#42 std::call_once<clIcdGetPlatformIDsKHR(cl_uint, _cl_platform_id**, cl_uint*)::<lambda()> > (__once=..., __f=...) at /usr/lib/gcc/x86_64-pc-linux-gnu/11/include/g++-v11/mutex:783
#43 clIcdGetPlatformIDsKHR (num_entries=<optimized out>, platforms=0x0, num_platforms=0x7fffffffd39c) at /usr/src/debug/dev-libs/rocm-opencl-runtime-5.3.3/ROCm-OpenCL-Runtime-rocm-5.3.3/amdocl/cl_icd.cpp:274
#44 0x00007ffff7f834b0 in ?? () from /usr/lib64/libOpenCL.so.1
#45 0x00007ffff7f888c2 in ?? () from /usr/lib64/libOpenCL.so.1
#46 0x00007ffff7f88aa2 in ?? () from /usr/lib64/libOpenCL.so.1
#47 0x00007ffff7e320fa in ?? () from /lib64/libc.so.6
#48 0x00007ffff7f845e3 in clGetPlatformIDs () from /usr/lib64/libOpenCL.so.1
#49 0x000055555555b4b5 in ?? ()
#50 0x00007ffff7dcc34c in ?? () from /lib64/libc.so.6
#51 0x00007ffff7dcc3fc in __libc_start_main () from /lib64/libc.so.6
#52 0x000055555555bac1 in ?? ()
(gdb) continue
Continuing.
Couldn't get registers: No such process.
(gdb) [Thread 0x7fffe49ff6c0 (LWP 11933) exited]
[Thread 0x7fffe59fc6c0 (LWP 11932) exited]
[Thread 0x7fffe61fd6c0 (LWP 11931) exited]
[Thread 0x7fffe69fe6c0 (LWP 11930) exited]
[Thread 0x7fffe71ff6c0 (LWP 11881) exited]

Program terminated with signal SIGABRT, Aborted.
The program no longer exists.

The program is not being run.
(gdb) quit

Thanks, this shows that the second “h” option isn’t coming from LLVM but directly from Rocm globals options here: ROCm-CompilerSupport/comgr-objdump.cpp at amd-stg-open · RadeonOpenCompute/ROCm-CompilerSupport · GitHub

1 Like

This is the related bug report in RocM. The linked comment states, that big LLVM changes are required for this to be fixed. Which changes could he refer to and is there a change for these to be addressed by the thread @Flakebi linked?

I abandoned D141019 for now, because the issue can be resolved in RocM and D129129 and D129134 seem to address that issue. Since mixing shared LLVM versions causes segmentation faults, I’ll postpone testing of those revisions until their release in LLVM 16 and eventually continue the discussion, if they did not resolve these issues.

@mehdi_amini: Many thanks for guiding me to the root cause of this issue. Apologies, if my suggestion was a bit stupid.

1 Like