NVIDIA GeForce RTX 4060 - ncu not able to access perf counters on 4060 Ti in WSL

Running on a Alienware computer, inside WSL in Ubuntu. I am able to run nsys fine, but ncu fails. I need either ncu, or some nsys command to be able to gather latency, flops, or memory bytes per kernel launch to plot a roofline model.

Here’s the exact script I am trying to run - arcadium/examples/gpt-2/simple_ncu.sh at main · AnshKetchum/arcadium · GitHub

```
ncu --metrics sm__sass_thread_inst_executed_op_fadd.sum,sm__sass_thread_inst_executed_op_fmul.sum,dram__bytes.sum
–target-processes all
-o “$NCU_REPORT”
python pretrain_language.py
“${MODEL_ARGS[@]}”
“${DATA_ARGS[@]}”
```

But this command seems to fail to connect to perf counters in my hardware. At runtime, I see these messages -

==PROF== Connected to process 1955931 (/home/ac/.local/share/uv/python/cpython-3.10.15-linux-x86_64-gnu/bin/python3.10)
Initialized HuggingFaceTokenizer with vocab size 50257
Loaded HuggingFaceTokenizer from tokenizers/gpt-2/gpt-2
Configuring … gpt-basic-1m-64-emb-1L
Loaded tokenizer with size 50257
==ERROR== ERR_NVGPUCTRPERM - The user does not have permission to access NVIDIA GPU Performance Counters on the target device 0. For instructions on enabling permissions and to get more information see NVIDIA Development Tools Solutions - ERR_NVGPUCTRPERM: Permission issue with Performance Counters | NVIDIA Developer

Why doesn’t WSL have access to ncu? It works with nsys? How do I fix?

Some more context. Output of nvidia-smi

±----------------------------------------------------------------------------------------+
| NVIDIA-SMI 575.65 Driver Version: 576.83 CUDA Version: 12.9 |
|-----------------------------------------±-----------------------±---------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA GeForce RTX 4060 … On | 00000000:01:00.0 On | N/A |
| N/A 49C P4 11W / 90W | 2348MiB / 8188MiB | 10% Default |
| | | N/A |
±----------------------------------------±-----------------------±---------------------+

±----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| No running processes found |
±----------------------------------------------------------------------------------------+

ncu requires permissions from the display driver for access to hardware performance metrics. nsys does not for tracing api calls and workloads. You should check the link in the error message, and in the docs here, for requirements and how to set this up.

I did check the link shared, and the action I specifically took was to enable developer settings. See above. As a side note, I don’t see instructions for WSL in the first link.

WSL Version appears to be compatible -

```

wsl --list --verbose

NAME STATE VERSION

Ubuntu Running 2
``

```

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 24.04.1 LTS
Release: 24.04
Codename: noble

Running the command below seems to have no effect (no change in libs)

apt install libopengl0 libxcb-icccm4 libxcb-keysyms1 libxcb-cursor0 libxcb-shape0 libxkbcommon-x11-0 libnss3

After enabling the developer settings, did you also enable access to the GPU performance counters in these settings? In the left pane, use the “Manage GPU Performance Counters” option and enable “Allow access to the GPU performance counter to all users”.

If this doesn’t resolve it, please let us know which exact Windows version (e.g. by running systeminfo in the Windows cmd.exe and providing OS Version).

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.