GPU memory not recognized for the code - nsight compute

Hi everyone,
I have an nvidia GeForce MX450 with cuda kit 12.8 and graphics driver 572.16 on WSL

I was trying to follow along with a course and run the following code
https://github.com/Infatoshi/cuda-course/blob/master/05_Writing_your_First_Kernels/03%20Profiling/00%20nvtx_matmul.cu

nvcc -o 00 00\ nvtx_matmul.cu -lnvToolsExt
nsys profile --stats=true ./00

after i run the second block, i get the following output

INITIAL METRICS INCLUDING SOME STATS
[6/8] Executing ‘cuda_gpu_kern_sum’ stats report
SKIPPED: /home/aryan2004/learning_cuda/cuda-course/05_Writing_your_First_Kernels/03 Profiling/report1.sqlite does not contain CUDA kernel data.
[7/8] Executing ‘cuda_gpu_mem_time_sum’ stats report
SKIPPED: /home/aryan2004/learning_cuda/cuda-course/05_Writing_your_First_Kernels/03 Profiling/report1.sqlite does not contain GPU memory data.
[8/8] Executing ‘cuda_gpu_mem_size_sum’ stats report
SKIPPED: /home/aryan2004/learning_cuda/cuda-course/05_Writing_your_First_Kernels/03 Profiling/report1.sqlite does not contain GPU memory data.
Generated:
/home/aryan2004/learning_cuda/cuda-course/05_Writing_your_First_Kernels/03 Profiling/report1.nsys-rep
/home/aryan2004/learning_cuda/cuda-course/05_Writing_your_First_Kernels/03 Profiling/report1.sqlite
:~/learning_cuda/cuda-course/05_Writing_your_First_Kernels/03 Profiling$

i seem to have the minimum required variant for the gpu (geforce mx450 is apparently tu117 variant) and i have configured the gpu performance counters in nvidia control panel developer settings

but i still seem to be getting this error

some guidance on this would be appreciated

Hi, @aryan.kaul1204

You are using nsight system not nsight compute. So moving to “nsight system” forum.

Hi,
Oh I see. The course I was following used ncu-ui to profile the report which is why I had put it under there.

It never showed the CUDA HW section

Anyways, would you know how long a typical response on the forum takes?

I believe what is going on here is that you have hit a known issue with the way Nsight Systems does time synchronization. A workaround is given in the documentation known issues as we work on a fix:

Because the time synchronization is having issues, the CUDA events are not coming in in an order that makes any sense, so they are being dropped. The CUPTI based synchronization is not quite as accurate, but should be good enough for most purposes.

Hi sorry for the late response
It still does not seem to be working.

Here’s what I found out

my nsys version is

NVIDIA Nsight Systems version 2024.6.2.225-246235244400v0

whereas the helper guide seems to be showcasing the information for 2025.1 Thus I am not sure whether the fix would apply or not

In any case, when I tried running the first command
it seems to be unable to recognize the -z flag

aryan2004~/learning_cuda/cuda-course/05_Writing_your_First_Kernels/03 Profiling$ mkdir -p "$(dirname "$(nsys -Z)")"
Unknown command: -Z
mkdir: cannot create directory ‘ usage: nsys [--version] [--help] <command> [<args>] [application] [<application args>]\n\n The most commonly used nsys commands are:\n\tprofile       Run an application and capture its profile into a nsys-rep file.\n\tlaunch        Launch an application ready to be profiled.\n\tstart         Start a profiling session.\n\tstop          Stop a profiling session and capture its profile into a nsys-rep file.\n\tcancel        Cancel a profiling session and discard any collected data.\n\tservice       Launch the Nsight Systems data service.\n\tstats         Generate statistics from an existing nsys-rep or SQLite file.\n\tstatus        Provide current status of CLI or the collection environment.\n\tshutdown      Disconnect launched processes from the profiler and shutdown the profiler.\n\tsessions list List active sessions.\n\texport        Export nsys-rep file into another format.\n\tanalyze       Identify optimization opportunities in a nsys-rep or SQLITE file.\n\trecipe        Run a recipe for multi-node analysis.\n\tnvprof        Translate nvprof switches to nsys switches and execute collection.\n\n Use 'nsys --help <command>' for more information about a specific command.\n\n To run a basic profiling session:   nsys profile .’: File name too long
aryan2004~/learning_cuda/cuda-course/05_Writing_your_First_Kernels/03 Profiling$

Thus, I tried the following workarounds

mkdir -p ~/.nsight-systems

echo 'CuptiUseRawGpuTimestamps=false' >> ~/.nsight-systems/config
cat ~/.nsight-systems/config

I even tried exporting

export NSYS_CUPTI_SYNC=1

but that had no luck.

Unfortunately i cannot run it with sudo since all my cuda toolkit is on user mode and thus sudo does not recognize nsys

When I run it in powershell however, while gpu data is recognized

it seems to have a failure to link lnvtoolsext (so kernel profiling doesnt work)

even though it says that cuda toolkit should include nvtx

Thus, any advice for either

fixing it on wsl
rectifying the issue on powershell

PS C:\Users\aryan\Downloads\cuda_project> nvcc -o 00  "00_nvtx_matmul.cu" -lnvToolsExt
nvcc warning : Support for offline compilation for architectures prior to '<compute/sm/lto>_75' will be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
00_nvtx_matmul.cu
tmpxft_00001450_00000000-10_00_nvtx_matmul.cudafe1.cpp
LINK : fatal error LNK1181: cannot open input file 'nvToolsExt.lib'
PS C:\Users\aryan\Downloads\cuda_project>

Would be very helpful

EDIT for POWERSHELL: forgot to add this information, but when i tried looking through the cuda installer nvtx is nowhere to be found and the github for nvtx does not have a lib section at all because nvtx is apparently all headers now, so if powershell is the way to go (and wsl wont work), then some help for fixing this would also be very helpful!

@liuyis, can you help with this and let me know and changes I need to make in the documentation.

Hi @aryan.kaul1204, note that the -z flag is lower case, as shown in the doc Holly shared above. You were trying an upper case -Z which was why it’s not recognized by Nsys.

Does it work if you change to mkdir -p "$(dirname "$(nsys -z)")"?