Software Archive
Read-only legacy content
17061 Discussions

Hooking up the cuda compiler (nvcc)

tanmayd
Beginner
1,237 Views

Hi,
I am trying to use the nvcc compiler tool that comes with CUDA (v 2.1) with the Intel C++ compiler inside VS 2008. So far I have not been able to do this successfully.

I get the following error from nvcc -
"C:\CUDA\bin\nvcc.exe" -arch sm_11 -ccbin "C:\Program Files\Microsoft Visual Studio 9.0\VC\bin" -Xcompiler "/EHsc /W3 /nologo /O2 /Zi /MT " -IC:\CUDA\include -I..\Include -maxrregcount=[Value] --compile -o ReleaseCEV2\CudaFile.cu.obj src\CudaFile.cu
1>nvcc fatal : '[Value]': expected a number

What am I not doing correctly?

If I simply switch back to the Microsoft compiler, my project builds fine.

Thanks in advance!

0 Kudos
5 Replies
KitturGanesh
Employee
1,237 Views
Hi,

The Intel Compiler is completely compatible with Microsoft and I don't see any reason as to why you should have problems using with CUDA. I haven't worked with CUDA myself but looked at the CUDA doc and you should pass the path to the Intel Compiler properly to the-ccbin argument as the message shows it is still set to Microsoft Compiler? Just a thought.

Also, since the Intel Compiler is completely compatible with Microsoft, it should work fine unless there's some non-compatibility issue which needs to be looked at if any? I'll touch base with some of my peers to see if anyone has any more input on this issue you're encountering and will update this post accordingly.

-regards,
Kittur
0 Kudos
tanmayd
Beginner
1,237 Views

Kittur,
Thanks for your reply.
I reviewed the documentation for the cuda compiler. It passes the non-cuda code to the host compiler and it requires the host compiler to be a 'gcc derivative'.I do not know if the Intel compiler satisfies that requirement. I am not sure what level of 'compatibility' do the nVidia folks expect.

Another revelation I had was that I could use the MS compiler on the cuda files and use the Intel compiler for the rest of my code.

Now, with one of my projects I can do this mixed mode compilation successfully. But with another project I am not being able to do it. I think I have a lead onto this issue and will post if I find something substantial. (For those interested I think the culprit is the Cuda Build Rule v 2.1 that I am using in the second project.)
0 Kudos
KitturGanesh
Employee
1,237 Views
Thanks for your input. I've touched base with quite a few peers of mine and haven't been able to so far find any significant leads. Also,I don't have a system/environment that I can reproduce or build with cuda for now. The Parallel Composer or our other Linux C++ compilers are compatible with gcc though, and should compile any code that can be compiled with gcc. That said, I am not sure what else is going on with your set-up with cuda build/host compilation settings. I'll update this post as soon as I find any leads on this issue.

Yes, please share your findings if you happen to get some resolution at your end, appreciate much. If you happen to find any non-gcc compatibility issue, please let us know as that would be a bug or feature request in Intel Compiler, just FYI.

-Cheers,
Kittur
0 Kudos
Miket
Beginner
1,237 Views

I also faced this problem. Even more, exactly the same situation is with Cuda 3.0 Beta released a few days ago.

It seems to me that I found a very simple solution:

Open your "Cuda.Rules" file (default location is in "..NVIDIA GPU Computing SDKCcommonCuda.Rules") in any text editor,

find the line

Switch="-maxrregcount=[Value]"

and change it to

Switch="-maxrregcount=[value]"

Restart you IDE, and try to build the solution again.

It should do the trick!

Regards,
Michael

0 Kudos
KitturGanesh
Employee
1,237 Views
Thanks Michael, for your tip! Tanmayd, could you please try that out and let us know if it works?!
-Cheers,
Kittur
0 Kudos
Reply