-
While running the following:
I get the following error:
If I make the Array smaller (change every occurrence of 1_000_000 to 100_000 for example) it works fine.
|
Beta Was this translation helpful? Give feedback.
Replies: 13 comments
-
Please run the program with It doesn't seem like ArrayFire error, if a GPU runs out of memory, the crate will panic with an error out of memory. Which OS are you running on ? what is your GPU ? Dim4 stores u64 values that represent of the length of given dimension(axis). ArrayFire can store array shapes up to 4 dimensions, hence the Dim4. You have to consider the size of array |
Beta Was this translation helpful? Give feedback.
-
I never worked with the backtrace, how do I use it correctly on Windows ? I'm using Windows 10 64bit with a GeForce GTX 1060 6GB (6144MB). Ok, I understand that even though the function can take u64 everything is limited by my GPU. |
Beta Was this translation helpful? Give feedback.
-
True, but it is very unlikely that causes a stack overflow error. I have tried the same snippet on GTX 1060 3GB card and it works fine. Did you try just the following and check if it works.
I am not sure if |
Beta Was this translation helpful? Give feedback.
-
Regrading the Powershell: Regarding the overflow:
produces the error. So it seems like the problem originates from rust itself. |
Beta Was this translation helpful? Give feedback.
-
Closing this case since the issue isn't related to this crate. |
Beta Was this translation helpful? Give feedback.
-
On a sidenote: Rust only stackoverflows in the non-release compiled version, but with Arrayfire it overflows in both cases |
Beta Was this translation helpful? Give feedback.
-
It is most likely to do with something like this rust-lang/rust-clippy#4520 but I am not 100% certain - this is something that came up with quick googling. I doubt it can be related to ArrayFire crate if it is failing even in one configuration without ArrayFire Code. Having said that, I have tried your code on rust play ground seems to work fine for me there as well. |
Beta Was this translation helpful? Give feedback.
-
What is the rust version you are using ? |
Beta Was this translation helpful? Give feedback.
-
I figured out what it is:
So sadly the windows stack size does not allow me to allocate more on the GPU. Except passing a Vec might be a solution. |
Beta Was this translation helpful? Give feedback.
-
That doesn't sound right, do you mean it doesn't allow you to allocate more on the host RAM ? GPU doesn't have any such limitations and rust doesn't control that. |
Beta Was this translation helpful? Give feedback.
-
Well, I would assume it doesn't allow me to allocate more on the part of the RAM that is managed by the stack. But I probably can do more on the heap which would help if I could assign a Vector into Array::new. |
Beta Was this translation helpful? Give feedback.
-
Array::new takes a slice into a vector. so it should work fine. |
Beta Was this translation helpful? Give feedback.
-
Perfect, thanks for all the help 👍 |
Beta Was this translation helpful? Give feedback.
Closing this case since the issue isn't related to this crate.