Why I am not getting anything in REPL while trying to use Nsight Systems for profiling?

Hi,

I am trying to profile cuda program using Nsight systems. I tried the following command in command window to launch the julia REPL.
nsys launch "C:\Users\manoos\AppData\Local\Programs\Julia 1.5.0\bin\julia.exe"
REPL is launched. But it is just a black screen.

Also I tried to launch REPL from Nsight Systems like below screenshot.

Still, I am getting blank REPL as below:

How can I solve this issue?

Thanks and Reagrds,
Manu

I experience the same Problem

Strange, I don’t see this issue locally. Are you using the latest NSight? You can also nsys profile instead of launch, but that won’t be interactive of course.

Hi @maleadt : I am using NVIDIA Nsight Systems version 2020.4.1.144-20fdc64. I tried like nsys profile same issue.

However, I manged to profile by opening Nsight System and setting up the command line arguments as %path_to_julia.exe% %path_to_code_to_profile.jl".

Thank You

1 Like

Having the same issue, trying to open an interactive session from the console, but I get a blank REPL as well. No idea for a workaround,

Profiling works though, but the command line of the running program is blank as well

Nsight 2020.4.3,
CUDA 11.2.2

1 Like

Maybe file an issue with NVIDIA?

I’m hitting the same issue as the OP: trying to run the Windows Julia 1.7.2 REPL under the latest version of nsys for the windows-64 target just hangs for me. I’m able to launch the Julia REPL without nsys and run scripts using CUDA.jl just fine, and can also (separately) use Nvidia Systems to profile non-Julia CUDA programs. I’m not doing anything on WSL, this is all vanilla Windows 11.

From what I can tell, it looks like that on Windows, the Julia REPL will start, but the prompt never makes it back. For example, running:

  • nsys launch “C:\Users<username>\AppData\Local\Programs\Julia-1.7.2\bin\julia.exe” —help

from an Administrator PowerShell Core session will pause for a moment, then return without an error code. This makes me think it’s trying to show the help screen and then exiting normally.

@maleadt - I know you’ve looked at his quite a bit (and thank you for your JuliaCon talks on this, btw)— could you please describe in more detail how you actually launch the Julia REPL under nsys on Windows? I’m happy to provide any more detail on my setup to help troubleshoot.

I was using the same nsys launch as you were. It’s been a while though, but if this still reproduces with the latest versions of NSight and Julia, I recommend filing an issue with NVIDIA. Especially the dead-simple --help invocation not showing output should be simple enough for NVIDIA to find the issue.

@maleadt - thank you for your reply. Are you able to confirm if it works (or doesn’t) on Windows for you? If it doesn’t work for you, then I’ll know it’s not my set up, and can reach out to Nvidia.

If it does work, could you please provide details of how you’re doing it? (are you launching from PowerShell, or the nsys-ui, are you running as a regular user or admin, etc). Even/especially a screenshot or gif would be appreciated. For example- “nsys launch julia” does not find the Julia executable, even though it’s on the PATH. Do you specify the full path to the executable, or do something else? Do you launch it within WSL? Etc.

Any detail on how you do this on Windows would help a ton.

I can just launch using nsys.exe

C:\Users\Tim\Desktop>SET JULIA_CUDA_NSYS=c:\Program Files\NVIDIA Corporation\Nsight Systems 2022.2.1\target-windows-x64\nsys.exe

# this is only required because nsight isn't on path on this system

C:\Users\Tim\Desktop>"c:\Program Files\NVIDIA Corporation\Nsight Systems 2022.2.1\target-windows-x64\nsys.exe" launch c:\Users\Tim\.cache\jl\installs\bin\winnt\x64\1.7\julia-1.7-latest-win64\bin\julia.exe
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.7.2 (2022-02-06)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(@v1.7) pkg> st
      Status `C:\Users\Tim\.julia\environments\v1.7\Project.toml`
  [052768ef] CUDA v3.8.5
  [295af30f] Revise v3.3.3

julia> CuArray([1]).+1;

julia> CUDA.@profile CuArray([1]).+1;
[ Info: Running under Nsight Systems, CUDA.@profile will automatically start the profiler

WARNING: CUDA tracing is required for cudaProfilerStart/Stop API support. Turning it on by default.
WARNING: CPU context switches trace requires administrative privileges, disabling.
WARNING: CPU sampling requires administrative privileges, disabling.

Ôöî Info: Profiling has finished, open the report listed above with `nsys-ui`
Ôöö If no report was generated, try launching `nsys` with `--trace=cuda`

I’d file a report either way; there’s multiple users running into this, and it just shouldn’t fail like that.

Thanks for providing that run example, @maleadt. I filed a report with Nvidia (Nsys launch julia hangs on on Windows 11 - Profiling x86 Windows Targets - NVIDIA Developer Forums), and they did confirm it was a bug and provided a workaround. Here’s what I did:

  • Edit C:\Program Files\NVIDIA Corporation\Nsight Systems 2022.2.1\target-windows-x64\config.ini and add EnableStdOutErrCapture=false
  • Set the JULIA_CUDA_NSYS variable as you did above. In my case, I just edited ~/.julia/config/startup.jl and added:
    • ENV["JULIA_CUDA_NSYS"] = "C:\\Program Files\\NVIDIA Corporation\\Nsight Systems 2022.2.1\\target-windows-x64\\nsys.exe"
  • Then it works with:
    • nsys launch C:\Users\<username>\AppData\Local\Programs\Julia-1.7.2\bin\julia.exe

It now profiles the CUDA code perfectly, even when run as a regular user (Administrator is only needed for collecting CPU info). Thanks again for your help and advice here!

1 Like

Great that this will be fixed in the next release. Thanks for filing a bug!

Since your nsys is on PATH (guessing from what you mentioned below) this shouldn’t be necessary. If that’s the case, could you file an issue?

Happy to help! Being able to use CUDA in Julia is really awesome, particularly with the Nsight tooling.

I’ve filed an issue on the PATH issue; apologies if that wasn’t the right place to do that: PATH variable ignored when finding nsys executable (Windows 11)