cuMemGetInfo undefined refenece ?????

this is the error i get

bibrak@biebo-laptop:~/NVIDIA_CUDA_SDK/projects/multiown$ make
obj/release/multiguide.cu.o: In function matmul(Matrix, Matrix, Matrix)': tmpxft_00002098_00000000-11_multiguide.ii:(.text+0x3b2): undefined reference to cuMemGetInfo’
collect2: ld returned 1 exit status
make: *** […/…/bin/linux/release/multi] Error 1

when i use cuMemGetInfo function

i have ubuntu 9.04 card is 9200M

please tell me the library or the solution to this problem

It would be helpful if you provided the content of your make file and the relevant calling code.

add -lcuda

but how to add

:">

Could you post content of file “Makefile” which is located at :~/NVIDIA_CUDA_SDK/projects/multiown/

############################################################
####################

Copyright 1993-2006 NVIDIA Corporation. All rights reserved.

NOTICE TO USER:

This source code is subject to NVIDIA ownership rights under U.S. and

international Copyright laws.

NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE

CODE FOR ANY PURPOSE. IT IS PROVIDED “AS IS” WITHOUT EXPRESS OR

IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH

REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF

MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.

IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,

OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS

OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE

OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE

OR PERFORMANCE OF THIS SOURCE CODE.

U.S. Government End Users. This source code is a “commercial item” as

that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of

“commercial computer software” and "commercial computer software

documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)

and is provided to the U.S. Government only as a commercial end item.

Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through

227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the

source code with only those rights set forth herein.

############################################################
####################

Build script for project

############################################################
####################

Add source files here

EXECUTABLE := multi

CUDA source files (compiled with cudacc)

CUFILES := multiguide.cu

CUDA dependency files

CU_DEPS :=
multiguidekernel.cu \

C/C++ source files (compiled with gcc / c++)

#CCFILES := \

template_gold.cpp \

############################################################
####################

Rules and targets

include …/…/common/common.mk

ok, in order to simplify Makefile,

I suggest that you can edit a Makefile as

[codebox]SDK_ROOT = /usr/local/NVIDIA_CUDA_SDK

CUDA_LIB_PATH = /usr/local/cuda/lib

INLCUDE = -I$(SDK_ROOT)/common/inc -I/usr/local/cuda/include

LIBS = -L$(SDK_ROOT)/lib -lcutil

LIBS += -L$(CUDA_LIB_PATH) -lcudart -lcuda

SRC_CU = test.cu

SRC_CXX =

all:

nvcc -run $(INLCUDE) $(LIBS) $(SRC_CU)  $(SRC_CXX)[/codebox]

(remember that you must insert a “tab” key before “nvcc -run …” )

and then type command “make”

Remark: I suppose that you use sdk 2.2, please check root directory of SDK, sometimes you may install SDK

under home directory , then you need to change definition of SDK_ROOT.

Just observe device memory usage.

thanks that worked … :)

but there is a strange output when I query the memory.

– before running kernel
total mem: 128.405 MB, free: 128.293 MB, used : 0.113 MB
total mem: 128.405 MB, free: 128.293 MB, used : 0.113 MB
– after running kernel
total mem: 255.312 MB, free: 133.688 MB, used : 121.625 MB
error is no error
Processing time: 7073.609863 (ms)
total mem: 255.312 MB, free: 145.688 MB, used : 109.625 MB
total mem: 255.312 MB, free: 145.688 MB, used : 109.625 MB
– end

why there is change in the total memory before and after the kernel launches.

by the way my device query --------

There is 1 device supporting CUDA

Device 0: “GeForce 9200M GE”
CUDA Capability Major revision number: 1
CUDA Capability Minor revision number: 1
Total amount of global memory: 267714560 bytes
Number of multiprocessors: 1
Number of cores: 8
Total amount of constant memory: 65536 bytes
Total amount of shared memory per block: 16384 bytes
Total number of registers available per block: 8192
Warp size: 32
Maximum number of threads per block: 512
Maximum sizes of each dimension of a block: 512 x 512 x 64
Maximum sizes of each dimension of a grid: 65535 x 65535 x 1
Maximum memory pitch: 262144 bytes
Texture alignment: 256 bytes
Clock rate: 1.30 GHz
Concurrent copy and execution: No
Run time limit on kernels: Yes
Integrated: Yes
Support host page-locked memory mapping: Yes
Compute mode: Default (multiple host threads can use this device simultaneously)

Test PASSED

I don’t believe those mobile and integrated parts have dedicated video memory, they share host memory via their integrated memory controller. My guess is that you are seeing the gpu using “just in time” memory reservation, ie. it can use up to 256Mb, but it might use less if there isn’t a demand for it.