PDA

View Full Version : allocating memory in quadro FX 1000 cards


sukhendu
10-26-04, 02:47 AM
Hi,

I have NVDIA Quadro FX 1000 graphics card installed in my machine (with red hat linux (version 2.4.20-8). I wanted to use the AGP or the Video Memory to expedite my rendering. So, I called the glXAllocateMemoryNV function after including the header files glx.h and gl.h (which have these function definitions).

The program compiled perfectly but would not allocate memory (returned a null pointer).

The call which i made was:


if(glXAllocateMemory(sizeof(int),0.1,0.1,0.75)==NU LL)
{
cout<<"no memory allocated!!";
}

This would always go inside the if statement.


I am attaching the driver information of the card (all the files in /proc/driver/nvidia directory)

version:

NVRM version: NVIDIA Linux x86 nvidia.o Kernel Module 1.0-4363 Sat Apr 19 17:46:46 PDT 2003
GCC version: gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)


cards/0:

Model: Quadro FX 1000
IRQ: 11
Video BIOS: 04.30.20.16.05
Card Type: AGP

agp/card:

Fast Writes: Supported
SBA: Supported
AGP Rates: 8x 4x
Registers: 0x1f000e1b:0x1f004102

agp/host bridge:

Host Bridge: PCI device 8086:2578 (Intel Corp.)
Fast Writes: Supported
SBA: Supported
AGP Rates: 8x 4x
Registers: 0x1f004a1b:0x00000902

agp/status:

Status: Enabled
Driver: NVIDIA
AGP Rate: 8x
Fast Writes: Disabled
SBA: Disabled

The version of drivers intstalled has kernel module1.0-4363

Please help,

Thanks,

Sukhendu

myshkinbob
10-28-04, 10:43 PM
I don't know if this'll help, i'm a fairly inexperienced c++ programmer, but isn't your if statement evaluating the return of a void function? What i mean is generally functions that write a value to memory return 0, which is NULL, they're usually void functions. So evaluating the return of an allocation function in an if ==NULL statement will always evaluate true, cout'ing your error warning inside it.

You should check the definition of glXAllocateMemory in the nvidia glx headers to see what it's return value is.

Edit: did a quick reboot and checked out glx.h from the 61.11 drivers i have, the function you're evaluating is indeed type void, no return value, here's the header snippet:


/*
* NV_vertex_array_range
*/
extern void *glXAllocateMemoryNV(GLsizei size, GLfloat readfreq,
GLfloat writefreq, GLfloat priority);

extern void glXFreeMemoryNV(GLvoid *pointer);

sukhendu
10-31-04, 02:06 PM
thanks a lot!!

It was the problem....