12

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?

Nicola Pezzotti
  • 2,317
  • 1
  • 16
  • 26

2 Answers2

4

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.

harrism
  • 26,505
  • 2
  • 57
  • 88
  • I'm intrest in a solution for Visual Studio. The last link list two possibility: the already mentioned /MP and the even slower /maxcpucount[:n]. – Nicola Pezzotti Jul 16 '13 at 13:17
  • I added a link to Incredibuild, which is possibly the only real solution for Visual Studio currently. – harrism Jul 17 '13 at 03:26
3

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.

Fillippo
  • 121
  • 1
  • 5