Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error MSB6006: "cmd.exe" exited with code 1. #27

Open
chayliu1991 opened this issue Sep 7, 2017 · 13 comments
Open

error MSB6006: "cmd.exe" exited with code 1. #27

chayliu1991 opened this issue Sep 7, 2017 · 13 comments

Comments

@chayliu1991
Copy link

I build this project by CMake 3.9.1 and choose visual studio 2013.After gengerating solution file.I open it and rebuild but it always show error MSB6006: "cmd.exe" exited with code 1. I have double check there is no space in the file path and I also run as administrator.It stil has the same problem.

@wangmiaomiaomiaowu
Copy link

Have you solved this problem? I meet the same situation. If, can you tell the solution.Thanks!

@zhaolei-momo
Copy link

If you solved this problem, can you tell me the solution? Thank you!

@Karol-G
Copy link

Karol-G commented Sep 11, 2018

I have this problem too. Any solutions?

@15757170756
Copy link

your guys can use these code on Linux。It's OK

@GGzhangBOY
Copy link

Anyone solve this problem?

@Karol-G
Copy link

Karol-G commented Jan 27, 2019

I managed to solve this problem, but i forgot how exactly I did it. I had other problems with building it too, so I made a short txt how I solved all my problems back then. I don't know anymore which of these lines solved the problem, but I made some annotations in brackets what I think they did. Sorry if the txt is a bit confusing.
I hope this helps :)

  • CMakeLists.txt, Line 57: Replace -arch=sm_35 with -arch=sm_52 (The arch param depends on the gpu you are using)

  • CMakeLists.txt, Line 22,27,30: Removed -O2; (I think you only need to remove this when buidling in release mode)

  • CMakeLists.txt, Line 72: Copyrigth.txt | Comment out this line

  • cudaSiftH.cu: Comment out Line 226-230
    //safeCall(cudaMemcpyFromSymbol(&totPts, &d_PointCounter[2], sizeof(int)));
    //int totPts = (totPts<siftData.maxPts ? totPts : siftData.maxPts);
    //if (totPts>0)
    // printf(" %.2f ms / DoG, %.4f ms / Sift, #Sift = %d\n", gpuTimeDoG/NUM_SCALES, gpuTimeSift/(totPts-fstPts), totPts-fstPts);
    (Throws some error)

  • Run .sln as admin (I think to avoid ""cmd.exe" exited with code 1" )

  • Build path needs to be in user directory and spaces in the path are not allowed (I think to avoid ""cmd.exe" exited with code 1")

  • For ALL_BUILD, cudasift, INSTALL, PACKAGE and ZERO_CHECK: Configuration Properties -> General -> Configuration Type -> Static library (.lib) ( I think this was just so I could use it better in my code)

  • Run ALL_BUILD and INSTALL and copy new cudasift.exe to execution directory of your application

  • Add cudasift.exe to Library Directories and Linker ( I think this was just so I could use it better in my code)

@gmcgrath-lakehead
Copy link

gmcgrath-lakehead commented Apr 9, 2019

Regarding the problem solving steps @cookingcookie references above, the most important points to avoid issues are:

  • CMakeLists.txt, Line 57: Replace -arch=sm_35 with -arch=sm_## (The arch param depends on the gpu you are using)

To determine which GPU you're using, refer the NVIDIA website. Find your GPU and refer to this list for the supported real architecture you have. (Mine compiled fine with the default). My architecture from that list is 2.1 but the minimum you can use is 3.0. I managed to get everything working using -arch=sm_30

  • CMakeLists.txt, Line 22,27,30: Removed -O2; (I think you only need to remove this when building in release mode)

This point requires a correction. Remove the -O2 to compile in Debug mode. This doesn't require you to generate the files again with CMake.

I didn't directly solve this problem but I did get the files to compile properly. One necessary thing is that Visual Studio 2013 MUST be used. VS2015 and VS2017 will not work.

I used CMake version 3.12.1 to configure and generate my solution. I previously built the OpenCV libraries. I ensured that my source code directory and binary build directory did not have any space characters in the paths. The only configuration setting I changes was the OpenCV_DIR to the folder containing OpenCVConfig.cmake.

Pieces of code that should be changed, and I've contacted Dr. Björkman, change all instances of cudaThreadSynchronize() to cudaDeviceSynchronize(). This is because cudaThreadSynchronize() is deprecated.

I opened the project in VS2017 while running as an administrator. I right-clicked on ALL_BUILD > Build and was successful.

Hope I was able to help.

@Karol-G
Copy link

Karol-G commented Apr 11, 2019

@gmcgrath-lakehead

One necessary thing is that Visual Studio 2013 MUST be used. VS2015 and VS2017 will not work.

Hmmm. I managed to compile everything in Visual Studio 2017.

@gmcgrath-lakehead
Copy link

@cookingcookie

Hmmm. I managed to compile everything in Visual Studio 2017.

I managed to get it to compile properly in VS2017 today. My issue was that I was using the incorrect architecture parameter when trying to compile in VS2017

@mintisan
Copy link

remove duplicated flag -arch=sm_62 works for me

@kunalkhosla93
Copy link

Hi all,
I still am unable to fix this error. Currently using VS2017,Nvidia toolkit 8.0, 930Mx Geforce nvidia card and opencv 3.4.2. As per my research the suitable arch for my card is sm_50/compute_50. I changed the line n0. 57 in cmake lists.txt file and built using VS2017 compiler and then once i open the .sln file as admin i get the same error->"Error MSB6006 "cmd.exe" exited with code 1. cudasift"

@vincenttse0531
Copy link

Hi there,
I am still stuck with this error, currently using VS2017, Nvidia toolkit 10.2 and GT 730 with opencv 3.4.2. I found the arch for my card should be sm _30. However modifying the CMakeLists.txt with every sm_xx replaced by sm_30 as below, the issue still persist.

Do anyone have idea how to fix it?

Regarding the problem solving steps @cookingcookie references above, the most important points to avoid issues are:

  • CMakeLists.txt, Line 57: Replace -arch=sm_35 with -arch=sm_## (The arch param depends on the gpu you are using)

To determine which GPU you're using, refer the NVIDIA website. Find your GPU and refer to this list for the supported real architecture you have. (Mine compiled fine with the default). My architecture from that list is 2.1 but the minimum you can use is 3.0. I managed to get everything working using -arch=sm_30

  • CMakeLists.txt, Line 22,27,30: Removed -O2; (I think you only need to remove this when building in release mode)

This point requires a correction. Remove the -O2 to compile in Debug mode. This doesn't require you to generate the files again with CMake.

I didn't directly solve this problem but I did get the files to compile properly. One necessary thing is that Visual Studio 2013 MUST be used. VS2015 and VS2017 will not work.

I used CMake version 3.12.1 to configure and generate my solution. I previously built the OpenCV libraries. I ensured that my source code directory and binary build directory did not have any space characters in the paths. The only configuration setting I changes was the OpenCV_DIR to the folder containing OpenCVConfig.cmake.

Pieces of code that should be changed, and I've contacted Dr. Björkman, change all instances of cudaThreadSynchronize() to cudaDeviceSynchronize(). This is because cudaThreadSynchronize() is deprecated.

I opened the project in VS2017 while running as an administrator. I right-clicked on ALL_BUILD > Build and was successful.

Hope I was able to help.

@iDXM
Copy link

iDXM commented Oct 29, 2020

before generating solution file(right click ALL_BUILD and choose generate) in Visual Studio, what you only need to do is choosing Release X64 mode, then everything will be fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests