Next-gen debugger fails to attach to process if no network connection present

When trying to use the Next-Gen debugger, I’m getting the error message that ‘attaching Nsight Visual Studio Debugger to process failed, unexpected error: 0x80004005’. This is the same error reported by user xijiaqi2016 :

However, the problem disappears if I plug in a LAN cable (to a home router, regardless if the router has internet or not).

Is there a way to use the Next-Gen debugger without the computer being connected to a network ?

(note : user xijiaqi2016 seemed to have a similar problem - “can the next-gen debugger be used offline without internet connection?”)

When I first encountered the problem, I tried configuring the Windows firewall with a rule for ports 4500-4510 (as suggested in the link above). I also checked that Nsight.Monitor and nvdebugagent were ‘allowed apps’ for both Public and Private networks. Then I completely disabled the firewall (and all other AV/malware software).

Setup :

Windows 10 Home (Version 1903)
CUDA 10.1
Visual Studio Community 2019
Nsight Visual Studio Edition : 2019.3

NV Driver : 436.30 (DCH)
GPU0 : GTX970 (Displays attached)
GPU1 : RTX2080 (No display – CUDA code runs on this)

Method :

  1. I entirely disable the Windows firewall (Domain/Public/Private), and all AV/malware software

  2. I set a breakpoint in GPU code in a CUDA sample (simpleCudaGraphs)

  3. I ‘Start CUDA Debugging (Next-Gen)’

  4. I get the above error message. GPU debugging fails.

  5. I restart Visual Studio (because Next-Gen option greyed out)

  6. I plug in a LAN cable (home router – internet connected). This network can be ‘Public’ or ‘Private’ in Windows.

  7. I start debugging. No error message. The breakpoint works fine.

  8. I disconnect internet from the home router

  9. I start debugging again. No error message. The breakpoint works fine.

  10. I unplug the LAN cable from the computer.

  11. I start debugging. The error message returns. Debugging fails.

This sounds like a firewall issue (maybe there is more than one on your system?)
When the network cable is unplugged, win10 switches to ‘public’/‘guest’ mode.
Maybe enabling ports 4500-4510 in Public/Guest will help.

So, I’ve done a clean reinstall of Windows 10 Home (1903). I’ve not added any new software other than the latest NV driver, Visual Studio 2015 Community Edition, and CUDA Toolkit 10.1 (latest).

(note : now using an earlier version of Visual Studio)

I’ve told Windows that the ethernet connection is a public network. Therefore plugging and unplugging the network cable no longer switches between public/guest and private firewall modes.

With the cable in, no error message and the breakpoint works fine.

With the cable removed, I get the error message and the breakpoint fails.

(Adding firewall rules for ports 4500-4510 makes no difference)

Solved :

This problem can be worked around by installing Microsoft KM-TEST Loopback Adapter

(acts like a ‘dummy’ network)