# Debuging problems

**URL:** <https://forums.developer.nvidia.com/t/debuging-problems/5268>\
**Category:** CUDA Programming and Performance\
**Created:** [September 1, 2008, 11:50am UTC](https://forums.developer.nvidia.com/t/debuging-problems/5268 "2008-09-01T11:50:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ETFbl](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@ETFbl](https://forums.developer.nvidia.com/u/ETFbl)\
**Post date:** [September 1, 2008, 11:50am UTC](https://forums.developer.nvidia.com/t/debuging-problems/5268/1 "2008-09-01T11:50:32Z")

</div>

I hope the following text will not sound silly or to stupid for all of you who have much more experience than I in programming. I am new to CUDA and have written some code which, now successfully compiles, but I have some issues with debugging. I use visual studio 2005 and i started my project by using the template provided by nVidia. Well, now when I set the brake points right before the kernel function call and press step into when the executions reaches my break point, I get a message saying that “there is no source code available for the current location” and I can chose between pressing “ok” or “show disassembly”. If I just press ok and want to continue debugging the same message appears again. It’s the same both in EmuDebug and Debug.  
I thought it only because I have written a bad code, and I tried to debug some of the examples provided by nVidia, but the same thing happens.  
I would appreciate any kind of help.

thanx in advance.

---

<div class="post-metadata">

**Author:** ![MisterAnderson42](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@MisterAnderson42](https://forums.developer.nvidia.com/u/MisterAnderson42)\
**Post date:** [September 1, 2008, 12:16pm UTC](https://forums.developer.nvidia.com/t/debuging-problems/5268/2 "2008-09-01T12:16:02Z")

</div>

To debug kernels in emulation mode, you must set a breakpoint inside the kernel.

To debug kernels on hardware, wait until NVIDIA releases their debugger which has been promised for a while.

---

<div class="post-metadata">

**Author:** ![ETFbl](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@ETFbl](https://forums.developer.nvidia.com/u/ETFbl)\
**Post date:** [September 1, 2008, 2:24pm UTC](https://forums.developer.nvidia.com/t/debuging-problems/5268/3 "2008-09-01T14:24:34Z")

</div>

> [@](#):
>
> To debug kernels in emulation mode, you must set a breakpoint inside the kernel.
> 
> To debug kernels on hardware, wait until NVIDIA releases their debugger which has been promised for a while.
> 
> [snapback]433943[/snapback]

I did that and the problem persists. I can’t see the results of simple operations like a=5. My deadline is approaching soon and I can’t see what’s going on in my project and why it’s not doing what it’s supposed to.

If anyone had the same problem, please help me.

---

<div class="post-metadata">

**Author:** ![alex\_dubinsky](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@alex\_dubinsky](https://forums.developer.nvidia.com/u/alex_dubinsky)\
**Post date:** [September 1, 2008, 10:57pm UTC](https://forums.developer.nvidia.com/t/debuging-problems/5268/4 "2008-09-01T22:57:00Z")

</div>

> [@](#):
>
> I did that and the problem persists. I can’t see the results of simple operations like a=5. My deadline is approaching soon and I can’t see what’s going on in my project and why it’s not doing what it’s supposed to.
> 
> If anyone had the same problem, please help me.
> 
> [snapback]433982[/snapback]

Try using another SDK sample. (Always the first thing to try… find something that works.)

Make sure:

Project \> Properties \> C/C++ \> General \> Debug Information Format

should be “Program Database”

This should all be done in EmuDebug.

If nothing works, consult a VS forum.

---

<div class="post-metadata">

**Author:** ![ETFbl](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@ETFbl](https://forums.developer.nvidia.com/u/ETFbl)\
**Post date:** [September 4, 2008, 2:13pm UTC](https://forums.developer.nvidia.com/t/debuging-problems/5268/5 "2008-09-04T14:13:52Z")

</div>

> [@](#):
>
> Try using another SDK sample. (Always the first thing to try… find something that works.)
> 
> Make sure:
> 
> Project \> Properties \> C/C++ \> General \> Debug Information Format
> 
> should be “Program Database”
> 
> This should all be done in EmuDebug.
> 
> If nothing works, consult a VS forum.
> 
> [snapback]434178[/snapback]

thanx

---

<div class="post-metadata">

**Author:** ![ETFbl](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@ETFbl](https://forums.developer.nvidia.com/u/ETFbl)\
**Post date:** [September 4, 2008, 2:21pm UTC](https://forums.developer.nvidia.com/t/debuging-problems/5268/6 "2008-09-04T14:21:32Z")

</div>

When I call the kernel with a pointer to a matrix allocated by cudaMalloc and initialize the matrix with 0’s. Everything is ok, but when I calculate some int value and say that matrix[i]=intValue; and after the for loop finishs I check if matrix element i got the desired intValue I jsut get a 0. It seems that the matrix just stays like I initializes it. Can anybody tell me why?

---

<div class="post-metadata">

**Author:** ![\_Big\_Mac](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@\_Big\_Mac](https://forums.developer.nvidia.com/u/_Big_Mac)\
**Post date:** [September 4, 2008, 3:40pm UTC](https://forums.developer.nvidia.com/t/debuging-problems/5268/7 "2008-09-04T15:40:09Z")

</div>

Can you paste a code snippet? I have a feeling you’ve got confused about what resides on the host and what’s on the device but I’m guessing.
