_Tom
September 26, 2009, 1:39pm
1
Hi,
i didn’t touch my project for some months… yesterday, when i tried to rebuild it i found that CUDA is “broken”.
I get tons of macro errors from the CUDA compiler 2.3 for things like constant or shared or any other CUDA specific macro!
Some examples, tons of these:
2>d:/DEV/CRender/Library/cuda/VertexKernel.cu(9) : warning C4003: not enough actual parameters for macro ‘loc_sc ’
2>d:/DEV/CRender/Library/cuda/VertexKernel.cu(10) : warning C4003: not enough actual parameters for macro ‘loc_sc ’
2>d:/DEV/CRender/Library/cuda/VertexKernel.cu(11) : warning C4003: not enough actual parameters for macro ‘loc_sc ’
…
That happen at the same lines of these:
2>d:/DEV/CRender/Library/cuda/VertexKernel.cu(9) : warning C4003: not enough actual parameters for macro ‘__shadow_var’
2>d:/DEV/CRender/Library/cuda/VertexKernel.cu(10) : warning C4003: not enough actual parameters for macro ‘__shadow_var’
2>d:/DEV/CRender/Library/cuda/VertexKernel.cu(11) : warning C4003: not enough actual parameters for macro ‘__shadow_var’
…
and other random stub.c errors:
2>C:\Users\Tommaso\AppData\Local\Temp/tmpxft_000011f4_00000000-3_VertexKernel.cudafe1.stub.c(21) : warning C4003: not enough actual parameters for macro ‘__host__shadow_var’
2>C:\Users\Tommaso\AppData\Local\Temp/tmpxft_000011f4_00000000-3_VertexKernel.cudafe1.stub.c(21) : warning C4003: not enough actual parameters for macro ‘__device__shadow_var’
2>C:\Users\Tommaso\AppData\Local\Temp/tmpxft_000011f4_00000000-3_VertexKernel.cudafe1.stub.c(21) : warning C4003: not enough actual parameters for macro ‘__name__shadow_var’
The project was perfectly working with CUDA 2.2, now i’m compiling with CUDA 2.3.
I reinstalled any SDK, even rebuilt the project ground up… but i can’t figure what is wrong with CUDA macros.
Any ideas??
Can you post some self-contained code that reproduces these errors?
fcs
September 28, 2009, 7:57am
4
did you switch your nvidia driver to version 190.* ?
cuda 2.3 doesn’t work with driver 185.* and previous.
_Tom
September 28, 2009, 2:50pm
5
I would like to, but unfortunately ANY variable defined as shared or constant produces the exact same errors… i tried to exclude the more code possible, but i noticed that if there is even ONE “normal” error (like symbol not found etc) these errors won’t show up.
So i should build a working but stripped down version of this, and it’s really annoying.
Yeah i run 190.62 WHQL.
Maybe there are some conflicts with the old CUDA 2.2? I disinstalled it, but i was previously using CUDA x86 on my x64 Windows… i noticed that while CUDA 2.2 had a version-specific SDK, CUDA 2.3 contains both x86 and x64.
Could this be a problem, given that i try to use the first on the second?
EDIT:
this code
struct __align__(16) cudaMatrix4
{
float
a11, a12, a13, a14,
a21, a22, a23, a24,
a31, a32, a33, a34,
a41, a42, a43, a44;
};
__constant__ cudaMatrix4 worldViewProj;
__constant__ cudaMatrix4 worldViewProjIT;
__constant__ cudaMatrix4 world;
__constant__ cudaMatrix4 worldIT;
__constant__ cudaMatrix4 worldView;
__constant__ cudaMatrix4 worldViewIT;
__global__ void vertexKernel
(
)
{
}
Does cause error with the constant definitions… and there’s like nothing else in the .cu file.
gionov
February 13, 2010, 11:23am
7
Use
#include <cutil_inline.h>
and
cutilSafeCall
instead
#include <cutil.h>
and
CUDA_SAFE_CALL
On recompiling a kernel which works with CUDA 3.1 with newly installed CUDA 4.0 I get
kernel.cu:48:26: error: macro "__loc_sc__" passed 3 arguments, but takes just 2
on
extern __shared__ unsigned int shared_array[];
and
__constant__
unsigned int Constant[15*1024]; //leave 1kwords free for other constants
I think this is because I have told nvcc (via -I) to use the CUDA 3.1 include files.
The compilation errors are removed when -I/usr/local/cuda/SDK/C/common/inc/ is used instead
The first call to cudaMalloc failed with
main.cpp(440) : cudaSafeCall() Runtime API error 10200: unspecified driver error.
until the image linker (g++) was told to build the image (via -L) with CUDA 4.0 object libraries
Bill
ps: with the new driver C2050 is approx 25 mS faster
akavo
September 3, 2011, 5:07am
9
On recompiling a kernel which works with CUDA 3.1 with newly installed CUDA 4.0 I get
kernel.cu:48:26: error: macro "__loc_sc__" passed 3 arguments, but takes just 2
on
extern __shared__ unsigned int shared_array[];
and
__constant__
unsigned int Constant[15*1024]; //leave 1kwords free for other constants
I think this is because I have told nvcc (via -I) to use the CUDA 3.1 include files.
The compilation errors are removed when -I/usr/local/cuda/SDK/C/common/inc/ is used instead
The first call to cudaMalloc failed with
main.cpp(440) : cudaSafeCall() Runtime API error 10200: unspecified driver error.
until the image linker (g++) was told to build the image (via -L) with CUDA 4.0 object libraries
Bill
ps: with the new driver C2050 is approx 25 mS faster
You didn’t mention upgrading the driver. Did you do that?
tera
September 3, 2011, 9:59am
10
I’d be really surprised if mixing include files from different CUDA versions worked. I certainly wouldn’t call CUDA broken if it didn’t.
I think the nvidia driver was updated to 2.6.18-164.15.1.el5
(ie /sbin/modinfo nvidia
includes
vermagic: 2.6.18-164.15.1.el5 SMP mod_unload gcc-4.1
We are running 64 bit Centos)
Bill
Sure. The point of my posting was to record my error, in case anyone else
hits something similar.
Bill