Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. CUDA on Qt
Forum Updated to NodeBB v4.3 + New Features

CUDA on Qt

Scheduled Pinned Locked Moved Unsolved General and Desktop
18 Posts 4 Posters 12.1k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Maithri

    I Changed it to 64 bit version, now I am facing problem with
    **error: file not recognized: File format not recognized ** for cuda object(.obj) file

    Ni.SumiN Offline
    Ni.SumiN Offline
    Ni.Sumi
    wrote on last edited by
    #5

    @Maithri

    Clean and re-built once. It might help. And re-check the paths given.

    1 Reply Last reply
    2
    • lilyofvalleyL Offline
      lilyofvalleyL Offline
      lilyofvalley
      wrote on last edited by
      #6

      For this error:
      **error: file not recognized: File format not recognized ** for cuda object(.obj) file

      Change the include path and lib path to following style and delete the build folder and .pro.user file, rebuild:

      INCLUDEPATH +="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v7.5/include"

      macx:QMAKE_LIBDIR += "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v7.5/lib"
      linux:QMAKE_LIBDIR += "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v7.5/lib64"
      win32:QMAKE_LIBDIR += "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v7.5/lib/x64"

      I met similar problem in win 7, not sure about win 10.

      1 Reply Last reply
      1
      • M Offline
        M Offline
        Maithri
        wrote on last edited by
        #7

        Thanks Ni.Sumi & lilyofvalley,
        but nothing worked for me, still the same problem is coming.

        1 Reply Last reply
        0
        • lilyofvalleyL Offline
          lilyofvalleyL Offline
          lilyofvalley
          wrote on last edited by
          #8

          These are the settings in my .pro file with win 7. I don't have win 10.
          For your reference:

          # CUDA with Windows
              #CUDA_DIR = "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5"
              CUDA_DIR = "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0"
              SYSTEM_NAME = x64         # Depending on your system either 'Win32', 'x64', or 'Win64'
              SYSTEM_TYPE = 64            # '32' or '64', depending on your system
              CUDA_ARCH = sm_52           # Type of CUDA architecture, for example 'compute_10', 'compute_11', 'sm_10'
              NVCC_OPTIONS = --use_fast_math # default setting
          
              #include paths
              #INCLUDEPATH += $$CUDA_DIR\include
              #INCLUDEPATH += "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\include"
              INCLUDEPATH += "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include"
          
              #library directories
              #QMAKE_LIBDIR += $$join(CUDA_DIR,'" -I"','-I"','"')\lib\$$SYSTEM_NAME
              #QMAKE_LIBDIR += "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\lib\x64"
              QMAKE_LIBDIR += "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\lib\x64"
          
              CUDA_LIBS = -lcuda -lcudart -lcufft
          
              CUDA_INC += $$join(INCLUDEPATH,'" -I"','-I"','"')
          
              LIBS += $$CUDA_LIBS
          
              # MSVCRT link option (static or dynamic, it must be the same with your Qt SDK link option)
              MSVCRT_LINK_FLAG_DEBUG = "/MDd"
              MSVCRT_LINK_FLAG_RELEASE = "/MD"
          
              CONFIG(debug, debug|release){
                  cuda_d.input    = CUDA_SOURCES
                  cuda_d.output   = ${QMAKE_FILE_BASE}_cuda.obj
                  cuda_d.commands = $$CUDA_DIR/bin/nvcc.exe -D_DEBUG $$NVCC_OPTIONS $$CUDA_INC $$LIBS \
                                  --machine $$SYSTEM_TYPE -arch=$$CUDA_ARCH \
                                  --compile -cudart static -g -DWIN32 -D_MBCS \
                                  -Xcompiler "/wd4819,/EHsc,/W3,/nologo,/Od,/Zi,/RTC1" \
                                  -Xcompiler $$MSVCRT_LINK_FLAG_DEBUG \
                                  -c -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME}
                  cuda_d.dependency_type = TYPE_C
                  QMAKE_EXTRA_COMPILERS += cuda_d
              }
              else {
                  # Release settings
                  cuda.input    = CUDA_SOURCES
                  cuda.output   = ${QMAKE_FILE_BASE}_cuda.obj
                  cuda.commands = $$CUDA_DIR/bin/nvcc.exe $$NVCC_OPTIONS $$CUDA_INC $$LIBS \
                                  --machine $$SYSTEM_TYPE -arch=$$CUDA_ARCH \
                                  --compile -cudart static -DWIN32 -D_MBCS \
                                  -Xcompiler "/wd4819,/EHsc,/W3,/nologo,/O2,/Zi" \
                                  -Xcompiler $$MSVCRT_LINK_FLAG_RELEASE \
                                  -c -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME}
                  cuda.dependency_type = TYPE_C
                  QMAKE_EXTRA_COMPILERS += cuda
              }
          
          1 Reply Last reply
          1
          • M Offline
            M Offline
            Maithri
            wrote on last edited by
            #9

            Thanks for the support,

            Compilation problems got solved, now getting run time error

            D:\maithri_MODD\CUDA_QT_5.7\build-cuda-qt-integration-GCC-Debug\cuda-qt-integration.exe exited with code -1073741515
            
            mrjjM 1 Reply Last reply
            1
            • M Maithri

              Thanks for the support,

              Compilation problems got solved, now getting run time error

              D:\maithri_MODD\CUDA_QT_5.7\build-cuda-qt-integration-GCC-Debug\cuda-qt-integration.exe exited with code -1073741515
              
              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #10

              @Maithri said in CUDA on Qt:

              exited with code -1073741515

              Hi
              If you start in debug mode and place breakpoint at main()

              Do you get to the BP before the error ?

              or does error just comes at once and main never reached?

              1 Reply Last reply
              1
              • M Offline
                M Offline
                Maithri
                wrote on last edited by kshegunov
                #11

                @mrjj

                hello,
                if I run it in debug mode, it's not reaching breakpoint and giving some other error.
                I have attached error msg and main.cpp code
                alt text
                alt text

                Thanks

                [Fixed images' URLs ~kshegunov]

                mrjjM 1 Reply Last reply
                0
                • M Maithri

                  @mrjj

                  hello,
                  if I run it in debug mode, it's not reaching breakpoint and giving some other error.
                  I have attached error msg and main.cpp code
                  alt text
                  alt text

                  Thanks

                  [Fixed images' URLs ~kshegunov]

                  mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by mrjj
                  #12

                  @Maithri
                  Super but picture upload is broken here and I cant see it.
                  Can you please use external site and post links here.

                  Oh you did, for some reason they are not shown.
                  http://pasteboard.co/jvoRueubz.png
                  http://pasteboard.co/jvqX5yI1J.png

                  I am not huge Visual Studio user but this error
                  -1073741515 == 0xC0000135
                  and that should mean STATUS_DLL_NOT_FOUND

                  So maybe it needs some Dlls it cant find? Maybe some cuda ones?
                  If you have an idea which one it could be, then try copy them to the build folder next to the exe and try to
                  run again ( from editor) (Double clicking on EXE is 100% other matter so please dont do that)

                  Alternatively, download
                  http://www.dependencywalker.com/

                  It shows which dlls it will try to load and from where. that can also give hints.
                  So you will simply install it and open the .exe in it. it then shows all all it uses.
                  This tool is a bit confusing at first but gives great insight in what dlls being needed.

                  1 Reply Last reply
                  3
                  • M Offline
                    M Offline
                    Maithri
                    wrote on last edited by
                    #13

                    main.cpp and error message
                    http://pasteboard.co/jvqX5yI1J.png
                    http://pasteboard.co/jvtvlRcWF.png

                    mrjjM Ni.SumiN 2 Replies Last reply
                    0
                    • M Maithri

                      main.cpp and error message
                      http://pasteboard.co/jvqX5yI1J.png
                      http://pasteboard.co/jvtvlRcWF.png

                      mrjjM Offline
                      mrjjM Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on last edited by mrjj
                      #14

                      @Maithri

                      My best guess would it just wants some DLLS from cuda.
                      Something like
                      Projects- > Build & Run" tab
                      "Run Settings" (chosen in the "Kit") For you is VS 64 bit !
                      "Run Environment" > "Details" > PATH

                      and see if it has paths to where cuda DLLS are. ( if such exists :)

                      1 Reply Last reply
                      4
                      • M Offline
                        M Offline
                        Maithri
                        wrote on last edited by
                        #15

                        hi @mrjj ,

                        using the dependency walker figer out that the .exe file depends on so many dll files, I have given the path for the available dll's but still the problem exist .

                        Following are some of dll's which are not available in the system,
                        API-MS-WIN-CORE-HEAP-L2-1-0.DLL
                        API-MS-WIN-CORE-LIBRARYLOADER-L1-2-0.DLL
                        API-MS-WIN-CORE-APIQUERY-L1-1-0.DLL
                        API-MS-WIN-CORE-APPCOMPAT-L1-1-1.DLL
                        API-MS-WIN-CORE-APPINIT-L1-1-0.DLL
                        API-MS-WIN-CORE-ATOMS-L1-1-0.DLL
                        API-MS-WIN-CORE-COM-L1-1-1.DLL...........................

                        mrjjM 1 Reply Last reply
                        0
                        • M Maithri

                          hi @mrjj ,

                          using the dependency walker figer out that the .exe file depends on so many dll files, I have given the path for the available dll's but still the problem exist .

                          Following are some of dll's which are not available in the system,
                          API-MS-WIN-CORE-HEAP-L2-1-0.DLL
                          API-MS-WIN-CORE-LIBRARYLOADER-L1-2-0.DLL
                          API-MS-WIN-CORE-APIQUERY-L1-1-0.DLL
                          API-MS-WIN-CORE-APPCOMPAT-L1-1-1.DLL
                          API-MS-WIN-CORE-APPINIT-L1-1-0.DLL
                          API-MS-WIN-CORE-ATOMS-L1-1-0.DLL
                          API-MS-WIN-CORE-COM-L1-1-1.DLL...........................

                          mrjjM Offline
                          mrjjM Offline
                          mrjj
                          Lifetime Qt Champion
                          wrote on last edited by
                          #16

                          @Maithri

                          Those are normal. Shown as missing most of the time-
                          I was more after some CUDA dlls or something it need for this project.

                          Also click on those CUDA dlls it have and see if those have indirectly a need for a dll it cant find.

                          1 Reply Last reply
                          2
                          • M Maithri

                            main.cpp and error message
                            http://pasteboard.co/jvqX5yI1J.png
                            http://pasteboard.co/jvtvlRcWF.png

                            Ni.SumiN Offline
                            Ni.SumiN Offline
                            Ni.Sumi
                            wrote on last edited by Ni.Sumi
                            #17

                            @Maithri said in CUDA on Qt:

                            main.cpp and error message
                            http://pasteboard.co/jvqX5yI1J.png
                            http://pasteboard.co/jvtvlRcWF.png

                            In addition to Mr. @mrjj .

                            Usually, this debug error is caused due to mismatach of the bit version. Earlier , even I have faced the same problem . Please check that you are using the right cdb.exe (32 bit or 64 bit). Check here to configure the debug

                            CDB Process terminated unexpectedly
                            

                            you can find your 64 bit path of cdb here (Win10)

                            C:\Program Files (x86)\Windows Kits\8.1\Debuggers\x64\cdb.exe
                            

                            If still, does not run, check all the required dll's you have them or not. (not the general windows dll's).

                            Does it run fine in release mode ?

                            M 1 Reply Last reply
                            2
                            • Ni.SumiN Ni.Sumi

                              @Maithri said in CUDA on Qt:

                              main.cpp and error message
                              http://pasteboard.co/jvqX5yI1J.png
                              http://pasteboard.co/jvtvlRcWF.png

                              In addition to Mr. @mrjj .

                              Usually, this debug error is caused due to mismatach of the bit version. Earlier , even I have faced the same problem . Please check that you are using the right cdb.exe (32 bit or 64 bit). Check here to configure the debug

                              CDB Process terminated unexpectedly
                              

                              you can find your 64 bit path of cdb here (Win10)

                              C:\Program Files (x86)\Windows Kits\8.1\Debuggers\x64\cdb.exe
                              

                              If still, does not run, check all the required dll's you have them or not. (not the general windows dll's).

                              Does it run fine in release mode ?

                              M Offline
                              M Offline
                              Maithri
                              wrote on last edited by
                              #18

                              @Ni.Sumi

                              i am using 64bit cdb.
                              its running fine in release mode.

                              Thanks

                              1 Reply Last reply
                              1

                              • Login

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • Users
                              • Groups
                              • Search
                              • Get Qt Extensions
                              • Unsolved