Ensure that you have a proper installation of nvprof.exe from Nvidia. All versions of MATLAB prior to and including R2021a use nvprof.exe to perform gpucoder.profile. An easy way to ensure that nvprof.exe is installed properly is to simply open up a Command Prompt window and run you local nvprof.exe installation.
nvprof.exe relies on several DLL's from Nvidia, such as the CUPTI (CUDA Profiling Tools Interface) DLL. Verify that your nvprof.exe has run properly by calling:
nvprof.exe --version
If it has been properly installed, you should see corresponding version information, otherwise, if you see a missing DLL error or if the error returns a Windows error code of -1073741515 (0xc0000135), then nvprof.exe has not been properly installed. Follow instructions for installing nvprof at the Nvidia website.
Once you are able to run nvprof.exe from a command prompt window, you should be able to run gpucoder.profile with no problem!