0

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).

user4157124
  • 2,809
  • 13
  • 27
  • 42
Terry1998
  • 53
  • 1
  • 4
  • Looking at the answer you posted yourself, it seems that some of the GPU-specific DLLs were missing. Safest bet is, as you are saying, to have the full CNTK distribution residing next to the executable that contains EvalWrapper. – Anton Schwaighofer Jun 15 '16 at 08:18
  • I check the DLLs between the binary and compile versions. The cudas DLLs are matched. One thing that I notice is the CsEvalClien program will not work when move to another location. It will need the DLLs copy to the local exe location. You mention about the GPU box on the last answer, can you specify the program that provide the function? I'm looking for a good tool to view GPU usage. Thanks again. – Terry1998 Jun 16 '16 at 13:45
  • I use the Nvidia GPU utilization viewer, found in C:\Program Files\NVIDIA Corporation\Control Panel Client\nvGpuUtilization.exe - but it is a pretty flaky thing, stops updating status, forgets GPUs while running, and such. Expect to re-start the tool frequently. – Anton Schwaighofer Jun 16 '16 at 14:14
  • That work. It's enough to see if GPU is running. Thanks. – Terry1998 Jun 16 '16 at 14:48

2 Answers2

0

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?

Anton Schwaighofer
  • 3,119
  • 11
  • 24
  • Thanks Anton. Knowing that the CsEvalClient work, I was able to get GPU working on the c# wrapper. I spend more time than I care to admit. The steps are: – Terry1998 Jun 14 '16 at 20:16
0

I'm not sure this is the right procedure. Here is what I did. Instead of using the binary vision, install the source code follow the installation instruction and compile the source code. Copy the DLLs from "x64.release" directory to the directory where the "exe" file located (flowing https://github.com/Microsoft/CNTK/issues/394). Note: for multiple projects in solution, make sure the configuration is the same (eg. release mode at x64). With GTX 960, the processing speed to from 770ms to 1 ms for an image.

Terry1998
  • 53
  • 1
  • 4