Closed vinayhpandya closed 2 months ago
I'm not getting a segfault with that. Which version of MLX are you using? Also maybe good to make sure you have the right version of nanobind installed.
pip install --force-reinstall nanobind@git+https://github.com/wjakob/nanobind.git@2f04eac452a6d9142dedb957701bdb20125561e4
You are running the example in mlx/examples/extensions
without any modification right?
I am using the latest version of mlx. I tried to build it from source and was stuck so used setup.py instead to build the package.
Correct, I did not make any modifications to mlx/examples/extensions
package.
I was able to solve the segmentation fault after uninstalling and re-installing mlx from the source, I believe the xcode settings which I used were not compatible as the error suggests that there was an issue in linking the library itself
I am able to build this now and test the extension.
Here's what I did to resolve this
xcode-select --install
and then select active developer directory sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
mkdir -p build && cd build
and cmake .. && make -j
.make install
python3 setup.py build_ext --inplace
Sounds good.. I'm not sure what went wrong there. Maybe you were using an older xcode/sdk version which we do not support 🤔 ..
Describe the bug Segmentation fault issue when running custom operations while following the tutorial
To Reproduce
python3 setup.py build_ext --inplace
-- output from the commandInclude code snippet
Expected behavior No segmentation fault and the operation alpha x + beta y should succeed and result be stored in new array
Desktop (please complete the following information):
Additional context This issue persists even after cleaning and uninstalling mlx Running debugger lldb results in linking problem which is difficult to backtrace