CPU architecture and container compatibility
When building a URCap with a container contribution with npm run build
, it defaults to produce an AMD64
image. This is compatible with the robots. While a robot can only execute AMD64 images, it is another story when running in a
simulator, where it depends of the type of CPU that it runs on. Some systems like a newer Apple Mac with ARM CPU’s - which have Rosetta (dynamic
binary translator) enabled, can run both ARM64 and AMD64 images.
The following table, shows the general rules, of building and running images:
AMD64 CPU (robot) |
ARM64 CPU arm64 (Rosetta enabled) |
ARM64 CPU (Rosetta disabled) |
|
---|---|---|---|
AMD64 Image |
yes |
Depends |
No |
ARM64 Image |
no |
Depends |
yes |
In some cases, an image build to AMD64, will not work properly or run slowly in the simulator (due to the translations performed by
Rosetta) on an ARM architecture CPU. To build specifically for the ARM, the following build command can be used:
npm run build-arm
As noted above the URCap that contains this image will not run on the robot.
To sum up this issue:
Always use only AMD64 images on the Robots.
Start with using AMD64 in simulators, and if some problems occur, test an ARM64 variant in that simulator.