[PATCH] D141019: Support/CommandLine: replace argument mapping error with a warning

Manuel Ullmann via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 6 17:02:20 PST 2023


labre added a comment.

Yes, of course. The problem encoutered is, that loading two libraries via an OpenCL ICD loader [1,2] linking to the same libLLVM triggers the CommandLine error exactly at the revised code lines.  I suspect, that the general problem is an abort by libLLVM when loading more than one library linking to any version including the same version.

It should be noted, that compiling exactly one of the libraries with the revised LLVM version removes the warning/error entirely, for instance if mesa is compiled with -Dgallium-opencl=yes (Clover) and an unpatched LLVM and RocM is compiled with the revised LLVM there will be no error or warning printed.  So both versions have to be compiled either with or without the change for an error/warning to occur.

Mesa+RocM:

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



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

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
  ...

Without revision:

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

The same applies to using hardware decoding via mpv with the Vapoursynth plugin SVP, which just loads OpenCL functions via the ICD loader. There is no static linking against libLLVM involved.  Otherwise the revision could not have resolved it, because the statically linked libLLVM would have triggered the error instead.

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

RocM linking see above.

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



  (+) 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

I’ll open a RFC on that matter.

[1]: https://github.com/KhronosGroup/OpenCL-ICD-Loader
[2]: https://github.com/OCL-dev/ocl-icd


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141019/new/

https://reviews.llvm.org/D141019



More information about the llvm-commits mailing list