0

从 Visual Studio 2012 运行我的应用程序时出现此错误。开发规范:

  • 库达 5.0
  • VS C++ 2012
  • Quadro K4000

我已经看到这里这里这里还有其他相关的帖子,但没有一个能很好地回答我的问题。我正在检查来自 CUDA API、CuRAND 和 CuBLAS 的所有返回代码,并且都返回成功。我查看了代码中出现问题的地方,恰好是在我为 GPU 创建计时器对象时。

我正在使用 CUDA SDK 附带的计时器

struct GpuTimer{
    cudaEvent_t start;
    cudaEvent_t stop;
    GpuTimer(){
        checkCudaErr(
            cudaEventCreate(&start)
            );

        checkCudaErr(
            cudaEventCreate(&stop)
            );
    }
    ~GpuTimer(){
        checkCudaErr(
            cudaEventDestroy(start)
            );
        checkCudaErr(
            cudaEventDestroy(stop)
            );
    }
    void Start(){
        checkCudaErr(
            cudaEventRecord(start, 0)
            );
    }
    void Stop(){
        checkCudaErr(
            cudaEventRecord(stop, 0)
            );
    }
    float Elapsed(){
        float elapsed;
        checkCudaErr(
            cudaEventSynchronize(stop)
            );

        checkCudaErr(
            cudaEventElapsedTime(&elapsed, start, stop)
            );
        return elapsed;
    }
};

所以在我的主要功能中

int main(args)
{
   ...
   ...
   ...
   GpuTimer t;
   ...
   ...
}

就在执行该行之后,我得到了

'App.exe' (Win32): Loaded 'C:\Windows\System32\nvcuda.dll'. Module was built without symbols.
'App.exe' (Win32): Loaded 'C:\Windows\System32\user32.dll'. Cannot find or open the PDB file.
'App.exe' (Win32): Loaded 'C:\Windows\System32\gdi32.dll'. Cannot find or open the PDB file.
'App.exe' (Win32): Loaded 'C:\Windows\System32\lpk.dll'. Cannot find or open the PDB file.
'App.exe' (Win32): Loaded 'C:\Windows\System32\usp10.dll'. Cannot find or open the PDB file.
'App.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'. Cannot find or open the PDB file.
'App.exe' (Win32): Loaded 'C:\Windows\System32\setupapi.dll'. Cannot find or open the PDB file.
'App.exe' (Win32): Loaded 'C:\Windows\System32\cfgmgr32.dll'. Cannot find or open the PDB file.
'App.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'. Cannot find or open the PDB file.
'App.exe' (Win32): Loaded 'C:\Windows\System32\advapi32.dll'. Cannot find or open the PDB file.
'App.exe' (Win32): Loaded 'C:\Windows\System32\sechost.dll'. Cannot find or open the PDB file.
'App.exe' (Win32): Loaded 'C:\Windows\System32\oleaut32.dll'. Cannot find or open the PDB file.
'App.exe' (Win32): Loaded 'C:\Windows\System32\ole32.dll'. Cannot find or open the PDB file.
'App.exe' (Win32): Loaded 'C:\Windows\System32\devobj.dll'. Cannot find or open the PDB file.
'App.exe' (Win32): Loaded 'C:\Windows\System32\shell32.dll'. Cannot find or open the PDB file.
'App.exe' (Win32): Loaded 'C:\Windows\System32\shlwapi.dll'. Cannot find or open the PDB file.
'App.exe' (Win32): Loaded 'C:\Windows\System32\imm32.dll'. Cannot find or open the PDB file.
'App.exe' (Win32): Loaded 'C:\Windows\System32\msctf.dll'. Cannot find or open the PDB file.
'App.exe' (Win32): Loaded 'C:\Windows\System32\dwmapi.dll'. Cannot find or open the PDB file.
'App.exe' (Win32): Unloaded 'C:\Windows\System32\dwmapi.dll'
'App.exe' (Win32): Loaded 'C:\Windows\System32\nvapi64.dll'. Cannot find or open the PDB file.
'App.exe' (Win32): Loaded 'C:\Windows\System32\version.dll'. Cannot find or open the PDB file.
'App.exe' (Win32): Loaded 'C:\Windows\System32\wintrust.dll'. Cannot find or open the PDB file.
'App.exe' (Win32): Loaded 'C:\Windows\System32\crypt32.dll'. Cannot find or open the PDB file.
'App.exe' (Win32): Loaded 'C:\Windows\System32\msasn1.dll'. Cannot find or open the PDB file.
First-chance exception at 0x000007FEFDA29E5D in App.exe: Microsoft C++ exception: cudaError_enum at memory location 0x000000000018EA00. //Repeated 20 times at least

最后,在启动应用程序后,我在输出控制台中看到了这条消息(在 VS2012 上)

'App.exe' (Win32): Loaded 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\bin\cudart64_50_35.dll'. Module was built without symbols.
'App.exe' (Win32): Loaded 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\bin\cublas64_50_35.dll'. Module was built without symbols.
'App.exe' (Win32): Loaded 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\bin\curand64_50_35.dll'. Module was built without symbols.

该应用程序运行得很好,结果对我来说看起来很好,但我想知道是什么导致了这个错误/异常以及如何解决它们,或者我是否应该忽略它们。

4

1 回答 1

2

您所做的观察与在 CUDA 库中正确捕获和处理的异常有关。在某些情况下,这是 CUDA GPU 操作的正常部分。正如您所观察到的,您的应用程序没有返回任何 API 错误并且可以正常运行。如果您不在可以报告此问题的 VS 环境中,则根本不会观察到这一点。

这被认为是 CUDA 5.0 下的正常行为。我相信在 CUDA 5.5 中有一些消除它的尝试。您可能希望尝试这样做,尽管这两种方式都不被视为问题。

您可能也对此问题/答案感兴趣。

于 2013-08-08T12:44:08.310 回答