Stuck in "searching for attachable processses" loop

Hi, I’m trying to get nsight working on manjaro linux. I’ve installed the cuda-tools package, ran ncu-ui, built my binary, and launched it through nsight, and although the application runs, it’s unable to attach. The progress log dialogue just gets stuck in this loop:

Preparing to launch...
Launched process: eng-gfx-consumer (pid: 206607)
Attempting to automatically connect...
Searching for attachable processes on localhost:49152-49215...
Searching for attachable processes on localhost:49152-49215...
Searching for attachable processes on localhost:49152-49215...
Searching for attachable processes on localhost:49152-49215...
Searching for attachable processes on localhost:49152-49215...
Searching for attachable processes on localhost:49152-49215...
Searching for attachable processes on localhost:49152-49215...

Could I get some advice for solving this? Thanks

3 Likes

Can you check that one of these ports is accessible on your system for the current user? Alternatively, you can change the default port range in the UI’s options dialog (Tools > Options > Connection). During the first CUDA API call, the launched target process attempts to open a socket on one of these ports, and the host UI tries to find and connect to them.

It can also help to

  • double-check that your app is in fact running CUDA
  • try with a small CUDA sample application first, to debug if the issue is specific to your app, or general on your system
  • try to collect non-interactively through the Profile activity, or the ncu command line interface (and open the report written with the -o flag in the UI afterwards).

Same here (Nsight Compute 2021.1.0.0) …

  • code runs CUDA
  • This is the line where it blocks (right at the begining of the code)
    HANDLE_ERROR( cudaMallocManaged((void**)&m_block , sizeof(uint64_t)) );
  • Whether I start using “Interactive Profile” or “Profile” … it doesn’t matter. It doesn’t go beyond the cudaMallocManaged() function.

Any help would be appreciated.

I managed to get it work, but only by launching the app in console (Administrator permissions) using ncu --mode launch app.exe and the Nsight Compute / Interactive Profile.

No way to launch it directly using Nsight Compute (localhost / Launch). Might be I do something wrong, but with Ubuntu my workflow works properly.

I’d prefer to launch and profile the app right away using Nsight Compute, i.s.o. starting an console first.

For my understanding … is it (theoretically) possible to launch and attach an app directly through Nsight Compute (2021.1.0.0) on Windows 10, or is it “normal” that I have to start the app first using the console ncu --mode launch command?

On Ubuntu, the launch and attach from Nsight Compute seems to work. On Windows 10 I didn’t manage.

It is certainly expected that you can launch and profile applications directly using both the ncu command line as well as the ncu-ui GUI with the Interactive Profile activity on Windows 10. This is the default option for the CLI flag --mode, named launch-and-attach.

In your first post, you mentioned this was on Manjaro Linux. Later you mentioned your Ubuntu workflow work properly, but your latest question is about a problem on Windows 10. Can you please clarify on which platform you are having the issue right now?

This is the line where it blocks (right at the begining of the code)
HANDLE_ERROR( cudaMallocManaged((void**)&m_block , sizeof(uint64_t)) );
Whether I start using “Interactive Profile” or “Profile” … it doesn’t matter. It doesn’t go beyond the cudaMallocManaged() function.

When you say it blocks there, you mean it doesn’t even fully connect in interactive mode, right? I.e. it doesn’t show you the first CUDA API call in the API stream view tool window, like here ? Instead, it keeps showing the connection log that you mentioned in your first post?

I truly don’t see why it would behave like this, especially since you say that launching from the CLI and attaching from the UI works for you, which is essentially the same underneath. This seems to imply there aren’t any conceptual errors with how you application behaves that Nsight Compute can’t handle, and the relevant ports are accessible. Still, it would be good if you could try a small CUDA sample app as well, to see if that behaves better.

One thing that appears to be different is that you mentioned your ncu --mode launch command was run as administrator, but when trying to launch from the UI, the UI process wasn’t, correct? Can you check the following:

  • try profiling directly from the CLI in a non-admin console, i.e. ncu .
  • try profiling directly from the CLI in an admin console, i.e. ncu .
  • try launching interactively from the UI, when the UI itself is started as admin