【问题标题】:Error Message : Cannot find or open the PDB file错误消息:找不到或打开 PDB 文件
【发布时间】:2013-04-02 23:51:54
【问题描述】:

我尝试运行NVIDIA's official site 提供的示例程序。大多数程序运行顺利,除了少数我收到类似错误消息的地方。我该如何解决?这是我在运行名为“MatrixMul”的程序后收到的错误消息示例。

注意:我在 Window7x64 操作系统上同时安装了 x32 和 x64 NVIDIA CUDA Toolkit v5.0。

'matrixMul.exe': Loaded 'C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.0\bin\win32\Debug\matrixMul.exe', Symbols loaded.
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Program Files (x86)\NVIDIA GPU Computing Toolkit\CUDA\v5.0\bin\cudart32_50_35.dll', Binary was not built with debug information.
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\apphelp.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\AppPatch\AcLayers.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\user32.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\shell32.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\shlwapi.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\userenv.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\profapi.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\winspool.drv', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\mpr.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\nvinit.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\nvcuda.dll', Binary was not built with debug information.
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\setupapi.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\devobj.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\dwmapi.dll', Cannot find or open the PDB file
'matrixMul.exe': Unloaded 'C:\Windows\SysWOW64\dwmapi.dll'
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\nvapi.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\version.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\wintrust.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\crypt32.dll', Cannot find or open the PDB file
'matrixMul.exe': Loaded 'C:\Windows\SysWOW64\msasn1.dll', Cannot find or open the PDB file
The thread 'Win32 Thread' (0x12fc) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x18a0) has exited with code 0 (0x0).
The program '[3104] matrixMul.exe: Native' has exited with code 0 (0x0)

【问题讨论】:

  • 只是为了仔细检查,所有带有这些消息的样本仍然运行正确,对吧?如果没有,那么您还有其他一些错误,并且无法加载 PDB 文件是一个红鲱鱼。
  • 不,所有此类样本从未正确运行。我是初学者,对 CUDA 编程了解不多。
  • 样本给出了什么命令行输出?这些消息都不是致命错误,那么运行它们时样本输出了什么?可执行文件以代码 0 退出的最后一条消息看起来是正确的。
  • 重建项目修复了我的。

标签: visual-studio-2010 cuda nvidia windows-7-x64


【解决方案1】:

PDB 文件是特定于 Visual Studio 的文件,其中包含项目的调试符号。您可以忽略这些消息,除非您希望使用调试器进入这些 dll 的代码(这是值得怀疑的,因为这些是系统 dll)。换句话说,您可以并且应该忽略它们,因为您不会拥有任何这些 dll 的 PDB 文件(至少默认情况下,事实证明您实际上可以在通过Microsoft Symbol Server 调试时获得它们)。这意味着当您设置断点并单步执行代码时,您将无法单步执行任何这些 dll(无论如何您都不想这样做)。

为了完整起见,这里是来自 MSDN 的官方 PDB 描述:

程序数据库 (PDB) 文件包含调试和项目状态信息,允许增量链接程序的调试配置。使用 /ZI 或 /Zi 编译 C/C++ 程序时会创建 PDB 文件

另外为了将来参考,如果您想为自己的代码创建 PDB 文件,则必须在启用 /ZI 或 /Zi 选项的情况下构建项目(您可以通过项目属性设置它们 --> C /C++ --> 常规,然后设置“调试信息格式”字段)。与您的情况无关,但我认为它将来可能有用

【讨论】:

  • "您将无法进入任何这些 dll(无论如何您都不想这样做)" 等等...为什么不呢?如果我们想了解某些东西如何更好地工作怎么办?
  • @Andrew 该评论更针对这个问题的细节——理解 Windows 系统 DLL 与运行 CUDA 示例应用程序是正交的
  • 即使我按照您的步骤操作,仍然出现一个错误,'FaceReg.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'。已加载符号。 “FaceReg.exe”(Win32):已加载“C:\Windows\System32\KernelBase.dll”。已加载符号。 “FaceReg.exe”(Win32):已加载“C:\OpenCV\opencv\build\x86\vc12\bin\opencv_core2411d.dll”。无法找到或打开 PDB 文件。 “FaceReg.exe”(Win32):已加载“C:\Windows\System32\msvcp120d.dll”。已加载符号。
  • @DennisDo 这听起来更像是它无法加载 opencv PDB 文件而不是 windows PDB 文件。
  • @DennisDo 我也有同样的问题opencv_world300d.dll'. Cannot find or open the PDB file.。你是怎么解决你的问题的?
【解决方案2】:

使用 VS 2013。尝试以下工具 -> 选项 -> 调试 -> 输出窗口 -> 模块加载消息 -> 关闭它将禁用加载模块的显示。

【讨论】:

  • 我不知道为什么人们不赞成这样的答案;也许它没有准确回答问题,但它是有用的信息。顺便说一句,您也可以在输出窗口的文本区域中单击鼠标右键。
  • @Mike22LFC 能否解决加载符号的问题。
【解决方案3】:

如果该消息困扰您,您需要以管理权限运行 Visual Studio 才能在 Visual Studio 上应用此方向。

工具-> 选项-> 调试-> 符号并选中“Microsoft Symbol Servers”框,标记加载所有模块,然后单击加载所有符号。

Visual Studio 会为您完成所有其他工作,并且您将在“输出”窗口中的“调试”下看到此消息 “本机”已退出,代码为 0 (0x0)”

【讨论】:

  • 我按照你说的做了,但是我不能点击加载所有符号,因为它现在被禁用了。它显示此目录中缓存符号的浏览器选项。我不知道该选择什么。我正在使用 Visual Studio 2015。
【解决方案4】:
  1. 请检查“项目属性”>“配置属性”>“链接器”>“调试”选项卡下的“生成调试信息”设置是否为“是”。如果不是,请尝试将其更改为是。

  2. 那些特殊的 pdb(用于 ntdll.dll、mscoree.dll、kernel32.dll 等)用于 Windows API,简单的应用程序不需要。 但是,如果您无法为自己编译的项目找到 pdb,我建议确保 Project Properties > Configuration Properties > Debugging > Working Directory 使用 Project Properties > Configuration Properties > General > Output Directory 中的值。

  3. 您需要以“以管理员身份运行”模式运行Visual c++。右键单击可执行文件并单击“以管理员身份运行”

【讨论】:

    【解决方案5】:

    我也是 CUDA/Visual Studio 的新手,在几个示例中遇到了同样的问题。如果您运行 DEBUG-> Start Debugging,然后反复跳过 (F10),您将看到输出窗口出现并被填充。正常执行返回正常完成状态 0x0(如您所见)并关闭输出窗口。

    【讨论】:

    • 这对我来说是最有用的,因为我真的很想看看这个程序的输出以知道测试是否通过。请注意,您实际上需要设置一个断点以在窗口关闭之前停止执行。我在 main 方法的第一行设置了一个断点。
    【解决方案6】:

    如果在 Visual Studio 中发生这种情况,请清理您的项目并再次运行它。

    构建 --> 清洁解决方案

    运行(或 F5)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多