Repository: coreylowman/dfdx (language: rust)

Issue:
Alloc zero size memory on old model GPU may fail.
https://github.com/coreylowman/dfdx/blob/9a208d928b92dd77d4b2fa79144bdc8b872aa7f0/src/tensor/cuda/device.rs#L94C2-L94C2

```
        let workspace = Arc::new(Mutex::new(dev.alloc_zeros::<u8>(0)?));
```

On my old GTX 960, it would cause panic with the below error.
```
Driver(DriverError(CUDA_ERROR_INVALID_VALUE, "invalid argument"))
```
I have installed the Nvidia 535 driver and Cuda Toolkit 12.2.0, which is mostly recent.

Replace ```0``` with a non-zero value will fix it.

Maybe the old card doesn't support alloc zero size memory.




Discussion / hints:

Fix patch:
diff --git a/dfdx-core/src/tensor/cuda/device.rs b/dfdx-core/src/tensor/cuda/device.rs
index 156bdddd..de6f7196 100644
--- a/dfdx-core/src/tensor/cuda/device.rs
+++ b/dfdx-core/src/tensor/cuda/device.rs
@@ -76,7 +76,7 @@ impl Cuda {
         #[cfg(feature = "cudnn")]
         let cudnn = cudarc::cudnn::Cudnn::new(dev.clone())?;
         let par_stream = Arc::new(dev.fork_default_stream()?);
-        let workspace = Arc::new(Mutex::new(dev.alloc_zeros::<u8>(0)?));
+        let workspace = Arc::new(Mutex::new(dev.alloc_zeros::<u8>(1)?));
         Ok(Self {
             cpu,
             dev,


Test patch: