Search code examples
c#gpucntk

How to run CNTK c# EvalDLL Wrapper program on GPU?


I was successful on training and evaluate networks based on the CIFAR-10 samples. I'm using my own images with specific size . The networks were trained with GPU and able to evaluate with CPU. However, I'm not able to evaluate it with with GPU. The evaluation is using C# EvalDLL Wrapper. The deviceID is change from -1 to 0 to indicate the GPU # as shown below:

model0.CreateNetwork(string.Format("modelPath=\"{0}\"", modelFilePath), deviceId: 0);

Did I missed something? Can anyone run GPU on C# EvalDLL Wrapper program ?

I'm using binary version of the CNTK (not CPU_Only).


Solution

  • I'm able to run the EvalWrapper on a GPU, using exactly the code you posted below. I just tested via CsEvalClient:

    • When running my CNN through EvalWrapper on a GPU box, the logs say that it used the cuDNN convolution engine, which is GPU-only. I take that as a sign that it really ran on the GPU.
    • When running the code on a CPU-only box, it screams that it can't find a CUDA driver, as I would expect.
    • When switching back to deviceId:-1 and run on the CPU-only box, the logs say that is uses the GEMM convolution engine, and that engine is CPU-only.

    What do you see in the logs when CNTK loads the model?