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

OpenCL interop version mismatch #125

Closed
64 opened this issue Sep 30, 2018 · 9 comments
Closed

OpenCL interop version mismatch #125

64 opened this issue Sep 30, 2018 · 9 comments

Comments

@64
Copy link

64 commented Sep 30, 2018

Looks like the current version of ocl_interop on crates.io hasn't been updated in a while. It still depends on ocl 0.16.0 and gives a type mismatch when you try to use it with ocl 0.19.0:

error[E0308]: mismatched types
  --> src/frame.rs:29:33
   |
29 |         let ctx: ocl::Context = ocl_interop::get_context().unwrap();
   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `ocl::Context`, found struct `ocl::standard::context::Context`
   |
   = note: expected type `ocl::Context`
              found type `ocl::standard::context::Context`
note: Perhaps two different versions of crate `ocl` are being used?
  --> src/frame.rs:29:33
   |
29 |         let ctx: ocl::Context = ocl_interop::get_context().unwrap();
   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
@c0gent
Copy link
Member

c0gent commented Sep 30, 2018

I've forgotten about ocl_interop lately. I need to create a test for it or something to make sure it stays up to date...

Please feel free to submit a PR to update or else I'll take care of it tomorrow. I'm away from my computer for the day.

Thanks :)

@64
Copy link
Author

64 commented Sep 30, 2018

I think the Cargo.toml is actually correct, but it just needs to be published.

@c0gent
Copy link
Member

c0gent commented Sep 30, 2018

I see.

@c0gent
Copy link
Member

c0gent commented Oct 1, 2018

Do you happen to have SDL and GLFW installed? If so could you please try running the ocl-interop tests? I'm having all sorts of driver issues with OpenGL right now.

git clone https://github.com/cogciprocate/ocl.git
cd ocl/ocl-interop
cargo test

If that works I'll publish 0.2.0.

@64
Copy link
Author

64 commented Oct 1, 2018

    Finished dev [unoptimized + debuginfo] target(s) in 0.57s
     Running /tmp/ocl/target/debug/deps/ocl_interop-bb7f66ec97221dd7
running 1 test
test tests::it_doesnt_crash ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
     Running /tmp/ocl/target/debug/deps/lib-88fcb84903026332
running 1 test
error: Not implemented
error: test failed, to rerun pass '--test lib'

Does compile though. I'll hunt down where that error message is coming from and get back to you.

@64
Copy link
Author

64 commented Oct 1, 2018

Looks like it's caused by this line:

let cl_buff =
    ocl::Buffer::<f32>::from_gl_buffer(ocl_pq.queue(), None, self.gl_buff).unwrap();

https://github.com/cogciprocate/ocl/blob/master/ocl/src/standard/buffer.rs#L1740

Could also be a driver issue. I remember trying to get some non-rust examples of interop to work, but they were all giving me the same error (CL_MEM_OBJECT_ALLOCATION_FAILURE on clCreateFromGlTexture).

@c0gent
Copy link
Member

c0gent commented Oct 1, 2018

Ok well I'll mess with this on my laptop later if you can't get it to work. It's a pain to get everything set up properly to get these tests to run so thanks for trying.

@64
Copy link
Author

64 commented Oct 3, 2018

Yep it's a driver issue on my end: intel/beignet#5

I'll try and fiddle a bit more.

@c0gent
Copy link
Member

c0gent commented Jan 18, 2019

Looks like we can't totally solve your problem but ocl-interop 0.1.5 is published.

@c0gent c0gent closed this as completed Jan 18, 2019
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

2 participants