Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cuda parallel code generation in Visual Studio

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?

like image 392
Nicola Pezzotti Avatar asked Jul 15 '13 15:07

Nicola Pezzotti


2 Answers

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.

like image 112
harrism Avatar answered Oct 27 '22 06:10

harrism


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.

like image 42
Fillippo Avatar answered Oct 27 '22 06:10

Fillippo