06.11.2025 • DevOps

C3D Geometric Kernel: Support for More Hardware Platforms

Anna Ladilova, Ph.D. (Phys&Math), Head of DevOps, C3D Labs, talks about the many hardware platforms supported by the C3D kernel.

When C3D Labs was founded in 2012, C3D geometric kernel supported only x86 and x64 CPU architectures. It was expected: we focused on the classic hardware architectures most popular at the time. However, over time, we have significantly expanded the range of architectures we support. One example is the adaptation of our kernel to the ARM architecture, which includes a version for the Baikal platform.

C3D Geometric Kernel: Support for More Hardware Platforms, photo 1
Fig. 1. Retrospective

Providing support for Baikal did not require enormous efforts. As part of the ARM architecture stack expansion initiative, we successfully mastered the new platform and completed the first order. However, it was also the last. We have built kernel versions for various ARM-enabled operating systems like macOS and Android.

C3D Geometric Kernel: Support for More Hardware Platforms, photo 2
Fig. 2. e2k architecture kernel diagram

The case of the Elbrus architecture turned out to be much more complicated. We received a request for it in 2022. The architecture happened to be rather unconventional and unparalleled, partly because it uses special CPU instructions and a dedicated LCC compiler. We worked with the Elbrus Linux operating system and had to change the kernel code for compatibility. There were issues with OpenMP support, which we successfully overcame. However, we failed to achieve a performance comparable to that of the classic architectures.

We completed the project, built the kernel, tested it, and confirmed it to be operational. However, again, it was the first and the last order, so further work with the Elbrus architecture was suspended. From time to time, we check compilability and stability to make sure the kernel still works right.

Until last year, we had no tasks related to the Elbrus platform. Then, the situation changed: we received several requests with very stringent requirements: they wanted not just a library, but a library with C# wrappers. This was a real challenge.

While we could compile the kernel for the Elbrus environment without any major problems, the integration with C# required many additional steps. First, we developed Cwrapper, an intermediate layer in C. Then, using it and the third-party CPPSharp library, we built a C# wrapper. Besides compiling our components, we had to adapt the CPPSharp library for Elbrus (Fig. 1). The main approach was cross-compilation: compiling the code on x86_64 hardware with the target system set to e2k.

We completed the project despite a number of issues. One of them was the incompatibility of the LCC compiler versions. Our library was compiled in version 1.25, while the customers were using 1.27, and the application crashed in 1.27. An update fixed the problem, but that very fact itself raised questions. There were also doubts about the support for the C++17 standard. The LCC 1.27 compiler approximately meets GCC 9 and only guarantees support for C++14. Still, all our code happened to be compatible. The kernel passed the tests, the customer was satisfied, but we realized that there are still unresolved performance issues.

In 2024, we got a new request to support the Loongson CPUs. A machine with LoongArch architecture ran Alt Linux. There were no particular problems: Clang ver. 18 and above supports this platform, and the cross-compilation was successful. The project is not yet complete, but overall, everything is fine. We do not see any fundamental obstacles at this point.

We started by making Elbrus builds on request. We tested that everything worked fine, and postponed this until next time. Now we see that support for this architecture should be ongoing. Ad hoc builds no longer meet the new requirements. As a result, we are upgrading our CI workflow: it will include builds for Elbrus and Loongson. We will regularly offer these builds to our customers.

Anna Ladilova, Head of DevOps, Ph.D. (Phys&Math), C3D Labs
Anna Ladilova,
Head of DevOps, Ph.D. (Phys&Math),
C3D Labs
Share
Up