鲲鹏编译调试插件
支持鲲鹏平台远程编译调试能力,通过可视化界面提升编译调试效率
支持通过工具提供的鲲鹏调试器,使用图形界面调试Nvidia GPU应用
功能简介
一键式部署
- 支持从Visual Studio Marketplace下载并在线安装插件,同时支持一键部署服务端鲲鹏编译器
编译调试
- 一键式安装GCC for openEuler、Bisheng Compiler和Bisheng JDK
- 可视化编译配置任务,一键式任务运行
- 远程单步调试C/C++代码
- 编译调试过程信息实时展示
- gtest框架用例树渲染及状态展示
鲲鹏调试器
CUDA程序调试
HPC并行调试
插件配置
- 配置远程环境信息 (包括ssh连接IP 端口 登录用户名 工作目录)
打开用户设置文件(settings.json)(文件 - 首选项 - 设置), 选择工作区, 输入框搜索kunpeng.remote.ssh.machineinfo, 在settings.json中编辑
"kunpeng.remote.ssh.machineinfo": [
{
"label": "xxx",
"ip": "xxx.xxx.xxx.xxx",
"port": "xxx",
"user": "xxx", /*非root用户*/
"workspace": "xxx",
"privateKey": "xxx"
},
{
"label": "xxx",
"ip": "xxx.xxx.xxx.xxx",
"port": "xxx",
"user": "xxx", /*非root用户*/
"workspace": "xxx",
"privateKey": "xxx"
}
]
- 制作公私钥对。
Windows下可以通过cmd执行
ssh-keygen -b 3072 -t rsa
命令生成公私钥对,默认回车即可。生成的公私钥对默认保存在“~/.ssh/目录”下的id_rsa、id_rsa.pub文件中。
- 拷贝本地.ssh文件夹到SSH服务端(即要连接的远程环境),然后将公钥文件中的内容导入到authorized_keys文件中。
cd ~/.ssh
cat id_rsa.pub >> authorized_keys
- 配置目录权限。
- SSH服务端用户目录权限配置为700
chmod 700 ~
- .ssh目录权限配置为700
chmod 700 ~/.ssh
- authorized_keys权限配置为600
chmod 600 ~/.ssh/authorized_keys
- 配置本地ssh客户端地址
在VS Code上选择“文件 > 首选项 > 设置”,选择“工作区”,输入框搜索kunpeng.remote.ssh.clientpath,在编辑框填写本地ssh客户端可执行文件所在的路径,格式(x:\xxx\xxx\xxx\xxx)
- 配置本地SSH私钥文件id_rsa的路径
在VS Code上选择“文件 > 首选项 > 设置”,选择“工作区”, 输入框搜索kunpeng.remote.ssh.privatekeypath,在编辑框填写私钥文件id_rsa的路径,格式(x:\xxx\xxx\xxx\id_rsa)
{
"type": "shell",
"group": {
"kind": "build",
"isDefault": true
},
"options": {
"env": {
"xxx": "xxx"
}
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
"label": "xxx", /*编译任务名称*/
"command": "xxx", /*启动编译的命令,命令里包含的路径为相对于workspace的路径*/
"problemMatcher": {
"owner": "cpp",
"fileLocation": [
"relative",
"${workspaceRoot}"
],
"pattern": {
"regexp": "^([^:]*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
}
{
"name": "xxx", /*调试任务名称*/
"type": "cppdbg",
"request": "launch",
"program": "./swm_llt", /*需要运行或调试的二进制文件名称*/
"args": [],
"stopAtEntry": true,
"cwd": "${command:remotessh.remoteworkspace}/xxx/xxx/xxx/swm_llt",/*需要运行或调试的二进制文件路径*/
"externalConsole": true,
"MIMode": "gdb",
"pipeTransport": {
"pipeCwd": "",
"pipeProgram": "${command:remotessh.sshclientpath}",
"pipeArgs": [
"-p",
"${command:remotessh.remoteport}",
"${command:remotessh.remoteuser}@${command:remotessh.remoteip}"
],
"debuggerPath": "/usr/bin/gdb"
},
"sourceFileMap": {
"${command:remotessh.remoteworkspace}": "${workspaceRoot}"
},
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"text": "handle SIGPIPE nostop noprint pass",
"description": "ignore SIGPIPE",
"ignoreFailures": true
}
],
}
插件安装完成后在左侧工具栏会显示四个视图,依次是目标服务器视图、部署编译器视图、编译任务视图和测试用例视图
远程编译
远程调试
Kunpeng Compiler and Debugger Plugin
You can use the Kunpeng Debugger provided in the plugin to debug NVIDIA GPU applications on the GUI.
Function Overview
One-click deployment
- Supports the downloading of plugins from the Visual Studio Marketplace and online installation. Kunpeng compilers can be deployed on the server by one click.
Compilation and debugging
- One-click installation of GCC for openEuler, Bisheng Compiler, and Bisheng JDK
- Visualized compilation and configuration tasks and one-click task execution
- Remote step-by-step debugging of C/C++ code.
- Real-time display of compilation and debugging information
- Gtest framework case tree rendering and status display
Kunpeng Debugger
CUDA program debugging
- Tool installation and deployment in one click
- Real-time interaction of debugging information
HPC Parallel Debugging
- Source and assembly code debugging
- Display of historical communication group details
Plugin configuration
- Configuring the Remote Environment (including the SSH connection IP address, port number, login user name, and working directory.)
Open the user settings file (settings.json)(File > Preferences > Settings), select Workspace, enter kunpeng.remote.ssh.machineinfo in the search box, and click Edit in settings.json.
"kunpeng.remote.ssh.machineinfo": [
{
"label": "xxx",
"ip": "xxx.xxx.xxx.xxx",
"port": "xxx",
"user": "xxx",
"workspace": "xxx",
"privateKey": "xxx"
},
{
"label": "xxx",
"ip": "xxx.xxx.xxx.xxx",
"port": "xxx",
"user": "xxx",
"workspace": "xxx",
"privateKey": "xxx"
}
]
- Configuring Local SSH Login with Public and Private Keys (on Windows)
- Create a public-private key pair.
On Windows, run
ssh-keygen -b 3072 -t rsa
in the CLI to create a public-private key pair. Press Enter to proceed. By default, the created public-private key pair is stored in the id_rsa and id_rsa.pub files in ~/.ssh/.
- Copy the local .ssh folder to the SSH server (the remote environment to be connected) and import the content of the public key file to the authorized_keys file.
cd ~/.ssh
cat id_rsa.pub >> authorized_keys
- Configure the directory permissions.
- Set the permission for the SSH server user directory to 700.
chmod 700 ~
- Set the permission for the .ssh directory to 700.
chmod 700 ~/.ssh
- Set the permission for the authorized_keys file to 600.
chmod 600 ~/.ssh/authorized_keys
- Configuring the address of the local SSH client.
In VS Code, choose File>Preferences>Settings. Select Workspace and enter kunpeng.remote.ssh.clientpath in the search box. The path format is x:\xxx\xxx\xxx\xxx.
- Configuring the path of the local SSH private key file id_rsa.
In VS Code, choose File>Preferences>Settings. Select Workspace and enter kunpeng.remote.ssh.privatekeypath in the search box. In the edit box, enter the executable file path of the local SSH client. The path format is x:\xxx\xxx\xxx\id_rsa.
- Configure a compilation task (tasks.json). You can add a compilation task to the task.json file based on the following template.
{
"type": "shell",
"group": {
"kind": "build",
"isDefault": true
},
"options": {
"env": {
"xxx": "xxx"
}
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
"label": "xxx", /*task's label*/
"command": "xxx", /*Command for starting compilation. The path contained in the command is relative to the workspace path.*/
"problemMatcher": {
"owner": "cpp",
"fileLocation": [
"relative",
"${workspaceRoot}"
],
"pattern": {
"regexp": "^([^:]*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
}
- Configure a commissioning task (launch.json). You can add a commissioning task to launch.json based on the following template.
{
"name": "xxx", /*task name*/
"type": "cppdbg",
"request": "launch",
"program": "./swm_llt", /*Name of the binary file to be run or debugged*/
"args": [],
"stopAtEntry": true,
"cwd": "${command:remotessh.remoteworkspace}/xxx/xxx/xxx/swm_llt",/*Path of the binary file to be run or debugged*/
"externalConsole": true,
"MIMode": "gdb",
"pipeTransport": {
"pipeCwd": "",
"pipeProgram": "${command:remotessh.sshclientpath}",
"pipeArgs": [
"-p",
"${command:remotessh.remoteport}",
"${command:remotessh.remoteuser}@${command:remotessh.remoteip}"
],
"debuggerPath": "/usr/bin/gdb"
},
"sourceFileMap": {
"${command:remotessh.remoteworkspace}": "${workspaceRoot}"
},
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"text": "handle SIGPIPE nostop noprint pass",
"description": "ignore SIGPIPE",
"ignoreFailures": true
}
],
}
Remote compilation
Remote debugging