【发布时间】:2021-09-20 21:05:54
【问题描述】:
我有一个要运行和编译的 test.cu cuda 文件。 以下是我尝试过的事情。
- 在 sublime-text 4 中构建 cuda 构建系统
{
"shell_cmd": "nvcc $file_name -o ${file_base_name} && ${file_path}/${file_base_name}",
"working_dir": "$file_path",
"selector": "source.cu, source.lib, source.exp",
"path": "/usr/lib/nvidia-cuda-toolkit/bin",
"shell": true
}
但是,使用上述系统编译 test.cu 后。我得到了
/usr/bin/env: ‘bash’: No such file or directory
[Finished in 6ms with exit code 127]
[shell_cmd: nvcc test.cu -o test && /home/name/My Data/Code Repo/Geometric Learning/test]
[dir: /home/name/My Data/Code Repo/Geometric Learning]
[path: /home/name/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin]
- 使用终端编译
nvcc test.cu -o test
生成a.out 和test。
在这之后我跑了
test
什么也没返回。
如何编译和运行代码(最好是 sublime 文本)?
系统规格:nvcc 10.1 + ubuntu 20.04 操作系统。
【问题讨论】:
标签: cuda gpu sublimetext3 nvcc