Nvprof for CUDA 11.2 (on WSL2)

I’ve installed and been successfully using CUDA on WSL2 for single-GPU CUDA fluid simulation development for a couple of months now, and it’s been largely a seamless experience! I’ve been optimizing my code without profiling quite successfully for a while, but I’d love to be able to use nvprof. Unfortunately:

$ nvprof python latticeboltzmann.py
==4522== NVPROF is profiling process 4522, command: python latticeboltzmann.py
======== Profiling result:
No kernels were profiled.
No API activities were profiled.
======== Error: incompatible CUDA driver version.

This is absolutely correct behavior of course, because the CUDA version for WSL2 is in fact different from the CUDA toolkit installed inside WSL2.

$ which nvprof
$ nvprof --version
nvprof: NVIDIA (R) Cuda command line profiler
Copyright (c) 2012 - 2020 NVIDIA Corporation
Release version 11.1.69 (21)

while the version from nvidia-smi is

NVIDIA-SMI 460.20       Driver Version: 460.20       CUDA Version: 11.2

so the version of CUDA built for WSL2 is actually too new.

Would it be possible to make available a version of nvprof (or more generally, the CUDA toolkit) compatible with CUDA 11.2? I’d be happy to give feedback on any early beta testing if so.

(For what it’s worth, apt-get install -y cuda-toolkit-11-2 does not work :P )


1 Like


Profiling is not yet supported on CUDA WSL2. This is the latest update as of June 2020. See link -

They should have updated the docs but I couldn’t find the updated documentation update either.

Edit: Actually found the documentation. See point 3 here - CUDA on WSL :: CUDA Toolkit Documentation