Vscode运行调试配置的一些记录。

Python

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "justMyCode": false
            // set env variable 
        },
        {
            "name": "test",
            "type": "python",
            "request": "launch",
            "program": "/home/yhao24/ml_scripts/inductor/test.py",
            "console": "integratedTerminal",
            "justMyCode": false,
            // set env variable 
            "env": {
                "TORCH_COMPILE_DEBUG": "1"
            }
        },

    ]
}

CUDA

tasks.json

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build CUDA",
            "type": "shell",
            "command": "/scratch/opt/cuda-12.1/bin/nvcc",
            "args": [
                "-g",
                "-G",
                "-o",
                "${workspaceFolder}/gpupunk/gpu-patch/test",
                "-I${workspaceFolder}/gpupunk/gpu-patch/include",
                "${workspaceFolder}/gpupunk/gpu-patch/src/test.cu"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}

launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "CUDA C++: Attach",
            "type": "cuda-gdb",
            "request": "launch",
            "program": "${workspaceFolder}/gpupunk/gpu-patch/test",
            "debuggerPath": "/scratch/opt/cuda-12.1/bin/cuda-gdb",
            "preLaunchTask": "build CUDA"
        }
    ]
}

文章版权归 FindHao 所有丨本站默认采用CC-BY-NC-SA 4.0协议进行授权|
转载必须包含本声明,并以超链接形式注明作者 FindHao 和本文原始地址:
https://findhao.net/easycoding/2612.html

Comments