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

"Error making renderer: Unknown Filter Metadata version : 1493536072" in the preview panel. Please advice. #2

Open
saurabhkm opened this issue Aug 23, 2017 · 14 comments

Comments

@saurabhkm
Copy link

I have followed the steps listed down and also given the location of Halide extraction folder. But I get this error in the preview pane for any of the example files I open. Toggling the preview doesn't help either.

@silly-git
Copy link

Did you get anywhere with this? I'm having the same issue. I've tried it on both Windows and OSX, each with the same error.

I think it might be happening because the function render_metadata is not getting defined, or at least not correctly. If in examples/main.cpp I do this:

theFunc.compile_to_header(argv[1] + std::string("_Header"), arguments, argv[2], target);

I can see by looking at the generated header that render_metadata is declared:

const struct halide_filter_metadata_t *render_metadata() HALIDE_FUNCTION_ATTRS;

Using the other theFunc.compile_to_XXX()'s to generate different types I wasn't able to find any definition of render_metadata.

In examples/lib/halide-lib-binder.coffee:

@renderLibrary = ffi.DynamicLibrary( libpath, DLFLAGS.RTLD_NOW )
rawfn = @renderLibrary.get fnname
struct = @renderLibrary.get fnname + "_metadata"
struct = struct.reinterpret(HalideFilterMetadata.size)
metadata = new HalideFilterMetadata(struct)

The library is loaded correctly and render_metadata is found, but the cast appears to leave "metadata" corrupted and metadata.version is uninitialized. I searched through the Halide code and couldn't find any reference to "render_metadata".

Unfortunately I'm out of ideas - any help on this would be greatly appreciated.

@dan-tull
Copy link
Contributor

dan-tull commented Jun 7, 2018

I can take a look. I haven't been following changes in Atom or Halide for a while, but maybe it won't be too tough to get to the bottom of this. Once I remember how it worked, I mean.

@silly-git
Copy link

That'd be fantastic Dan, let me know if I can do anything.

@dan-tull
Copy link
Contributor

dan-tull commented Jun 7, 2018

I had an additional problem before I could get the libHalide.dylib in the binary release of Halide to load. First off, I had to change the Makefile (which referred to libHalide.so) and then I had to deal with the fact that the library expected to be at a different (absolute) path on disk. I suspect this wouldn't have been an issue if I had built Halide from source since it might still make the .so and the path to it would match its path on disk.

For the original issue, the struct halide_filter_metadata_t definition doesn't appear to have changed (still has a version as the first 32-bit value and its value is expected to be 0), but if I'm reading that header right, the render_metadata entry is now a function that returns a pointer to a struct and not the struct itself, so I need to add code to call it and handle the result, I think.

@silly-git
Copy link

silly-git commented Jun 7, 2018

Not sure if it helps but I added the install_name_tool line to the following in examples/Makefile to deal with the path issue:

    mkdir -p build
    install_name_tool -change /Users/halidenightly/build_bot_new/worker/mac-64-trunk/halide-build/bin/libHalide.dylib @executable_path/bin/libHalide.dylib ./$<
    ./$< build/$* render
    sleep 60```

@dan-tull
Copy link
Contributor

dan-tull commented Jun 7, 2018

A little more info: the filter metadata call was easy enough to fix, but then I realized the format of the structs used to describe the filters arguments has changed. Once I got that sorted out I realized the structs that describe buffer configuration (strides, extents, etc) has also substantially changed.

So... that's taking me a while to sort out.

@silly-git
Copy link

silly-git commented Jun 7, 2018

Thanks Dan, I appreciate your time - I'll donate a case of beer to the cause, not that that will cover the cost of your time.

@dan-tull
Copy link
Contributor

dan-tull commented Jun 7, 2018

I think this will work, though I only tried it on the Mac: 523238d

@silly-git
Copy link

Works! Now how can I pay you for the beer?

@dan-tull
Copy link
Contributor

dan-tull commented Jun 8, 2018

No worries. I don't drink beer and it was kinda fun to dust this off again and get it operational (apologies to @saurabhkm for not responding to the original post -- better late than never, I guess).

How about just doing something cool and sharing a video demo?

@silly-git
Copy link

The donation doesn’t need to be for beer I won’t get you to show me a receipt ;) how about coffee for a week? but I can also do a video.

The tool is very cool and makes learning Halide a breeze - you’ve saved us all a ton of time.

@dan-tull
Copy link
Contributor

Ha, money does not mean that much to me. Hearing that at least a few folks have found this useful is far better than any monetary compensation.

DT

@silly-git
Copy link

Ok cool, I'll do a video for it soon.

@silly-git
Copy link

Sorry Dan, I still do intend to do the video but I need to spend some more time with Halide before I can do that in a way that's different to yours. Unfortunately I have some fires to put out before I can get back to it, but it'll happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants