How to know many memory available?! Available memory!

Hi everyone!

I want to know how many memory available when i run my program! But i dont know how to do that!
Can you show me the way? Thank :)!

You can use cuMemGetInfo (this is a driver api call but you can use it at the same time as runtime api).

Sorry, but i can’t find the function “cuMemGetInfo”!
Do i have to include other header file!
Thank!

#include <cuda.h>

Hi

I included cuda.h, but still have problems when building:

make

obj/release/multisvm.cu.o: In function `main':

tmpxft_0000757f_00000000-11_multisvm.ii:(.text+0x3e0c): undefined reference to `cuMemGetInfo'

collect2: ld returned 1 exit status

make: *** [../../bin/linux/release/multisvm] Error 1

Am I missing something?

-L /usr/local/cuda/lib -lcuda

Thanks! One more thing, If I use eclipse to build, where should that go?

If I do:

USEDRVAPI := 1 (which I checked the common.mk file and adds -lcuda)

I get more errors

**** Build of configuration Release for project multisvm ****

make 

obj/release/multisvm.cu.o: In function `__sti____cudaRegisterAll_43_tmpxft_00000fb0_00000000_4_m

ultisvm_cpp1_ii_23d03b05':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x4a): undefined reference to `__cudaRegisterFatBinary'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0xa0): undefined reference to `__cudaRegisterFunction'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0xe5): undefined reference to `__cudaRegisterFunction'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x12a): undefined reference to `__cudaRegisterFunction'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x16f): undefined reference to `__cudaRegisterFunction'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1b4): undefined reference to `__cudaRegisterFunction'

obj/release/multisvm.cu.o:tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1f9): more undefined references to `__cudaRegisterFunction' follow

obj/release/multisvm.cu.o: In function `__device_stub__Z11chooseclassPfPiS_iiii':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x3fe): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x435): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x44d): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x465): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x47d): undefined reference to `cudaSetupArgument'

obj/release/multisvm.cu.o:tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x495): more undefined references to `cudaSetupArgument' follow

obj/release/multisvm.cu.o: In function `__device_stub__Z11chooseclassPfPiS_iiii':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x4d1): undefined reference to `cudaLaunch'

obj/release/multisvm.cu.o: In function `__device_stub__Z14classifysamplePfS_S_PiS_S_iiiiiS_':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x53c): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x573): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x58b): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x5a3): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x5bb): undefined reference to `cudaSetupArgument'

obj/release/multisvm.cu.o:tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x5d3): more undefined references to `cudaSetupArgument' follow

obj/release/multisvm.cu.o: In function `__device_stub__Z14classifysamplePfS_S_PiS_S_iiiiiS_':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x6a7): undefined reference to `cudaLaunch'

obj/release/multisvm.cu.o: In function `__device_stub__Z15calculateoffsetPfS_PiS_S_S0_iiiiS_':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x71c): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x753): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x76b): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x783): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x79b): undefined reference to `cudaSetupArgument'

obj/release/multisvm.cu.o:tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x7b3): more undefined references to `cudaSetupArgument' follow

obj/release/multisvm.cu.o: In function `__device_stub__Z15calculateoffsetPfS_PiS_S_S0_iiiiS_':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x868): undefined reference to `cudaLaunch'

obj/release/multisvm.cu.o: In function `__device_stub__Z12updatealphasPfPiS_S_S_S0_S0_S0_S_iiiS_':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x902): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x940): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x958): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x970): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x988): undefined reference to `cudaSetupArgument'

obj/release/multisvm.cu.o:tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x9a4): more undefined references to `cudaSetupArgument' follow

obj/release/multisvm.cu.o: In function `__device_stub__Z12updatealphasPfPiS_S_S_S0_S0_S0_S_iiiS_':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0xa8c): undefined reference to `cudaLaunch'

obj/release/multisvm.cu.o: In function `__device_stub__Z12updateparamsPfS_PiS_S_S_S0_S0_S0_S_iii

iS_':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0xb30): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0xb67): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0xb7f): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0xb97): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0xbaf): undefined reference to `cudaSetupArgument'

obj/release/multisvm.cu.o:tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0xbc7): more undefined references to `cudaSetupArgument' follow

obj/release/multisvm.cu.o: In function `__device_stub__Z12updateparamsPfS_PiS_S_S_S0_S0_S0_S_iii

iS_':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0xcec): undefined reference to `cudaLaunch'

obj/release/multisvm.cu.o: In function `__device_stub__Z15calculatealphasPfS_PiS_S_S_S0_S0_S0_S_

iiiiS_':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0xd90): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0xdc7): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0xddf): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0xdf7): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0xe0f): undefined reference to `cudaSetupArgument'

obj/release/multisvm.cu.o:tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0xe27): more undefined references to `cudaSetupArgument' follow

obj/release/multisvm.cu.o: In function `__device_stub__Z15calculatealphasPfS_PiS_S_S_S0_S0_S0_S_

iiiiS_':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0xf4c): undefined reference to `cudaLaunch'

obj/release/multisvm.cu.o: In function `__device_stub__Z16obtaindualitygapPiPfS0_S0_S0_S_S_S0_S_

iiS0_':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0xfe2): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1020): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1038): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1050): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1068): undefined reference to `cudaSetupArgument'

obj/release/multisvm.cu.o:tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1084): more undefined references to `cudaSetupArgument' follow

obj/release/multisvm.cu.o: In function `__device_stub__Z16obtaindualitygapPiPfS0_S0_S0_S_S_S0_S_

iiS0_':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x114d): undefined reference to `cudaLaunch'

obj/release/multisvm.cu.o: In function `__device_stub__Z15obtainlowparamsPiPfS0_S0_S_S_S_iiS0_':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x11c8): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1201): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1219): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1231): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1249): undefined reference to `cudaSetupArgument'

obj/release/multisvm.cu.o:tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1265): more undefined references to `cudaSetupArgument' follow

obj/release/multisvm.cu.o: In function `__device_stub__Z15obtainlowparamsPiPfS0_S0_S_S_S_iiS0_':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x12f6): undefined reference to `cudaLaunch'

obj/release/multisvm.cu.o: In function `__device_stub__Z14obtainupparamsPiPfS0_S0_S_S_iiS0_':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x136c): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x13a3): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x13bb): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x13d3): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x13eb): undefined reference to `cudaSetupArgument'

obj/release/multisvm.cu.o:tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1403): more undefined references to `cudaSetupArgument' follow

obj/release/multisvm.cu.o: In function `__device_stub__Z14obtainupparamsPiPfS0_S0_S_S_iiS0_':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x147a): undefined reference to `cudaLaunch'

obj/release/multisvm.cu.o: In function `__device_stub__Z18initializetrainingPiPfS0_ii':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x14d8): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1511): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1529): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1541): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1557): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1570): undefined reference to `cudaLaunch'

obj/release/multisvm.cu.o: In function `__device_stub__Z11computegramPfS_iiif':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x15cd): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1604): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x161c): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1634): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x164c): undefined reference to `cudaSetupArgument'

obj/release/multisvm.cu.o:tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1662): more undefined references to `cudaSetupArgument' follow

obj/release/multisvm.cu.o: In function `__device_stub__Z11computegramPfS_iiif':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x167f): undefined reference to `cudaLaunch'

obj/release/multisvm.cu.o: In function `__device_stub__Z20generatebinarymatrixPiS_S_iii':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x16de): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1715): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x172d): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1745): undefined reference to `cudaSetupArgument'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x175d): undefined reference to `cudaSetupArgument'

obj/release/multisvm.cu.o:tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1775): more undefined references to `cudaSetupArgument' follow

obj/release/multisvm.cu.o: In function `__device_stub__Z20generatebinarymatrixPiS_S_iii':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1792): undefined reference to `cudaLaunch'

obj/release/multisvm.cu.o: In function `testingclassifier(float*, float*, float*, int*, int*, int*, int*, int*, float*, float*, int, int, int, int, int, float*)':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1892): undefined reference to `cudaMalloc'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x18aa): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x18d6): undefined reference to `cudaMalloc'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x18f0): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1919): undefined reference to `cudaMalloc'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1933): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x195c): undefined reference to `cudaMalloc'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1979): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x19a6): undefined reference to `cudaMalloc'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x19cf): undefined reference to `cudaMalloc'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x19eb): undefined reference to `cudaMalloc'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1a08): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1a2d): undefined reference to `cudaMalloc'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1a52): undefined reference to `cudaMalloc'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1a6f): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1af3): undefined reference to `cudaConfigureCall'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1b00): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1b74): undefined reference to `cudaConfigureCall'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1b81): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1bdb): undefined reference to `cudaConfigureCall'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1be8): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1c00): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1c05): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1c88): undefined reference to `cudaFree'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1c95): undefined reference to `cudaFree'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1ca2): undefined reference to `cudaFree'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1cac): undefined reference to `cudaFree'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1cb9): undefined reference to `cudaFree'

obj/release/multisvm.cu.o:tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1cc6): more undefined references to `cudaFree' follow

obj/release/multisvm.cu.o: In function `trainclassifier(float*, float*, int*, int*, int*, float*, int, int, int, int, int, float*, float*, float)':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1e6f): undefined reference to `cudaMalloc'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1e87): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1eb0): undefined reference to `cudaMalloc'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1ec8): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1ef5): undefined reference to `cudaMalloc'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1f0d): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1f43): undefined reference to `cudaMalloc'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1f61): undefined reference to `cudaMalloc'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1f87): undefined reference to `cudaMalloc'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1fa5): undefined reference to `cudaMalloc'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x1fee): undefined reference to `cudaMalloc'

obj/release/multisvm.cu.o:tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x201f): more undefined references to `cudaMalloc' follow

obj/release/multisvm.cu.o: In function `trainclassifier(float*, float*, int*, int*, int*, float*, int, int, int, int, int, float*, float*, float)':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x21f6): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2217): undefined reference to `cudaMalloc'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2239): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x223e): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x22ab): undefined reference to `cudaConfigureCall'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x22b8): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x22c1): undefined reference to `cudaGetLastError'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x22c8): undefined reference to `cudaGetErrorString'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2314): undefined reference to `cudaConfigureCall'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2321): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2326): undefined reference to `cudaGetLastError'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x232d): undefined reference to `cudaGetErrorString'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2361): undefined reference to `cudaMalloc'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2381): undefined reference to `cudaMalloc'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x23d9): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x23f6): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x23fb): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2438): undefined reference to `cudaConfigureCall'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2445): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x244a): undefined reference to `cudaGetLastError'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2451): undefined reference to `cudaGetErrorString'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2489): undefined reference to `cudaConfigureCall'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2496): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x24a1): undefined reference to `cudaGetLastError'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x24a8): undefined reference to `cudaGetErrorString'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x24e0): undefined reference to `cudaConfigureCall'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x24ed): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x24f2): undefined reference to `cudaGetLastError'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x24f9): undefined reference to `cudaGetErrorString'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x253b): undefined reference to `cudaConfigureCall'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2548): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x256a): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2587): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x25a4): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x25c1): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x25e3): undefined reference to `cudaMemcpy'

obj/release/multisvm.cu.o:tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2605): more undefined references to `cudaMemcpy' follow

obj/release/multisvm.cu.o: In function `trainclassifier(float*, float*, int*, int*, int*, float*, int, int, int, int, int, float*, float*, float)':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x260a): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2745): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2767): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2789): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x27ab): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x27b0): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2835): undefined reference to `cudaConfigureCall'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2842): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x285f): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2864): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x288d): undefined reference to `cudaConfigureCall'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x289a): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x28c3): undefined reference to `cudaConfigureCall'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x28d0): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x28f9): undefined reference to `cudaConfigureCall'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2906): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x292f): undefined reference to `cudaConfigureCall'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x293c): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2965): undefined reference to `cudaConfigureCall'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2972): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x298f): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x29ac): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x29c9): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x29eb): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2a0d): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2a12): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2a3b): undefined reference to `cudaConfigureCall'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2a48): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2a6a): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2a6f): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2ba8): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2bca): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2bec): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2c0e): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2c30): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2c35): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2cdd): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x2ce2): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x30e0): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x3102): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x3124): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x3146): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x3168): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x316d): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x318a): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x318f): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x31c9): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x31e5): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x31ea): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x320d): undefined reference to `cudaFree'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x321a): undefined reference to `cudaFree'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x3227): undefined reference to `cudaFree'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x3234): undefined reference to `cudaFree'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x3241): undefined reference to `cudaFree'

obj/release/multisvm.cu.o:tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x324e): more undefined references to `cudaFree' follow

obj/release/multisvm.cu.o: In function `loadgram(float*, float*, int, int, int, float)':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x35a4): undefined reference to `cudaMalloc'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x35b9): undefined reference to `cudaMemcpy'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x35be): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x361b): undefined reference to `cudaConfigureCall'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x3640): undefined reference to `cudaThreadSynchronize'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x3645): undefined reference to `cudaGetLastError'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x364c): undefined reference to `cudaGetErrorString'

obj/release/multisvm.cu.o: In function `main':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x3a76): undefined reference to `cudaGetDeviceCount'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x3ae7): undefined reference to `cudaGetDeviceProperties'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x3b70): undefined reference to `cudaSetDevice'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x3dea): undefined reference to `cudaMallocPitch'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x3df7): undefined reference to `cudaFree'

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x3e88): undefined reference to `cudaMalloc'

obj/release/multisvm.cu.o: In function `__cudaUnregisterBinaryUtil':

tmpxft_00000fb0_00000000-11_multisvm.ii:(.text+0x17a8): undefined reference to `__cudaUnregisterFatBinary'

collect2: ld returned 1 exit status

make: *** [../../bin/linux/release/multisvm] Error 1

Can anybody help me?

looks like it’s not linking cudart, so add a -lcudart in there

Thanks. that was the problem

If you are using the common.mk file provided in the NVIDIA SDK samples and add USEDRVAPI := 1 to the makefile, this flag will use -lcuda but not -lcudart.

A simple modification of the common.mk file solves the problem.

Thanks everybody