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

[BUG] Rust compiler optimizations crashes arrayfire #299

Closed
BA8F0D39 opened this issue May 30, 2021 · 6 comments
Closed

[BUG] Rust compiler optimizations crashes arrayfire #299

BA8F0D39 opened this issue May 30, 2021 · 6 comments
Assignees
Milestone

Comments

@BA8F0D39
Copy link
Contributor

Description

Similar to bug #73 , rust compiler optimizations create instability the program and will result in a crash

Setting compiler optimizations to the highest level

[profile.release]
opt-level = 3

and building a rust program in release mode

cargo build --release

crashes my program and GPU drivers.
Hilariously, my screen turned blank and I didn't get to see the error message.

@BA8F0D39 BA8F0D39 added the Bug label May 30, 2021
@9prady9
Copy link
Member

9prady9 commented May 31, 2021

Can you also please update the description with details like OS, ArrayFire(installed library) version, ArrayFire crate version, Backend being used, GPU driver version.

To get some clarification, just compiling cargo build --release is causing the crash or running the program built with opt-level=3 is causing the crash ?

@9prady9 9prady9 self-assigned this May 31, 2021
@BA8F0D39
Copy link
Contributor Author

BA8F0D39 commented Oct 5, 2021

It seems jemalloc isn't compatible with arrayfire

#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;

@9prady9
Copy link
Member

9prady9 commented Oct 6, 2021

@BA8F0D39 I assume, you are referring to the CPU backend because it should not be a problem for CUDA/OpenCL except in few minor set of APIs where host side allocations take place for strings etc.

I haven't used jemalloc, so I would have to try it and check where the incompatibility stems from. Is it the upstream lib or something in rust crate. I suspect it could be upstream lib but cannot be certain about it yet.

@9prady9
Copy link
Member

9prady9 commented Dec 23, 2021

Sorry, couldn't get back to this. Will try this weekend.

@9prady9 9prady9 added this to the 3.8.1 milestone Dec 23, 2021
@9prady9
Copy link
Member

9prady9 commented Feb 19, 2022

can you please tell how do I reproduce this on my end ? perhaps your stand alone code from your project that uses jemalloc.

Just the opt-level(3) and --release flag definitely aren't the problem as you have already pointed that out and I was able to run examples with those settings. Graphics examples are not working on my current system, but I don't think these are related.

@9prady9
Copy link
Member

9prady9 commented May 9, 2022

Closing due to inactivity @BA8F0D39 feel free to re-open if you still have the issue reported or more info to share.

@9prady9 9prady9 closed this as completed May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants