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

**URL:** <https://discourse.julialang.org/t/why-i-am-not-getting-anything-in-repl-while-trying-to-use-nsight-systems-for-profiling/50667>\
**Category:** General Usage\
**Tags:** question, gpu, cuda\
**Created:** [November 24, 2020, 4:46am UTC](https://discourse.julialang.org/t/why-i-am-not-getting-anything-in-repl-while-trying-to-use-nsight-systems-for-profiling/50667 "2020-11-24T04:46:53Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manu\_Francis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/manu_francis/32/10010_2.png) [@Manu\_Francis](https://discourse.julialang.org/u/Manu_Francis)\
**Post date:** [November 24, 2020, 4:46am UTC](https://discourse.julialang.org/t/why-i-am-not-getting-anything-in-repl-while-trying-to-use-nsight-systems-for-profiling/50667/1 "2020-11-24T04:46:53Z")

</div>

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.

 ![Capture](https://global.discourse-cdn.com/julialang/original/3X/7/9/79640e31db6fbba4e3d0c9732a55b163266e1cb0.png)

Still, I am getting blank REPL as below:

 ![Capture1](https://global.discourse-cdn.com/julialang/original/3X/2/d/2d62872e5ee0fb0b55724df3324a84781ab83968.png)

How can I solve this issue?

Thanks and Reagrds,  
Manu

---

<div class="post-metadata">

**Author:** ![JGranada](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jgranada/32/16076_2.png) [@JGranada](https://discourse.julialang.org/u/JGranada)\
**Post date:** [January 17, 2021, 6:54pm UTC](https://discourse.julialang.org/t/why-i-am-not-getting-anything-in-repl-while-trying-to-use-nsight-systems-for-profiling/50667/2 "2021-01-17T18:54:41Z")

</div>

I experience the same Problem

---

<div class="post-metadata">

**Author:** ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)\
**Post date:** [January 18, 2021, 8:38am UTC](https://discourse.julialang.org/t/why-i-am-not-getting-anything-in-repl-while-trying-to-use-nsight-systems-for-profiling/50667/3 "2021-01-18T08:38:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Manu\_Francis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/manu_francis/32/10010_2.png) [@Manu\_Francis](https://discourse.julialang.org/u/Manu_Francis)\
**Post date:** [January 20, 2021, 1:22pm UTC](https://discourse.julialang.org/t/why-i-am-not-getting-anything-in-repl-while-trying-to-use-nsight-systems-for-profiling/50667/4 "2021-01-20T13:22:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![krynju](https://avatars.discourse-cdn.com/v4/letter/k/ecccb3/32.png) [@krynju](https://discourse.julialang.org/u/krynju)\
**Post date:** [April 17, 2021, 5:48pm UTC](https://discourse.julialang.org/t/why-i-am-not-getting-anything-in-repl-while-trying-to-use-nsight-systems-for-profiling/50667/5 "2021-04-17T17:48:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)\
**Post date:** [April 19, 2021, 12:44pm UTC](https://discourse.julialang.org/t/why-i-am-not-getting-anything-in-repl-while-trying-to-use-nsight-systems-for-profiling/50667/6 "2021-04-19T12:44:38Z")

</div>

Maybe file an issue with NVIDIA?

---

<div class="post-metadata">

**Author:** ![adam246](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@adam246](https://discourse.julialang.org/u/adam246)\
**Post date:** [March 28, 2022, 2:23am UTC](https://discourse.julialang.org/t/why-i-am-not-getting-anything-in-repl-while-trying-to-use-nsight-systems-for-profiling/50667/7 "2022-03-28T02:23:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)\
**Post date:** [March 28, 2022, 9:45am UTC](https://discourse.julialang.org/t/why-i-am-not-getting-anything-in-repl-while-trying-to-use-nsight-systems-for-profiling/50667/8 "2022-03-28T09:45:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![adam246](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@adam246](https://discourse.julialang.org/u/adam246)\
**Post date:** [March 28, 2022, 2:07pm UTC](https://discourse.julialang.org/t/why-i-am-not-getting-anything-in-repl-while-trying-to-use-nsight-systems-for-profiling/50667/9 "2022-03-28T14:07:26Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)\
**Post date:** [March 29, 2022, 9:30am UTC](https://discourse.julialang.org/t/why-i-am-not-getting-anything-in-repl-while-trying-to-use-nsight-systems-for-profiling/50667/10 "2022-03-29T09:30:50Z")

</div>

I can just launch using `nsys.exe`

```julia
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`

```

> [@adam246](#):
>
> If it doesn’t work for you, then I’ll know it’s not my set up, and can reach out to Nvidia.

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

---

<div class="post-metadata">

**Author:** ![adam246](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@adam246](https://discourse.julialang.org/u/adam246)\
**Post date:** [March 29, 2022, 3:13pm UTC](https://discourse.julialang.org/t/why-i-am-not-getting-anything-in-repl-while-trying-to-use-nsight-systems-for-profiling/50667/11 "2022-03-29T15:13:15Z")

</div>

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](https://forums.developer.nvidia.com/t/nsys-launch-julia-hangs-on-on-windows-11/209593)), 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!

---

<div class="post-metadata">

**Author:** ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)\
**Post date:** [March 29, 2022, 8:44pm UTC](https://discourse.julialang.org/t/why-i-am-not-getting-anything-in-repl-while-trying-to-use-nsight-systems-for-profiling/50667/12 "2022-03-29T20:44:08Z")

</div>

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

> [@adam246](#):
>
> 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"`

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?

---

<div class="post-metadata">

**Author:** ![adam246](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@adam246](https://discourse.julialang.org/u/adam246)\
**Post date:** [March 30, 2022, 2:17am UTC](https://discourse.julialang.org/t/why-i-am-not-getting-anything-in-repl-while-trying-to-use-nsight-systems-for-profiling/50667/13 "2022-03-30T02:17:11Z")

</div>

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)](https://discourse.julialang.org/t/path-variable-ignored-when-finding-nsys-executable-windows-11/78714)
