1


I have a problem with debugging a simple cpp code (it call some CUDA functions like cuInit(), cuDeviceGetCount()..). When I put a break point into the CPP code and start debugging I get this message:

This does not seem to be a "Debug" build.

When I remove all CUDA-calls and do not link the program against the cuda.lib and cudart.lib then the code is debuggable (it is possible to stop the program at the breakpoint and no error message is displayed).

Here is my CPP code:

#include <QtCore/QCoreApplication>
#include <QDebug>
#include <cuda.h>
#include <builtin_types.h>

int main(int argc, char* argv [])
{
    QCoreApplication(argc, argv);
    int deviceCount = 0;
    int cudaDevice = 0;
    char cudaDeviceName [100];
    cuInit(0);
    cuDeviceGetCount(&deviceCount);
    cuDeviceGet(&cudaDevice, 0);
    cuDeviceGetName(cudaDeviceName, 100, cudaDevice);
    qDebug() << "Number of devices: " << deviceCount;
    qDebug() << "Device name:" << cudaDeviceName;
}

Here is my .pro file:

QT       += core
QT       -= gui

TARGET = cudatest
CONFIG   += console
CONFIG   -= app_bundle

TEMPLATE = app
SOURCES += main.cpp    

#################################
# Begin CUDA configuration

win32 {
    CUDA_PATH = "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v6.5"
    CUDA_INC_DIR = $$CUDA_PATH/include
    contains(QMAKE_TARGET.arch, x86_64) {
        SYSTEMNAME = x64
        SYSTEMTYPE = 64
    } else {
        SYSTEMNAME = Win32
        SYSTEMTYPE = 32
    }
    CUDA_LIB_DIR = $$CUDA_PATH/lib/$$SYSTEMNAME
    QMAKE_CXXFLAGS_RELEASE -= -MD
    QMAKE_CXXFLAGS_RELEASE += -MT
    QMAKE_CXXFLAGS_DEBUG -= -MDd
    QMAKE_CXXFLAGS_DEBUG += -MTd
}

INCLUDEPATH +=  $$CUDA_INC_DIR
LIBS += -L$$CUDA_LIB_DIR -lcuda -lcudart

#End CUDA configuration
########################

Environment:

Qt Creator 3.2.2
CUDA v6.5
CPP Compiler: VC++ 2013 Express
Debugger: C:\Program Files (x86)\Windows Kits\8.1\Debuggers\x86\cdb.exe
Qt 5.3.2 (compiled by VC++ 2013, 32bit)

I tried to do the same with VC++ 2010 Proffesional with the same result.

Can anyone give me a suggestion where could be the problem?
Thank you.

0

1 Answer 1

1

its probably because you are using Visual Express 2013. It says here that there is no compiler support for VS 2013 Express for CUDA v6.5(Under the Table 2. Windows Compiler Support in CUDA 6.5) You need to install the complete version of Visual Studio.

6
  • Now I'm trying it to compile under Qt Creator 3.3 + VC++2010 Professional and VC++2013 Community, both with the same result :(
    – LairMan
    Jan 15, 2015 at 8:01
  • Is your problem that you cant compile with cuda at all, or that you cant debug it?
    – gmm
    Jan 16, 2015 at 16:57
  • My problem is, that I cannot debug under Qt Creator.
    – LairMan
    Jan 19, 2015 at 3:59
  • I tryied to compile and debug directly under VC++2013 Comunity and it works. My Qt Creator uses VC++2013 compiler and MS debugger (C:\Program Files (x86)\Windows Kits\8.1\Debuggers\x86\cdb.exe).
    – LairMan
    Jan 19, 2015 at 4:05
  • It seems to me that you are trying to compile for 32 bits, when it is deprecated. On the same link I posted above: "native development using the CUDA Toolkit on x86_32 is deprecated. Deployment and execution of CUDA applications using the CUDA Driver on x86_32 is still supported. To create 32-bit CUDA applications, use the cross-development capabilities of the CUDA Toolkit on x86_64."
    – gmm
    Jan 19, 2015 at 16:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.