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.
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.
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:
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.
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.
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!