SciSharp / SiaNet

An easy to use C# deep learning library with CUDA/OpenCL support
https://scisharp.github.io/SiaNet
MIT License
380 stars 83 forks source link

GPU Access? #32

Closed fdncred closed 5 years ago

fdncred commented 6 years ago

What's the key to enabling GPU access? I've cloned your repository and run the examples and CPU works, GPU does not. I have a NVidia GPU with Cuda 8 drivers and other toolkits like ConvNetSharp use it.

Any tips?

Thanks, Darren

deepakkumar1984 commented 6 years ago

Hello Darren,

There is a " SieNet.Examples https://github.com/deepakkumar1984/SiaNet/tree/master/SieNet.Examples" project which is for GPU. In the main method please check if the following line of code throws an exception:

var devices = DeviceDescriptor.AllDevices().Where(x=>(x.Type == DeviceKind.GPU)).ToList();if (devices.Count == 0) throw new Exception("No GPU Device found. Please run the CPU examples instead!");

On Wed, Mar 14, 2018 at 1:47 AM, Darren Schroeder notifications@github.com wrote:

What's the key to enabling GPU access? I've cloned your repository and run the examples and CPU works, GPU does not. I have a NVidia GPU with Cuda 8 drivers and other toolkits like ConvNetSharp use it.

Any tips?

Thanks, Darren

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/deepakkumar1984/SiaNet/issues/32, or mute the thread https://github.com/notifications/unsubscribe-auth/AGCQKYXf6T1Q-r925Du7MWSU7uFASB6Dks5td-MTgaJpZM4So4G9 .

-- Regards, Deepak

fdncred commented 6 years ago

@deepakkumar1984, Of course. Running this example is how I know that your software isn't working. I have CNTK GPU working on several projects but yours won't work. How can I debug it?

Of course, It may not be your software at all. Something could be going wrong in CNTK.

fdncred commented 6 years ago

@deepakkumar1984, I thought I had it figured out. I thought the problem was that your code only supports CUDA 9.0. I have CUDA 8.0 and CUDA 9.1. But when I rolled back to CNTK 2.3.1 GPU which works on CUDA 8.0, it still doesn't detect the GPU. I'm not sure what's going on now.

Is there really no way to troubleshoot GPU detection?

deepakkumar1984 commented 5 years ago

Now its not using CNTK. To build the project with the specific Cuda installed in your machine, please change the "Conditional Compilation Property" in the ManagedCuda project properties -> Build.

Following are the combination:

{WIN/LINUX},{CUDA80/CUDA90/CUDA91/CUDA92/CUDA100},{CUDNN5/CUDNN7/NA}

Ex: WIN,CUDA100,CUDNN7 - For Cuda 10 with CuDNN7 on Windows

Ex: LINUX,CUDA90,CUDNN5 - For Cuda 9 with CuDNN5 on Linux

Ex: WIN,CUDA92,NA - For Cuda 10 with No CuDNN installed on Windows