Compiling Panda3D with CUDA Development Drivers and Ubuntu

Return to Compiling or Editing the Panda Source

Compiling Panda3D with CUDA Development Drivers and Ubuntu

Postby gammell » Thu May 05, 2011 12:54 pm

Hi,
I'm running 64-bit Ubuntu 10.04 LTS with the NVIDIA development drivers installed. I want to use a multithreaded version of Panda3D, so I'm compiling from source using the makepanda.py script. My compile command is:
Code: Select all
./makepanda/makepanda.py --verbose --override "SIMPLE_THREADS=UNDEF" --installer --everything


The compilation fails while building mesadisplay_composite:

Code: Select all
[ 46%] Building C++ object built/tmp/mesadisplay_composite.o
g++ -ftemplate-depth-30 -fPIC -c -o built/tmp/mesadisplay_composite.o -I/usr/include/python2.6 -Ibuilt/tmp -Ibuilt/include -DMAKEPANDA= -Ipanda/src/mesadisplay -Ipanda/src/glstuff -pthread -O2 -DBUILDING_PANDAMESA panda/src/mesadisplay/mesadisplay_composite.cxx
In file included from panda/src/mesadisplay/mesagsg.h:75,
                 from panda/src/mesadisplay/osMesaGraphicsPipe.h:21,
                 from panda/src/mesadisplay/osMesaGraphicsBuffer.h:20,
                 from panda/src/mesadisplay/config_mesadisplay.cxx:16,
                 from panda/src/mesadisplay/mesadisplay_composite1.cxx:1,
                 from panda/src/mesadisplay/mesadisplay_composite.cxx:1:
/usr/include/GL/osmesa.h:119: error: ‘GLAPI’ does not name a type
/usr/include/GL/osmesa.h:132: error: ‘GLAPI’ does not name a type
/usr/include/GL/osmesa.h:142: error: expected constructor, destructor, or type conversion before ‘void’
/usr/include/GL/osmesa.h:174: error: ‘GLAPI’ does not name a type
/usr/include/GL/osmesa.h:184: error: ‘GLAPI’ does not name a type
/usr/include/GL/osmesa.h:202: error: expected constructor, destructor, or type conversion before ‘void’
/usr/include/GL/osmesa.h:218: error: expected constructor, destructor, or type conversion before ‘void’
/usr/include/GL/osmesa.h:233: error: ‘GLAPI’ does not name a type
/usr/include/GL/osmesa.h:249: error: ‘GLAPI’ does not name a type
/usr/include/GL/osmesa.h:266: error: ‘GLAPI’ does not name a type
/usr/include/GL/osmesa.h:275: error: expected constructor, destructor, or type conversion before ‘void’
In file included from panda/src/mesadisplay/mesadisplay_composite1.cxx:2,
                 from panda/src/mesadisplay/mesadisplay_composite.cxx:1:
panda/src/mesadisplay/osMesaGraphicsBuffer.cxx: In member function ‘virtual bool OsMesaGraphicsBuffer::begin_frame(GraphicsOutput::FrameMode, Thread*)’:
panda/src/mesadisplay/osMesaGraphicsBuffer.cxx:69: error: ‘OSMesaMakeCurrent’ was not declared in this scope
In file included from panda/src/mesadisplay/mesadisplay_composite1.cxx:4,
                 from panda/src/mesadisplay/mesadisplay_composite.cxx:1:
panda/src/mesadisplay/osMesaGraphicsStateGuardian.cxx: In constructor ‘OSMesaGraphicsStateGuardian::OSMesaGraphicsStateGuardian(GraphicsEngine*, GraphicsPipe*, OSMesaGraphicsStateGuardian*)’:
panda/src/mesadisplay/osMesaGraphicsStateGuardian.cxx:35: error: ‘OSMesaCreateContext’ was not declared in this scope
panda/src/mesadisplay/osMesaGraphicsStateGuardian.cxx: In destructor ‘virtual OSMesaGraphicsStateGuardian::~OSMesaGraphicsStateGuardian()’:
panda/src/mesadisplay/osMesaGraphicsStateGuardian.cxx:49: error: ‘OSMesaDestroyContext’ was not declared in this scope
panda/src/mesadisplay/osMesaGraphicsStateGuardian.cxx: In member function ‘virtual void* OSMesaGraphicsStateGuardian::do_get_extension_func(const char*, const char*)’:
panda/src/mesadisplay/osMesaGraphicsStateGuardian.cxx:75: error: ‘OSMesaGetProcAddress’ was not declared in this scope
Process exited with exit status 1 and signal code 0


I have tried the compilation with the regular NVIDIA drivers installed, and it worked fine. I have also tried the .deb with the development drivers, it did not work.

Doing some investigating; GLAPI is normally defined in /usr/include/GL/gl.h which is included by /usr/include/GL/osmesa.h. The problem seems to relate to the fact that installing the CUDA drivers provides a new gl.h which undefines GLAPI at the end of the file. I have tried adding the "--no-osmesa" flag to the make command, but it made no difference.

Does anyone have any recommendations on where to go next? Has anyone successfully compiled Panda3D with CUDA drivers?

Thanks,
Jon
gammell
 
Posts: 4
Joined: Thu May 05, 2011 10:24 am

Postby rdb » Thu May 12, 2011 3:37 am

Sorry for the late reply, I forgot about this thread.

You should probably just compile without mesa support. You don't need it, it's a software renderer that nobody uses anymore (now that we have a tinydisplay renderer).
rdb
 
Posts: 8549
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby gammell » Thu May 12, 2011 8:38 am

rdb,
No worries, better late than never.

I've tried compiling it without os-mesa
Code: Select all
./makepanda/makepanda.py --verbose --override "SIMPLE_THREADS=UNDEF" --no-osmesa --installer --everything
but it still tries to compile mesadisplay_composite. That was the only directly mesa flag I can see for the installation script, but I also tried it with all the flags that seemed GL-related to my untrained eye.
Code: Select all
./makepanda/makepanda.py --verbose --override "SIMPLE_THREADS=UNDEF" --no-osmesa --no-gl --no-gles --no-gles2 --no-egl --installer --everything
and it still didn't work.

Would anyone know where I could find documentation on the various build flags? Or maybe recommend some other ones I should try using?

Thanks again,
Jon
gammell
 
Posts: 4
Joined: Thu May 05, 2011 10:24 am

Postby rdb » Thu May 12, 2011 9:39 am

You're having --everything as last option, which overrides all of the --no options before that.

Having --everything --no-osmesa should make it compile.
rdb
 
Posts: 8549
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby gammell » Thu May 12, 2011 10:07 am

Thanks rdb, that did the trick.
gammell
 
Posts: 4
Joined: Thu May 05, 2011 10:24 am

Postby gammell » Thu May 12, 2011 2:39 pm

Actually it worked for a while, but when I tried it again to verify that I no longer needed some of the mesa-dev packages, it broke. I've put all the packages I took out back in and I still get:
Code: Select all
ld: cannot find -lGL


Edit:
I was able to fix this by manually relinking libGL.so. I guess removing the Mesa packages broke them. For anyone else who has this problem, make sure that:
Code: Select all
ls -lah /usr/lib/libGL.so
ls -lah /usr/lib32/libGL.so
ls -lah /usr/lib64/libGL.so
all point to a valid library. On my machine, 2/3 pointed to ./libGL.so.1 and the 3rd pointed to mesa/libGL.so (which was no longer valid). I just replaced the broken link with a link to ./libGL.so.1 and it worked.
gammell
 
Posts: 4
Joined: Thu May 05, 2011 10:24 am


Return to Compiling or Editing the Panda Source

Who is online

Users browsing this forum: No registered users and 0 guests