Search code examples
windowsenvironment-variablescygwinsshd

Environment differences between Cygwin sshd vs the local console


I installed Cygwin, the release of Python for Windows from python.org, and the tensorflow package. I enabled the Cygwin OpenSSH server so I can connect remotely.

When I connect remotely, start Python, and import tensorflow, it cannot find a particular Cuda runtime library.

However, if I locally launch the Cygwin Terminal and do the same, import tensorflow succeeds.

What causes the latter case to work differently? Is there some library search path environment variable that is not inherited by remote connections?


Solution

  • I was able to use declare > local_env.sh on the local prompt and source local_env.sh on the remote prompt, and now the DLL is found.

    I realized that over SSH, the PATH environment did not seem to include my CUDA directory.

    It turned out that this was because I had installed CUDA after the cygsshd service had started. I had to restart the service to populate it with the new environment. After I did that, it worked fine.