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

Crash when call ov::core.comile_model #27440

Open
Jsy0220 opened this issue Nov 7, 2024 · 9 comments
Open

Crash when call ov::core.comile_model #27440

Jsy0220 opened this issue Nov 7, 2024 · 9 comments
Assignees
Labels
needs reproducer Provide complete minimal reproducer with input data

Comments

@Jsy0220
Copy link

Jsy0220 commented Nov 7, 2024

Hi
I upgraded OpenVino from 2022.1 to 2024.0 for my application recently. Following are the situation:

  1. Always crash at ov::core.compile_model no matter what model loaded when test in unittest.
  2. both official lib and locally compiled lib have been tried, same crash.
  3. when the application compiled as a dynamic lib loaded in another application, there was no crash.
WeChatWorkScreenshot_254fb43b-594c-429f-ae13-103d22122c4d

Any ideas ?
Thank you so much !!

@ilya-lavrenov
Copy link
Contributor

Hi @Jsy0220
We need a reproducer, as we cannot magically guess what happened.

@ilya-lavrenov ilya-lavrenov added the needs reproducer Provide complete minimal reproducer with input data label Nov 7, 2024
@Jsy0220
Copy link
Author

Jsy0220 commented Nov 7, 2024

@ilya-lavrenov hi, I found that when the application links both OpenVino and tbb libs, it would happen. Specifically these two:
WeChatWorkScreenshot_d038ef07-e643-4239-8635-8ceafcdbcd25
I guess there may be a symbol conflict ?

@ilya-lavrenov
Copy link
Contributor

it's hard to guess without code reproducer.

@Jsy0220
Copy link
Author

Jsy0220 commented Nov 8, 2024

@ilya-lavrenov Sorry, there is no special code to reproduce it, just link these two libs and load a model to run ov::core.compile_model() like example hello_classification

@rang-inspekto
Copy link

rang-inspekto commented Dec 23, 2024

I get a similar issue when using libtcmalloc.so.4.
Using OpenVino 2024.6, Tensorflow 2.18, Python 3.11 (installing from pip).

simple code to reproduce:

import numpy as np
import openvino as ov
from openvino.runtime import Core
import tensorflow as tf
from tensorflow.keras.applications import ResNet101
from tensorflow.keras.layers import Input

tf.config.experimental.set_visible_devices([], 'GPU')

# Step 1: Load the Keras model
input_tensor = Input(shape=(224, 224, 3), name="input_layer")
model = ResNet101(weights="imagenet", input_tensor=input_tensor)

# Step 2: Convert the Keras model to OpenVINO IR format
print('started converting model')
ir_model = ov.convert_model(model)
print('finished converting model')

# Step 3: Compile the OpenVINO model
print('opening core')
core = Core()
print('compiling')
compiled_model = core.compile_model(
    model=ir_model,  # Use the converted model
    device_name="CPU",  # Specify the device (e.g., "CPU", "GPU")
)
print('finished compiling model')

# Step 4: Test the compiled model (Optional)
input_layer = compiled_model.input(0)
output_layer = compiled_model.output(0)

# Create a dummy input for testing
dummy_input = np.random.rand(1, 224, 224, 3).astype(np.float32)

# Perform inference
result = compiled_model([dummy_input])
print("Inference result:", result)

print("Model compilation and testing complete.")

When adding libtcmalloc.so.4 to LD_PRELOAD I get this:

started converting model
finished converting model
opening core
compiling
free(): invalid pointer

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

Same thing when adding libtbbmalloc_proxy.so to LD_PRELOAD.

@Jsy0220
Copy link
Author

Jsy0220 commented Dec 25, 2024

@rang-inspekto Hi, I think there may be a symbol conflict but not sure.
@ilya-lavrenov Hi, Could you reproduce it according to the sample offered by @rang-inspekto ? and how to solve it ?

@Jsy0220
Copy link
Author

Jsy0220 commented Jan 20, 2025

@rang-inspekto Hi, have you solved this problem ? I think I will use both tcmalloc and vino next too.

@rang-inspekto
Copy link

I'm also waiting for this to be fixed and currently workaround it by not using the additional malloc libs.

@Jsy0220
Copy link
Author

Jsy0220 commented Jan 20, 2025

@rang-inspekto okay, I have tried to ask them again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs reproducer Provide complete minimal reproducer with input data
Projects
None yet
Development

No branches or pull requests

3 participants