Skip to content

Debugging CNTK source code in Visual Studio

Chris Basoglu edited this page Sep 21, 2016 · 1 revision

To debug CNTKs mainline CPU source code, follow the steps below. To additionally debug the CUDA code for GPUs in CNTK, follow the steps below first, and then click [here](Debugging CNTK's GPU source code in Visual Studio) for further steps.

In Launch Visual Studio, and load the cntk.sln solution. In the Solution Explorer, find the CNTK project and make sure it is the startup project (it should be bolded). If it is not, right click on the project in the Solution Explorer and choose Set as StartUp Project.

In the Solution Explorer, find the CNTK project and right click on Properties. From the Properties dialog, click on Configuration Properties and then on Debugging.

Assuming you have your CNTK source at C:/src and you want to debug with config file Simple2d:

set the Command Arguments field to:

configFile=C:/src/cntk/Examples/Other/Simple2d/Config/Simple.cntk deviceId=auto makeMode=false RootDir=C:/src/cntk/Examples/Other/Simple2d

set the Working Directory field to:

C:/src/cntk/Examples/Other/Simple2d

If you have your CNTK source somewhere else or you want to debug a different config file, make the appropriate changes

Set your build target as "Debug"

Build and run.

Clone this wiki locally