本文主要是介绍FasterTransformer 002: cuda调试env,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
VSCODE ENV
cmake
cuda-gdb
-
CUDA 番外篇 | Visual Studio Code的CUDA环境
-
error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory apt-get install libtinfo5
-
launch.json
{// Use IntelliSense to learn about possible attributes.// Hover to view descriptions of existing attributes.// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387"version": "0.2.0","configurations": [{"name": "CUDA C++: Launch","type": "cuda-gdb","request": "launch","program": "/home/pdd/test/gemm_test/test","preLaunchTask": "mynvcc"},{"name": "CUDA C++: Attach","type": "cuda-gdb","request": "attach"}]
}
- tasks.json
{"version": "2.0.0","tasks": [{"label": "mynvcc","type": "shell","command": "nvcc","args": ["-g","-G","-o","test","gemm_fp16.cu","-lcublas"] //https://stackoverflow.com/questions/64113574/undefined-reference-to-cublascreate-v2-in-tmp-tmpxft-0000120b-0000000-10-my}]
}
libtinfo.so.5
(base) pdd@pdd-Dell-G15-5511:~/Downloads$ sudo apt install libncurses5
[sudo] pdd 的密码:
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取状态信息... 完成
下列软件包是自动安装的并且现在不需要了:fcitx-config-common fcitx-config-gtk fcitx-frontend-all fcitx-frontend-gtk2 fcitx-frontend-gtk3 fcitx-frontend-qt5 fcitx-module-dbusfcitx-module-kimpanel fcitx-module-lua fcitx-module-quickphrase-editor5 fcitx-module-x11 fcitx-modules fcitx-ui-classic g++-11 gir1.2-appindicator3-0.1gir1.2-gst-plugins-base-1.0 gir1.2-gstreamer-1.0 gir1.2-keybinder-3.0 gir1.2-wnck-3.0 gnome-session-canberra libfcitx-config4 libfcitx-core0libfcitx-gclient1 libfcitx-qt5-1 libfcitx-qt5-data libfcitx-utils0 libgettextpo0 libkeybinder-3.0-0 libpresage-data libpresage1v5 libtinyxml2.6.2v5libwnck-3-0 libwnck-3-common presage python3-gi-cairo
使用'sudo apt autoremove'来卸载它(它们)。
将会同时安装下列软件:libtinfo5
下列【新】软件包将被安装:libncurses5 libtinfo5
升级了 0 个软件包,新安装了 2 个软件包,要卸载 0 个软件包,有 432 个软件包未被升级。
需要下载 107 kB/207 kB 的归档。
解压缩后会消耗 883 kB 的额外空间。
您希望继续执行吗? [Y/n] y
获取:1 https://mirrors.ustc.edu.cn/ubuntu jammy-security/universe amd64 libncurses5 amd64 6.3-2ubuntu0.1 [107 kB]
已下载 107 kB,耗时 0秒 (334 kB/s)
正在选中未选择的软件包 libtinfo5:amd64。
(正在读取数据库 ... 系统当前共安装有 283690 个文件和目录。)
准备解压 .../libtinfo5_6.3-2ubuntu0.1_amd64.deb ...
正在解压 libtinfo5:amd64 (6.3-2ubuntu0.1) ...
正在选中未选择的软件包 libncurses5:amd64。
准备解压 .../libncurses5_6.3-2ubuntu0.1_amd64.deb ...
正在解压 libncurses5:amd64 (6.3-2ubuntu0.1) ...
正在设置 libtinfo5:amd64 (6.3-2ubuntu0.1) ...
正在设置 libncurses5:amd64 (6.3-2ubuntu0.1) ...
正在处理用于 libc-bin (2.35-0ubuntu3.1) 的触发器 ...
/sbin/ldconfig.real: /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8 is not a symbolic link/sbin/ldconfig.real: /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_adv_train.so.8 is not a symbolic link/sbin/ldconfig.real: /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8 is not a symbolic link/sbin/ldconfig.real: /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8 is not a symbolic link/sbin/ldconfig.real: /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn.so.8 is not a symbolic link/sbin/ldconfig.real: /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_ops_train.so.8 is not a symbolic link/sbin/ldconfig.real: /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8 is not a symbolic link(base) pdd@pdd-Dell-G15-5511:~/Downloads$ sudo ln -sf /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8 /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8
ln: '/usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8' 与'/usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8' 为同一文件
(base) pdd@pdd-Dell-G15-5511:~/Downloads$ sudo ln -sf /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8.8.0 /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8
(base) pdd@pdd-Dell-G15-5511:~/Downloads$ ^C
(base) pdd@pdd-Dell-G15-5511:~/Downloads$ sudo ln -sf /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_adv_train.so.8.8.0 /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_adv_train.so.8
(base) pdd@pdd-Dell-G15-5511:~/Downloads$ sudo ln -sf /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8.8.0 /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8
(base) pdd@pdd-Dell-G15-5511:~/Downloads$ sudo ln -sf /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8.8.0 /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8
(base) pdd@pdd-Dell-G15-5511:~/Downloads$ sudo ln -sf /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn.so.8.8.0 /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn.so.8
(base) pdd@pdd-Dell-G15-5511:~/Downloads$ sudo ln -sf /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_ops_train.so.8.8.0 /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_ops_train.so.8
(base) pdd@pdd-Dell-G15-5511:~/Downloads$ sudo ln -sf /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8.8.0 /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8
(base) pdd@pdd-Dell-G15-5511:~/Downloads$
How can I get the libncursesw.so.5 file? Install is “up to date” but files do not exist
- sudo apt-get install libncursesw5
debug by gdb after build use cmke
- /home/pdd/test/FastT/FasterTransformer/.vscode/launch.json
{"version": "0.2.0","configurations": [{"name": "Debug","type": "cppdbg","request": "launch","program": "/home/pdd/test/FastT/FasterTransformer/build/bin/transformer_fp32", // target"cwd": "${workspaceRoot}",//"preLaunchTask": "build","miDebuggerPath": "/usr/bin/gdb"}]
}
- F 5 \color{red} \huge F5 F5
这篇关于FasterTransformer 002: cuda调试env的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!