Open trevorstr opened 10 months ago
I'm guessing dynamic linking fails because the libonnxruntime library isn't available while running in a sudo
environment.
I'm assuming you're on macOS, I'd recommend trying samply instead of flamegraph since the dtrace backend on macOS has generally not been that great.
I'm guessing dynamic linking fails because the libonnxruntime library isn't available while running in a
sudo
environment.I'm assuming you're on macOS, I'd recommend trying samply instead of flamegraph since the dtrace backend on macOS has generally not been that great.
Actually, I had mentioned in my original post that I already tried samply as well. 🙂 I received a similar result with both profilers.
Ah, sorry -- missed that. Anyway, my other point stands, and might apply to samply as well if you're using sudo
to run it?
I tried running flamegraph on another application, which does not use the ort
crate. Instead, it relies on tokio
and the aws-config
crate. Flamegraph worked just fine, when invoked on that binary, using sudo
.
I have to run flamegraph
with sudo
, otherwise I get a permissions issue from dtrace.
dtrace: system integrity protection is on, some features will not be available
dtrace: failed to initialize dtrace: DTrace requires additional privileges
failed to sample program
Seems like the issue is specific to ONNX.
I'm having a similar issue. Was wondering whether sudo
could be passed the --preserve-env
argument with a list that includes DYLD_LIBRARY_PATH
, DYLD_FALLBACK_LIBRARY_PATH
, etc.?
Sounds reasonable to me, want to submit a PR?
Summary
I'm using CoreML with the ONNX runtime (
ort
crate) to run inference against a machine learning model.I want to use flamegraph to find out where performance limitations might be occurring. My objective is to optimize my program for speed, and remove any unnecessary code.
After installing flamegraph, I tried running it and immediately received an error. This error is blocking me from making any progress with flamegraph.
I also tried samply, but received a similar result. Hence, I don't believe this problem is necessarily specific to only flamegraph.
Actual Result
When I run
flamegraph
against my program, I get the following error:Expected Result
I expected flamegraph to profile my code and generate an SVG file.