ocl icon indicating copy to clipboard operation
ocl copied to clipboard

NVIDIA drivers - `examples/events.rs` panic

Open pravic opened this issue 8 years ago • 12 comments

Now panics examples/events :)

Rest of examples works fine.

pravic avatar May 23 '16 06:05 pravic

I'm guessing you're on NVIDIA hardware? If so, I don't think there's anything that can be done until they fix their drivers.

c0gent avatar May 23 '16 16:05 c0gent

What default engine is choosed to run? 1st? If yes, than it is NVIDIA on my pc.

pravic avatar May 23 '16 16:05 pravic

set the OCL_DEFAULT_PLATFORM_IDX environment variable to 1 to use the second platform on your system (0 being the first).

c0gent avatar May 23 '16 17:05 c0gent

Well, with Intel OpenCL it works well.

pravic avatar May 23 '16 19:05 pravic

Yeah. AMD is fine too.

So if you avoid doing complex stuff with event callbacks you'll be fine. I never even use that particular functionality personally because there are other ways to achieve the same thing. I'm not entirely sure exactly what else is affected but that's the only thing I've uncovered in testing.

Shall we leave this issue open?

c0gent avatar May 23 '16 19:05 c0gent

Guess yes, because nobody reads the closed issues and you may receive the similar bugreports from everyone who tried ocl.

pravic avatar May 23 '16 19:05 pravic

Yeah, I put a note at the bottom of the README too but it's seldom read I guess.

c0gent avatar May 23 '16 19:05 c0gent

@pravic

If you ever get a chance, would you mind testing this again with the latest version of ocl on master.

I may have fixed the problem.

c0gent avatar Apr 05 '17 00:04 c0gent

I've had a look.

ocl\examples>for %f in (*.rs) do echo %f && cargo run --example %~nf > %~nf.log (run cargo for each .rs file in examples folder).

Here are the results. The following examples were crashed with access violation (segfault):

async_cycles.rs async_menagerie.rs async_process.rs device_check.rs

Panic in event_callbacks.rs:

thread '<unnamed>' panicked at 'assertion failed: `(left == right)` (left: `368`, right: `357`)', event_callbacks.rsthread ':<unnamed>52' panicked at '
assertion failed: `(left == right)` (left: `107`, right: `96`)note: Run with `RUST_BACKTRACE=1` for a backtrace.
', thread '<unnamed>' panicked at 'assertion failed: `(left == right)` (left: `77`, right: `66`)', event_callbacks.rs:52event_callbacks.rs
thread '<unnamed>' panicked at 'assertion failed: `(left == right)` (left: `167`, right: `156`)', event_callbacks.rs:52:
52

However, some of them printed something: example-logs.zip.

When I switched to Intel, I've got a crash with some kind of dumps printed to stderr, for example, async_events.rs: async_cycles.err.zip. event_callbacks worked fine with Intel though.

pravic avatar Apr 22 '17 18:04 pravic

Appreciate you taking the time to do that. I'll have a look and see if there's anything I can do on this end.

c0gent avatar Apr 23 '17 16:04 c0gent

I'm concerned about those segfaults but I doubt there's much I can do about them. The workaround is probably the async_block feature. The event_callback panic is likewise still a wontfix.

Looking at your panics on Intel though, it looks like some sort of issue setting event status. Did you experience the crash with the experimental (IDX: 1), the basic (IDX: 2) Intel platform, or both?

Could I trouble you to run any of the failing examples using the --features async_block switch?

Do tests pass (specifically the async::rw_vec test)?

Thanks a lot for your help.

c0gent avatar Apr 23 '17 21:04 c0gent

Yep. Sorry for delay, I forgot about it :)

Default run:

echo async_cycles.rs   && cargo run --example async_cycles  1>async_cycles.log
async_cycles.rs
    Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
     Running `t:\tamp\ocl\target\debug\examples\async_cycles.exe`
error: process didn't exit successfully: `t:\tamp\ocl\target\debug\examples\async_cycles.exe` (exit code: 3221225477)

With async_block:

cargo run --example async_cycles --features async_block
   Compiling ocl v0.13.1 (file:///T:/tamp/ocl)
   Compiling ocl-extras v0.1.0 (file:///T:/tamp/ocl/ocl-extras)
    Finished dev [unoptimized + debuginfo] target(s) in 8.99 secs
     Running `t:\tamp\ocl\target\debug\examples\async_cycles.exe`
Platform: NVIDIA CUDA
Device: NVIDIA Corporation GeForce GTX 650
Starting cycles (t: 0.000000s) ...
* Fill starting                 (iter: 0, t: 0.015600s) ...
* Fill complete                 (iter: 0, t: 6.736812s)
All commands for iteration 0 enqueued    (t: 6.736812s)
error: process didn't exit successfully: `t:\tamp\ocl\target\debug\examples\async_cycles.exe` (exit code: 3221225477)

Shows something, then crashes. The same with async_menagerie:

Task [9] (complex): Buffer initialized.
Task [10] (simple): Buffer initialized.
Buffer pool is now full.
Waiting on 14 tasks to complete...
Task [2]: Complete.
Task [1]: Complete.
Task [0]: Complete.
error: process didn't exit successfully: `t:\tamp\ocl\target\debug\examples\async_menagerie.exe` (exit code: 3221225477)

But async_process works well with this feature.

pravic avatar May 14 '17 17:05 pravic