Jump to content
The Dark Mod Forums

TDM running on the Raspberry Pi 3 and 4


charlestevens70

Recommended Posts

Cheers!

I've been wondering for some time now if it would be possible to compile the source code of TDM to the Raspberry Pi, especially the models 3 and 4.

I've seen some videos online of people running Doom3 on it, so how hard would it be to compile the source of TDM for the raspberry pi? Would it need a major rewrite of some parts of the code?

I've been "tinkering" with the source for some days, and as I was expecting, all the configuration files are made for x86 architectures (Linux and Windows). I've been searching online for some info about the toolchains needed to even start compiling the source for these arm machines, but the information has been quite lackluster and outdated. I've managed to track down a toolchain to compile c++ code for the raspberry pi, made by the pi foundation but I'm not quite sure how to use it and I guess the support for it has been dropped for quite some time now.

Anyway, I figured that instead of wasting more of my time, it would be best to ask here what you guys think.

Is it possible to even think about this, or does TDM use some kind of libraries or other external code which makes it impossible to compile for the pi? Is there anything related to the game that makes almost impossible or too much of a hassle to try to port the game for the raspberry pi? Performance isn't an issue for me. I just want to know if it can be run in that machine.

If it is possible to do this without a major code rewrite of the game, where should I start? I have no experience on compiling anything for arm, only some experience in x86, so this might be a fool's errand, but I would like to give it a try nonetheless.

If it is possible to do this and if some of you could help me in any way, that would be appreciated. On the other hand, if you think this is a really hard thing to even try to do, please feel free to tell me so I don't waste more of my time.

Thanks in advance

 

  • Like 1
Link to comment
Share on other sites

As I understand it from a few searches, the raspberry pi architecture only supports Opengl 2.1 and doesn't work with stock Doom 3.  The Dhewm port of the D3 source uses Vulkan which is apparently supported on Pi 4.  

Dark Mod is now running on Opengl 3.1 if I recall and I doubt there are any plans to abandon that for Vulkan.  

Someone with a better working knowledge may prove me wrong on all of that but that's my understanding.

  • Like 1
Link to comment
Share on other sites

  • 5 months later...

I'm interested in building TDM for khadas vim3.  The new open-source panfrost drivers support up to opengl 3.1, so TDM could be in-scope for mali g52 and g72 GPUs.

Beyond the -sse2 in CMakeLists.txt there is code requiring intel's SIMD instructions

idlib/sys/sys_defines.h

renderer/tr_light.cpp

I haven't looked further.  These would need to be modified to use arm NEON or plain old c++.

It can be done - I have doom3 running on aarch64.  I'm not qualified to do it though.

Cheers

Link to comment
Share on other sites

36 minutes ago, clort said:

I'm interested in building TDM for khadas vim3.  The new open-source panfrost drivers support up to opengl 3.1, so TDM could be in-scope for mali g52 and g72 GPUs.

TDM 2.09 requires OpenGL 3.3.

Quote

 

Beyond the -sse2 in CMakeLists.txt there is code requiring intel's SIMD instructions
idlib/sys/sys_defines.h
renderer/tr_light.cpp
I haven't looked further.  These would need to be modified to use arm NEON or plain old c++.

 

I built TDM for Elbrus, so the architecture by itself should not be a problem.
But Elbrus compiler supported SSE intrinsics.

I have a plan to clean this mess in 4550. Did not get to it yet.
The plan was to ensure that all intrinsics are disabled if __SSE__ and __SSE2__ are not defined. It should be enough to make TDM compile on various architectures, as long as they have good GPU support and normal Linux OS.

 

To be honest, the fact that this vim3 uses Android instead of standard Linux will be the critical problem. If it won't work on X windows, then someone will have to rewrite quite a bunch of OS-specific code to make TDM run.

  • Like 1
Link to comment
Share on other sites

1 hour ago, stgatilov said:

"TDM 2.09 requires OpenGL 3.3"

Ok after a good cry, I've recovered. 😕  Will look at older revs.

Quote

"To be honest, the fact that this vim3 uses Android instead of standard Linux will be the critical problem. If it won't work on X windows, then someone will have to rewrite quite a bunch of OS-specific code to make TDM run."

Good news here!  It runs bog standard linux too!  Currently running devuan beowulf on it.

Building now with sse2neon.h headers and it looks like it might work.

https://github.com/DLTcollab/sse2neon

It's a bit more involved.  The Simd.cpp wants AVX stuff, which might be supplyable with:

https://github.com/kunpengcompute/AvxToNeon

Which does build on my box and passes tests

AVX2NEONTest Complete: Passed 335 tests : Failed 0

--------------------

Since we won't be getting opengl 3.3 soon (all that gl 4 compute stuff would need backporting), I'll look at the last TDM that uses opengl 3.1. 

Can anyone suggest a mission with low amount of geometry in the assets?  I'd be wanting around 130k triangles or lower.

 

Cheers!

Edited by clort
typo
Link to comment
Share on other sites

  • 1 month later...

I have covered all the x86-specific trash in proper ifdefs (see 4550).
Even managed to cross-compile TDM for 64-bit ARM (stopped at linking phase).

Note however that:

  1. Recent trunk requires OpenGL 3.3 (perhaps revert required version to 3.1 and check what stops working after that).
  2. In order to link TDM, you have to build all third-party libs for your platform via conan --- that could be hard.

 

  • Like 2
Link to comment
Share on other sites

  • 1 year later...

I was able to install, launch, and watch the opening videos of TDM 2.10 on a Pi 4b via Box86 by setting the environment variable MESA_GL_VERSION_OVERRIDE=3.3 first. However, it froze after a frame or two of gameplay. I haven't tried to debug that yet. Note that TDM 2.08 and earlier use GL3.1+extensions (but still probably require 3.3-compliant hardware unless you're up for some hacking) and 1.08 and earlier are judt Doom 3 mods (but incompatible with Dhewm3).

Link to comment
Share on other sites

  • 1 year later...

Now that Mesa 23.3.4 supports OpenGL 3.1 on V3D, the pre-built x64 version of TDM works great with Box64. I still had to set MESA_GL_VERSION_OVERRIDE=3.3. Frame rate was quite playable on RPI5, although I bet it would chug on RPI4.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...