# Attach via SSH from MacOS host

**URL:** <https://forums.developer.nvidia.com/t/attach-via-ssh-from-macos-host/259142>\
**Category:** Nsight Compute\
**Created:** [July 7, 2023, 11:15pm UTC](https://forums.developer.nvidia.com/t/attach-via-ssh-from-macos-host/259142 "2023-07-07T23:15:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![simonbyrne1](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@simonbyrne1](https://forums.developer.nvidia.com/u/simonbyrne1)\
**Post date:** [July 7, 2023, 11:15pm UTC](https://forums.developer.nvidia.com/t/attach-via-ssh-from-macos-host/259142/1 "2023-07-07T23:15:51Z")

</div>

I’m trying to attach interactively to a remote Linux x86\_64 box from a MacOS host. I’ve entered all the SSH details, but the Process Name box remains empty when I hit refresh. There doesn’t seem to be any way to check that the SSH connection is actually working (unlike Nsight Systems where you connect to the remote before launching). Is there a way to get more information on the SSH connection (e.g. a log file somewhere)?

---

<div class="post-metadata">

**Author:** ![felix\_dt](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/felix_dt/32/14043_2.png) [@felix\_dt](https://forums.developer.nvidia.com/u/felix_dt)\
**Post date:** [July 10, 2023, 8:07am UTC](https://forums.developer.nvidia.com/t/attach-via-ssh-from-macos-host/259142/2 "2023-07-10T08:07:41Z")

</div>

You can check if the SSH connection is working e.g. by using the “Application Executable” remote file selection dialog (“…” button) on the “Launch” tab, with the remote target platform still selected on the left.

Did you launch the process using the `ncu` command line executable on the remote system with `--mode launch`? Otherwise, the process won’t be available for attaching from your local system. Alternatively, you can launch directly on the remote target system using that same tab, instead of attaching to a remote process.

---

<div class="post-metadata">

**Author:** ![simonbyrne1](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@simonbyrne1](https://forums.developer.nvidia.com/u/simonbyrne1)\
**Post date:** [July 10, 2023, 6:37pm UTC](https://forums.developer.nvidia.com/t/attach-via-ssh-from-macos-host/259142/3 "2023-07-10T18:37:39Z")

</div>

Thank you. Yes I did have `ncu --mode=launch <exec>`.

The problem is that I can’t SSH directly to the GPU node (`gpuhost`), instead I have to use a jump host (`jumphost`)

At first I tried setting

```auto
Host gpuhost
   ProxyJump jumphost

```

in my `.ssh/config`, however Nsight Compute doesn’t seem to recognise it (the dialog says “connection failed”).

Then I tried setting up port forwarding:

```auto
ssh -L 2022:gpuhost:22 jumphost

```

Then I can `ssh -p 2022 localhost` to connect to `gpuhost`, but if I enter `localhost` as the target and 2022 as the port in the Nsight Compute remote dialog, the … button will just show me my current computer, which suggests the port handling isn’t working correctly.

---

<div class="post-metadata">

**Author:** ![simonbyrne1](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@simonbyrne1](https://forums.developer.nvidia.com/u/simonbyrne1)\
**Post date:** [July 10, 2023, 6:50pm UTC](https://forums.developer.nvidia.com/t/attach-via-ssh-from-macos-host/259142/4 "2023-07-10T18:50:17Z")

</div>

Okay, I found that if I used `127.0.0.1` instead of `localhost`, I was able to get the port forwarding working for the Remote Launch `...` dialog. But I still don’t see any processes under `attach`.

---

<div class="post-metadata">

**Author:** ![felix\_dt](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/felix_dt/32/14043_2.png) [@felix\_dt](https://forums.developer.nvidia.com/u/felix_dt)\
**Post date:** [July 11, 2023, 8:26am UTC](https://forums.developer.nvidia.com/t/attach-via-ssh-from-macos-host/259142/5 "2023-07-11T08:26:34Z")

</div>

SSH config files are supported starting with Nsight Compute version [2021.3](https://docs.nvidia.com/nsight-compute/ReleaseNotes/index.html#updates-2021-3), see also the documentation on it [here](https://docs.nvidia.com/nsight-compute/NsightCompute/index.html#remote-connections). Nsight Compute uses `localhost` to refer to the local machine, which is why no SSH connection is attempted in that case. Have you checked if launching the remote executable through your local Nsight Compute UI is working, rather than trying to attach to the remote process?
