I have a couple of C++ projects in a Visual Studio 2012 solution. Those projects contains a large amount of files and I use /MP to speed up the code generation.
I was wondering if there's a way to speed up also NVCC in a similar way. Using /MP in the project containing the CUDA kernels gives no benefits in compilation time and I can see only one core at work.
So the question is: how can I use my multicore PC for speeding up CUDA compilation?
As of CUDA 5.5, nvcc
does not have an equivalent of MSVC's /MP, so any build parallelism for .cu files will need to come from the build tool which invokes NVCC.
If you can build using GNU Make (e.g. Under Cygwin or on a Linux/Unix/OS X system), you could use its parallel building functionality, using the -j
option, which causes it to process multiple recipes in parallel.
Here is a nice blog post which enumerates multiple parallel build options on Windows, some of which may work with NVCC.
For a true distributed/parallel build system supporting MSVC and NVCC, you could try Incredibuild.
You can use IncrediBuild
But this error can occur:
fatal error C1041: cannot open program database '...'; if multiple CL.EXE write to the same .PDB file, please use /FS
To avoid it, please set Project -> Properties -> CUDA C/C++ -> Host -> Additional Compiler Options -> /FS.
For more read on this blog.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With