-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Zero length allocation failure #194
Comments
My system:
|
I think this function is behaving as it should - it's returning a result (and the unwrap turns it into a panic). I think this should probably be raised as an issue on candle's repo. Do you know where in candle it's coming from? |
It can occur in many places in candle_core::cuda_backend where
The problem is that this behavior is inconsistent - it seems that on most devices zero allocation succeeds (and candle relies on this) but on GTX 970 it fails. |
I'm not really sure what we can do in this case - this seems like a driver level issue. We don't have any device specific code in cudarc, so I guess I'm not sure what the outcome should be. I'm hesitant to use a null pointer (i.e. not actually call cuMalloc) because I don't really know what the downstream effect of that would be or how the cuda driver interacts with all of those. Can you print out the CudaDevice in your example? I want to see if the is_async is false let dev = cudarc::driver::CudaDevice::new(0).unwrap();
println!("{:?}", dev); |
CudaDevice {
cu_device: 0,
cu_primary_ctx: 0x000055759b945ec0,
stream: 0x0000000000000000,
event: 0x000055759bc8d4f0,
modules: RwLock {
data: {},
poisoned: false,
..
},
ordinal: 0,
is_async: false,
} |
Hi!
I'm facing an issue with zero length memory allocation (while trying to run
candle
on GTX 970). Here is the minimal reproducer:On my machine it fails with
DriverError(CUDA_ERROR_INVALID_VALUE, "invalid argument")
. With this workaround it works fine.I didn't find documentation for
cuMemAlloc_v2
but forcuMemAlloc
it says:Maybe
cuMemAlloc_v2
shouldn't be called at all ifnum_bytes
is zero?The text was updated successfully, but these errors were encountered: