build failure on 32bit machine

3 views
Skip to first unread message

Oroppas

unread,
Mar 1, 2010, 11:17:07 PM3/1/10
to ADSM Users
Hi,

I got the following error when I tried to build adsm:

In file included from ../../../../adsm/libgmac/src/memory/manager/
BatchManager.h:37,
from ../../../../adsm/libgmac/src/memory/manager/
BatchManager.cpp:1:
/home/ryuta/devel/adsm/src/adsm-build/../adsm/libgmac/src/memory/
manager/../Manager.h:66: error: integer constant is too large for
‘long’ type
/home/ryuta/devel/adsm/src/adsm-build/../adsm/libgmac/src/memory/
manager/../Manager.h:66: error: large integer implicitly truncated to
unsigned type
make[5]: *** [BatchManager.lo] Error 1

65: #ifdef USE_MMAP
66: static const size_t mmSize = 0x100000000;
67: #endif


Regards,
-Ryuta

Isaac Gelado

unread,
Mar 2, 2010, 5:16:03 AM3/2/10
to adsm-...@googlegroups.com
Dear Ryuta,
ouch! We haven't compiled GMAC for 32bit machines in a while.

This compile error is quite complex, because GMAC (in 64bit machines)
maps GPU memory in regions above 4GB. I can think of a quick fix to
get it working on 32-bit machines, but it will take some hours to
upload a new version and will only work for single-GPU systems. Are
you going to use more than one GPU?

A really quick workaround is to compile GMAC without the mmap flag
(../gmac/configure --enable-cuda-driver). When the --enable-mmap is
not used, the GPU code can not use the same pointers than the CPU
code, so you will need to use gmacPtr() in your CPU code whenever you
pass a pointer to a kernel call. For instance:

matMul<<<Dg, Db>>>(gmacPtr(C), gmacPtr(A), gmacPtr(B), W, H);

All other GMAC functionalities will work as described in the
documentation (automatic data transfers, single pointers in the CPU
code, etc).

I will get back to you as soon as I have GMAC with the --enable-mmap
flag compiling and working on 32-bit machines.

Cheers,
Isaac

--
Isaac Gelado

'As gold which he cannot spend will make no man rich
so knowledge which he cannot apply will make no man wise'

Oroppas

unread,
Mar 2, 2010, 6:37:27 AM3/2/10
to ADSM Users
Hi Isaac,

Oh, I thought it would be straightforward to fix it.
Obviously I'm ignorant...

Luckily, my machine has only one GPU :)
I follow your instruction for workaround and I
will re-enable mmap once the fix gets committed.

Thank you,
-Ryuta

Isaac Gelado

unread,
Mar 4, 2010, 3:00:10 PM3/4/10
to adsm-...@googlegroups.com
Dear Ryuta,
I've just uploaded a new release of GMAC. This version should compile
cleanly on 32-bit machines.

However, when using mmap() on 32-bit machines, the allocation might
silently fail and programs will not work. In our Mac OS X test
machine, for instance, the allocation of memory at the GPU was
overwriting the code segment, so the program was producing many
exceptions, which GMAC tries to handle (but is not able to do so), so
a new exception was being triggered, an so on; the result: a infinite
loop. Being aware of this behavior on 32-bit machines is quite
important ;-). If you want your programs to never fail, keep using the
gmacPtr() approach, so everything will run smoothly.

Cheers,
Isaac

Oroppas

unread,
Mar 4, 2010, 6:45:25 PM3/4/10
to ADSM Users
Hi Isaac,

Thanks for the fix!

I'll check out the update and give it a shot.
I let you know if I have the same mmap issue on my machine.

Regards,
-Ryuta

Reply all
Reply to author
Forward
0 new messages