Creating NCU Profiles
When NVIDIA Nsight Compute is installed on your system, you can run profiling directly from Wafer and view the results immediately.Requirements
Before you can create profiles, ensure:- NVIDIA Nsight Compute is installed
- The
ncucommand is available in your terminal - You have a compiled CUDA executable to profile
Installing NCU
- With CUDA Toolkit
- Standalone Installation
NCU is typically included with the CUDA Toolkit. After installing CUDA:
Running a Profile
When NCU is detected, the NCU Profiler shows additional configuration options:1
Configure the executable
Set the Run Command to your compiled CUDA executable:Or with arguments:
2
Set output options
Configure where the profile report will be saved:
- Output File: Name for the report (without extension)
- Output Directory: Where to save (default:
.wafer/ncu-tool)
3
Run the profile
Click Profile to execute NCU with your configuration. The tool will:
- Run NCU with your executable
- Generate an
.ncu-repfile - Automatically load the results for analysis
Configuration Options
| Option | Description | Default |
|---|---|---|
| Run Command | The executable to profile | ./a.out |
| Program Args | Arguments to pass to your program | (empty) |
| Output File | Name for the report file | profile |
| Output Dir | Directory for reports | .wafer/ncu-tool |
| Extra Args | Additional NCU flags | (empty) |
Extra NCU Arguments
You can pass additional flags to NCU via the Extra Args field. Common options:See the NCU documentation for all available options.
Generated Command
Wafer shows you the exactncu command that will be executed. You can:
- Copy the command to run it manually in a terminal
- Modify extra args to customize the profiling
Viewing Results
After profiling completes:- The report automatically loads in the analysis view
- Browse kernel metrics and diagnostics as described in Analyzing Reports
- The
.ncu-repfile is saved to your configured output directory
Troubleshooting
NCU not detected
NCU not detected
If NCU is installed but not detected:
- Ensure
ncuis in your PATH - Restart VS Code after installing NCU
- Try running
ncu --versionin VS Code’s integrated terminal
Permission errors
Permission errors
NCU may require elevated permissions on some systems:
- On Linux, you may need to run VS Code with
sudoor configure NCU permissions - See NVIDIA’s NCU documentation for permission setup
Profiling fails or hangs
Profiling fails or hangs
Common causes:
- The executable path is incorrect
- The executable crashes before kernel launch
- Insufficient GPU memory
Best Practices
Profile Release Builds
Always profile optimized builds. Debug builds have extra overhead that skews results.
Warm Up First
Run your kernel once before profiling to warm up GPU caches and avoid cold-start overhead.
Profile Representative Workloads
Use realistic input sizes and data patterns that match your production use case.
Iterate Incrementally
Profile → Optimize → Profile again. Small changes can have unexpected effects.