Nsight.nvim
A developer oriented Neovim framework for CUDA performance profiling and analysis.
Install / Use
/learn @Jorgedavyd/Nsight.nvimREADME
nsight.nvim
NVIDIA Nsight Integrated tools for Neovim.
<img height="480" src="/assets/nsight-logo.png" /> </div>Overview
nsight.nvim is a Neovim plugin that provides seamless integration with NVIDIA Nsight profiling tools. It allows you to manage CUDA profiling sessions, run various NVIDIA tools, and analyze profiling results without leaving your editor.
Requirements
- Neovim (v0.9.0 or higher)
- NVIDIA CUDA Toolkit:
nvcc: NVIDIA CUDA Compilernvvp: NVIDIA Visual Profilerncu: NVIDIA Nsight Computensys: NVIDIA Nsight Systems
Installation
Using lazy.nvim
{
"Jorgedavyd/nsight.nvim",
config = function()
require("nsight").setup({
-- Your configuration here
})
end,
}
Using packer.nvim
use {
"Jorgedavyd/nsight.nvim",
config = function()
require("nsight").setup({
-- Your configuration here
})
end
}
Using vim-plug
Plug 'Jorgedavyd/nsight.nvim'
" After installation, in your init.lua:
" lua require('nsight').setup({})
Using dein.vim
call dein#add('Jorgedavyd/nsight.nvim')
" After installation, in your init.lua:
" lua require('nsight').setup({})
Configuration
Default Configuration
require("nsight").setup({
session = {
window = {
title = "Nsight Session",
title_pos = "left",
width_in_columns = 12,
height_in_lines = 8,
style = "minimal",
border = "single"
},
keymaps = function(bufnr)
-- Define your keymaps here
end,
resolve_triggers = {}
},
extensions = {
telescope = {},
sqlite = {},
cli = {}
}
})
Functionalities
Main Features
- Session Management: Create and manage CUDA profiling sessions
- File Integration: Add CUDA source files to your profiling session
- Tool Integration: Run NVIDIA profiling tools directly from Neovim
- Report Analysis: View and analyze profiling reports
- Project Management: Organize profiling experiments per project
Commands
| Command | Description |
|---------|-------------|
| NsightActivate | Activate the profiling session |
| NsightDeactivate | Deactivate the profiling session |
| NsightToggle | Toggle the profiling session |
| Nvcc | Run NVIDIA CUDA Compiler |
| Ncu | Run NVIDIA Nsight Compute |
| Nvvp | Run NVIDIA Visual Profiler |
| Nsys | Run NVIDIA Nsight Systems |
| NsysUi | Open NVIDIA Nsight Systems UI |
| NcuUi | Open NVIDIA Nsight Compute UI |
API Functions
| Function | Description |
|----------|-------------|
| toggle_include() | Include the current buffer's filepath in the session |
| toggle_view() | Open the interactive session window |
Telescope Integration
The plugin integrates with Telescope for enhanced file selection and report browsing:
-- Add to your telescope configuration
telescope.load_extension('nsight')
-- Usage
:Telescope nsight file_add_cuda -- Find and add CUDA files to session
:Telescope nsight nsys_open_report -- Open Nsight Systems reports
:Telescope nsight ncu_open_report -- Open Nsight Compute reports
Project Structure
nsight.nvim creates a .nsight.nvim directory in your project root to store profiling experiments and configurations. Experiments are organized based on the files being profiled.
Experiment Structure
.nsight.nvim/
├── .config # Session configuration
└── experiments/
└── file1_file2/ # Experiment for specific files
├── report1/ # Profiling report
├── report2/
└── .history # Experiment history
Examples
Basic Usage
-- In your init.lua
require("nsight").setup()
-- In Neovim
:NsightToggle -- Open the profiler window
-- Add CUDA files to the session
:NsightDeactivate -- Save the session
:Nvcc -o output main.cu -- Compile a CUDA file
:Nsys profile ./output -- Profile the compiled binary
:Telescope nsight nsys_open_report -- View the report
Custom Keymaps
require("nsight").setup({
session = {
keymaps = function(bufnr)
-- Define keymaps for the profiler buffer
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<CR>',
"<cmd>lua require('nsight').toggle_include()<CR>",
{ noremap = true, silent = true })
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'q',
"<cmd>lua require('nsight.ui').close_menu()<CR>",
{ noremap = true, silent = true })
end
}
})
Contributing
Contributions are welcome! Check out the todo.md file for planned features and improvements.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Related Skills
openhue
354.2kControl Philips Hue lights and scenes via the OpenHue CLI.
sag
354.2kElevenLabs text-to-speech with mac-style say UX.
weather
354.2kGet current weather and forecasts via wttr.in or Open-Meteo
casdoor
13.3kAn open-source AI-first Identity and Access Management (IAM) /AI MCP & agent gateway and auth server with web UI supporting OpenClaw, MCP, OAuth, OIDC, SAML, CAS, LDAP, SCIM, WebAuthn, TOTP, MFA, Face ID, Google Workspace, Azure AD
