本文介绍了如何使用 optirun 命令在 nsight 中启动项目的调试版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在编写一些简单的 cuda 程序(我是学生,所以我需要练习),问题是我可以从终端使用 nvcc 编译它(使用 Kubuntu 12.04LTS),然后使用 optirun 执行它./a.out (hardver 是 dell inspiron 上的 geforce gt 525m),一切正常.主要问题是我无法从 Nsight 做任何事情.当我尝试启动代码的调试版本时,消息是启动失败!找不到二进制文件!".我认为这是关于使用 optirun 运行命令,但我不确定.有没有类似的经历?谢谢,提前帮助的人.:)

I'we been writing some simple cuda program (I'm student so I need to practice), and the thing is I can compile it with nvcc from terminal (using Kubuntu 12.04LTS) and then execute it with optirun ./a.out (hardver is geforce gt 525m on dell inspiron) and everything works fine. The major problem is that I can't do anything from Nsight. When I try to start debug version of code the message is "Launch failed! Binaries not found!". I think it's about running command with optirun but I'm not sure. Any similar experiences? Thanks, for helping in advance folks. :)

推荐答案

因为这是我在搜索nsight optirun"时发现的第一篇文章,所以我只想写下我为使其对我有用所采取的步骤.

As this was the first post I found when searching for "nsight optirun" I just wanted to wanted to write down the steps I took to make it working for me.

  1. 转到运行 -> 调试配置 -> 调试器

找到 CUDA GDB 可执行文件的文本框(在我的例子中,它设置为${cuda_bin}/cuda-gdb")

Find the textbox for CUDA GDB executable (in my case it was set to "${cuda_bin}/cuda-gdb")

添加optirun --no-xorg",在我的例子中是optirun --no-xorg ${cuda_bin}/cuda-gdb"

Prepend "optirun --no-xorg", in my case it was then "optirun --no-xorg ${cuda_bin}/cuda-gdb"

如果您有一个 OpenGL 窗口,则可能不需要--no-xorg"选项,甚至会适得其反,因为它会阻止任何这些出现.但是,对于我的科学代码,它是必需的,因为它可以防止我遇到内核超时.

The "--no-xorg" option might not be required or even counterproductive if you have an OpenGL window as it prevents any of that to appear. For my scientific code however it is required as it prevents me from running into kernel timeouts.

寻找错误的快乐.

这篇关于如何使用 optirun 命令在 nsight 中启动项目的调试版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-08 02:55