scopehal-apps icon indicating copy to clipboard operation
scopehal-apps copied to clipboard

macOS: ngscopeclient tries to dlopen all of /opt/homebrew

Open rgov opened this issue 2 years ago • 6 comments

On macOS 14.0, I built ngscopeclient 6056adc479ba2a80531e1b535b7b7052c2a8a153 and got it running with the workarounds covered in other issues plus the environment variables from https://github.com/ngscopeclient/scopehal-docs/pull/58.

When starting up, I get several complaints from Tensorflow, then the program aborts.

2023-10-29 14:14:13.425505: W tensorflow/core/common_runtime/input_colocation_exemption_registry.cc:33] Input colocation exemption for op: IdentityN already registered
2023-10-29 14:14:13.430134: E tensorflow/tsl/lib/monitoring/collection_registry.cc:81] Cannot register 2 metrics with the same name: /tensorflow/serving/batching/enable_large_batch_splitting
2023-10-29 14:14:13.433836: E tensorflow/tsl/lib/monitoring/collection_registry.cc:81] Cannot register 2 metrics with the same name: /tensorflow/api/op/using_fake_quantization
2023-10-29 14:14:13.442854: F tensorflow/core/framework/function.cc:2027] Check failed: GetOpGradFactory()->insert({op, func}).second Duplicated gradient for Softmax
zsh: abort      ngscopeclient

... are you using Tensorflow?

rgov avatar Oct 29 '23 21:10 rgov

No, it looks like somehow it is loading ... every single binary in /opt/homebrew. Impressive.

Is there a plugin auto discovery and loading mechanism perhaps?

rgov avatar Oct 29 '23 21:10 rgov

I think what might be happening is something funky happening with the plugin loading code, where it thinks /opt/homebrew is the plugin search directory so it's trying to dlopen() everything there?

Like I said, system wide installation on macos has never been tested.

azonenberg avatar Oct 29 '23 21:10 azonenberg

  • @lainy as well since I don't have a mac to test on

azonenberg avatar Oct 29 '23 21:10 azonenberg

Could you point me to the plugin loading code and what the install paths look like on Linux?

rgov avatar Oct 29 '23 21:10 rgov

It looks like we have a workaround for this exact issue but /opt/homebrew isn't included.

https://github.com/ngscopeclient/scopehal/blob/master/scopehal/scopehal.cpp?ts=4#L299

azonenberg avatar Oct 29 '23 21:10 azonenberg

https://github.com/ngscopeclient/scopehal-apps/issues/393

Workaround:

    # Patch plugin enumeration code to fix #393, #623
    inreplace "lib/scopehal/scopehal.cpp",
      'if(binDir.find("/usr") != 0)',
      "if(binDir.find(\"#{HOMEBREW_PREFIX}\") != 0)"

rgov avatar Oct 29 '23 21:10 rgov

Closing as this appears to have been fixed at some point. Please re-open if this is incorrect.

lainy avatar Oct 04 '24 07:10 lainy