Apache Jena CLI tools setup Updated +Created
The CLI tools don't appear to be packaged for Ubuntu 23.10? Annoying... There is a package libapache-jena-java but it doesn't contain any binaries, only Java library files.
To run the CLI tools easily we can download the prebuilt:
sudo apt install openjdk-22-jre
wget https://dlcdn.apache.org/jena/binaries/apache-jena-4.10.0.zip
unzip apache-jena-4.10.0.zip
cd apache-jena-4.10.0
export JENA_HOME="$(pwd)"
export PATH="$PATH:$(pwd)/bin"
and we can confirm it works with:
sparql -version
which outputs:
Apache Jena version 4.10.0
If your Java is too old then then running sparql with the prebuilts fails with:
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: arq/sparql has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:621)
Build from source is likely something like:
sudo apt install maven openjdk-22-jdk
git clone https://github.com/apache/jena --branch jena-4.10.0 --depth 1
cd jena
mvn clean install
TODO test it.
If you make the mistake of trying to run the source tree without build:
git clone https://github.com/apache/jena --branch jena-4.10.0 --depth 1
cd jena
export JENA_HOME="$(pwd)"
export PATH="$PATH:$(pwd)/apache-jena/bin"
it fails with:
Error: Could not find or load main class arq.sparql
as per: users.jena.apache.narkive.com/T5TaEszT/sparql-tutorial-querying-datasets-error-unrecognized-option-graph
Bitcoin Core snap Updated +Created
Officially supported installation method on Ubuntu 23.10.
btcdeb Updated +Created
Tested on Ubuntu 23.10:
sudo apt install libtool
git clone https://github.com/bitcoin-core/btcdeb
cd btcdeb
git checkout 4fd007e57b79cba9b5ffdf5ffe599778c0d63b88
./autogen.sh
./configure
make -j
Patch submited at: github.com/bitcoin-core/btcdeb/pull/143
Then we use it;
./btcdeb '[OP_1 OP_2 OP_ADD]'
and inside the shell:
btcdeb 5.0.24 -- type `./btcdeb -h` for start up options
LOG: signing segwit taproot
notice: btcdeb has gotten quieter; use --verbose if necessary (this message is temporary)
3 op script loaded. type `help` for usage information
script  |  stack 
--------+--------
1       | 
2       | 
OP_ADD  | 
#0000 1
btcdeb> step
                <> PUSH stack 01
script  |  stack 
--------+--------
2       |      01
OP_ADD  | 
#0001 2
btcdeb> step
                <> PUSH stack 02
script  |  stack 
--------+--------
OP_ADD  |      02
        |      01
#0002 OP_ADD
btcdeb> step
                <> POP  stack
                <> POP  stack
                <> PUSH stack 03
script  |  stack 
--------+--------
        |      03
btcdeb> step
script  |  stack 
--------+--------
        |      03
btcdeb> step
at end of script
btcdeb>
Lenovo ThinkPad P14s gen4 amd Updated +Created
Bought: November 2023 during Black Friday sale for £1,323.00 to be Ciro Santilli's main personal laptop.
Six years after, and we are 2x on every key spec (except processor Hz ;-) at about 1/2 the price and 1/2 the weight (though smaller 14" screen for greater portability), so not bad! Customized to max out each hardware spec:
Specs:
  • Processor: AMD Ryzen™ 7 PRO 7840U Processor (3.30 GHz up to 5.10 GHz)
  • Operating System: No Operating Systemselected upgrade
  • Operating System Language: No Operating System Languageselected upgrade
  • Microsoft Productivity Software: None
  • Memory: 64 GB LPDDR5X-6400MHz (Soldered)selected upgrade. Specs at: www.lenovo.com/gb/en/p/accessories-and-software/memory-and-storage/memory-and-storage-hard-drives/4xb1d04758 quotes "64 Gbps", i.e. 8 GB/s. dd count=1M if=/dev/zero of=tmp gives only 255 MB/s however.
  • Solid State Drive: 2 TB SSD M.2 2280 PCIe Gen4 Performance TLC Opalselected upgrade
  • Display: 14" WUXGA (1920 x 1200), IPS, Anti-Glare, Touch, 45%NTSC, 300 nits, 60Hz
  • Graphic Card: Integrated Graphics
    The Ubuntu 23.10 "About system GUI describes its graphics as: Radeon 780M Graphics × 16, which e.g. www.techpowerup.com/gpu-specs/radeon-780m.c4020 documents as running the RDNA 3 microarchitecture.
  • Camera: 1080P FHD RGB/IR Hybrid with Microphone
  • Color: Thunder Black
  • Factory Color Calibration: No Factory Color Calibration
  • Wireless: Qualcomm Wi-Fi 6E NFA725A 2x2 AX & Bluetooth® 5.1 or above
  • Integrated Mobile Broadband: No Wireless WAN
  • Ethernet: Wired Ethernet
  • Near Field Communication: No NFC
  • Fingerprint Reader: Fingerprint Reader
  • Keyboard: Black - English (EU)selected upgrade
  • Battery: 4 Cell Li-Polymer 52.5Whselected upgrade
  • Power Cord: 65W USB-C Slim 90% PCC 3pin AC Adapter - UKselected upgrade
  • Electronic Privacy Filter: No ePrivacy Filter
  • Adobe Elements: None
  • Adobe Acrobat: None
  • Adobe Creative Cloud: None
  • Security Software: None
  • Cloud Security Software: No Cloud Security Software
  • Warranty: 3 Year Courier or Carry-in
Identifiers:
Upon arrival:
  • Weight: 1490 g
  • Charger weight: 323 g
  • Firmware according to sudo dmidecode -t bios:
    Vendor: LENOVO
    Version: R2FET33W (1.13 )
    Release Date: 09/08/2023
Buy research:
Log:
2024-01-17: firmware update:
Vendor: LENOVO
Version: R2FET36W (1.16 )
Release Date: 10/24/2023
Actually fixed performance mode: askubuntu.com/questions/604720/setting-to-high-performance/1343879#1343879
P14s benchmark Updated +Created
glmark2 -b build:duration=3:model=horse
~22K
P51 benchmark Updated +Created
glmark2 -b build:duration=3:model=horse
~4.8K
Monero 0.18.3.1 hashrate: 2.6 KH/s
Connect two computers directly without a router with an Ethernet cable Updated +Created
For IP-level communication, askubuntu.com/questions/22835/how-to-network-two-ubuntu-computers-using-ethernet-without-a-router/116680#116680 just worked between P51 and P14s both on Ubuntu 23.10 connected with a regular Cat 5e cable.
On both machines, first we found the Ethernet cable interface name with the ip CLI tool:
ip a
which outputs on the P41s:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp1s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether fc:5c:ee:24:fb:b4 brd ff:ff:ff:ff:ff:ff
3: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 04:7b:cb:cc:1b:10 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.123/24 brd 192.168.1.255 scope global dynamic noprefixroute wlp2s0
       valid_lft 61284sec preferred_lft 61284sec
    inet6 fe80::3597:15d8:74ff:e112/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
so the interface was enp1s0f0, because wlp is wireless and lo is localhost.
So on the P14s we assign an IP of 10.0.0.10 to the P51:
sudo ip address add 10.0.0.10/24 dev enp1s0f0
Then on the P51 analogously, giving IP of 10.0.0.20 to the P14s:
sudo ip address add 10.0.0.20/24 dev enp0s31f6
And after that, P14s can:
ping 10.0.0.10
and P51 can:
ping 10.0.0.20
TODO after a few seconds, the settings appear to be forgotten, and ping stops working unless you do sudo ip address add on the local machine again. This seems to happen after a popup appears saying "Activation of network connection failed" as it fails to obtain Internet from the cable.
TODO list and delete such manual assignments we've made.
Display manager Updated +Created
Check which you you have:
systemctl status display-manager.service
Tested on Ubuntu 23.10 I see:
● gdm.service - GNOME Display Manager
     Loaded: loaded (/lib/systemd/system/gdm.service; static)
     Active: active (running) since Sun 2023-12-24 10:34:50 GMT; 23min ago
    Process: 1827 ExecStartPre=/usr/share/gdm/generate-config (code=exited, status=0/SUCCESS)
   Main PID: 1850 (gdm3)
      Tasks: 4 (limit: 71817)
     Memory: 6.8M
        CPU: 119ms
     CGroup: /system.slice/gdm.service
             └─1850 /usr/sbin/gdm3
which means I have GNOME Display Manager.
@cirosantilli/_file/riscv/riscv/timer.S Updated +Created
TODO: the interrupt is firing only once:
Tested on Ubuntu 23.10:
sudo apt install binutils-riscv64-unknown-elf qemu-system-misc gdb-multiarch
cd riscv
make
Then on shell 1:
qemu-system-riscv64 -machine virt -cpu rv64 -smp 1 -s -S -nographic -bios none -kernel timer.elf
and on shell 2:
gdb-multiarch timer.elf -nh -ex "target remote :1234" -ex 'display /i $pc' -ex 'break *mtrap' -ex 'display *0x2004000' -ex 'display *0x200BFF8'
GDB should break infinitel many times on mtrap as interrupts happen.
gfx_v11_0_priv_reg_irq: register access in command stream Updated +Created
Had this happen on P14s on Ubuntu 23.10 while causally using Chromium. The screen went blank for a few seconds, but it apparently managed to reboot itself, and things started working again, except that and most windows were killed:
[drm:gfx_v11_0_priv_reg_irq [amdgpu]] *ERROR* Illegal register access in command stream
[drm:amdgpu_job_timedout [amdgpu]] *ERROR* ring gfx_0.0.0 timeout, signaled seq=5774109, emitted seq=5774111
[drm:amdgpu_job_timedout [amdgpu]] *ERROR* Process information: process chrome pid 14023 thread chrome:cs0 pid 14087
amdgpu 0000:64:00.0: amdgpu: GPU reset begin!
[drm:mes_v11_0_submit_pkt_and_poll_completion.constprop.0 [amdgpu]] *ERROR* MES failed to response msg=3
[drm:amdgpu_mes_unmap_legacy_queue [amdgpu]] *ERROR* failed to unmap legacy queue
[drm:mes_v11_0_submit_pkt_and_poll_completion.constprop.0 [amdgpu]] *ERROR* MES failed to response msg=3
[drm:amdgpu_mes_unmap_legacy_queue [amdgpu]] *ERROR* failed to unmap legacy queue
[drm:mes_v11_0_submit_pkt_and_poll_completion.constprop.0 [amdgpu]] *ERROR* MES failed to response msg=3
[drm:amdgpu_mes_unmap_legacy_queue [amdgpu]] *ERROR* failed to unmap legacy queue
[drm:mes_v11_0_submit_pkt_and_poll_completion.constprop.0 [amdgpu]] *ERROR* MES failed to response msg=3
[drm:amdgpu_mes_unmap_legacy_queue [amdgpu]] *ERROR* failed to unmap legacy queue
[drm:mes_v11_0_submit_pkt_and_poll_completion.constprop.0 [amdgpu]] *ERROR* MES failed to response msg=3
[drm:amdgpu_mes_unmap_legacy_queue [amdgpu]] *ERROR* failed to unmap legacy queue
[drm:mes_v11_0_submit_pkt_and_poll_completion.constprop.0 [amdgpu]] *ERROR* MES failed to response msg=3
[drm:amdgpu_mes_unmap_legacy_queue [amdgpu]] *ERROR* failed to unmap legacy queue
[drm:mes_v11_0_submit_pkt_and_poll_completion.constprop.0 [amdgpu]] *ERROR* MES failed to response msg=3
[drm:amdgpu_mes_unmap_legacy_queue [amdgpu]] *ERROR* failed to unmap legacy queue
[drm:mes_v11_0_submit_pkt_and_poll_completion.constprop.0 [amdgpu]] *ERROR* MES failed to response msg=3
[drm:amdgpu_mes_unmap_legacy_queue [amdgpu]] *ERROR* failed to unmap legacy queue
[drm:mes_v11_0_submit_pkt_and_poll_completion.constprop.0 [amdgpu]] *ERROR* MES failed to response msg=3
[drm:amdgpu_mes_unmap_legacy_queue [amdgpu]] *ERROR* failed to unmap legacy queue
[drm:gfx_v11_0_cp_gfx_enable.isra.0 [amdgpu]] *ERROR* failed to halt cp gfx
Dec 27 15:03:38 ciro-p14s kernel: amdgpu 0000:64:00.0: amdgpu: MODE2 reset
Dec 27 15:03:38 ciro-p14s kernel: amdgpu 0000:64:00.0: amdgpu: GPU reset succeeded, trying to resume
Dec 27 15:03:38 ciro-p14s kernel: [drm] PCIE GART of 512M enabled (table at 0x0000008000900
It appears to be a bug in the AMDGPU open source driver.
I think this was on Wayland. Possibly relatd but on X Window System, crashed the UI, showed message "oh no! Something has gone wrong."
2024-01-13_21-55-07@ciro@ciro-p14s$ cat /var/log/apport.log
ERROR: apport (pid 975172) 2024-01-13 21:41:02,087: host pid 3528 crashed in a separate mount namespace, ignoring
INFO: apport (pid 975227) 2024-01-13 21:41:02,398: called for pid 2728, signal 5, core limit 0, dump mode 1
INFO: apport (pid 975227) 2024-01-13 21:41:02,401: executable: /usr/bin/gnome-shell (command line "/usr/bin/gnome-shell")
INFO: apport (pid 975227) 2024-01-13 21:41:12,667: wrote report /var/crash/_usr_bin_gnome-shell.1000.crash
lspci Updated +Created
lspci is the name of several versions of CLI tools used in UNIX-like systems to query information about PCI devices in the system.
On Ubuntu 23.10, it is provided by the pciutils package, which is so dominant that when we say "lspci" without qualitication, that's what we mean.
Make a bug report for a crash on Ubuntu Updated +Created
On Ubuntu 23.10, a crash led to the creation of:
/var/crash/_usr_bin_gnome-shell.1000.crash
After that simply running apport-cli as:
apport-cli gnome-shell
led to the creation of: bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/2049368 a bug on the gnome-shell package.
MuJoCo getting started Updated +Created
Tested on Ubuntu 23.10;
git clone https://github.com/google-deepmind/mujoco
cd mujoco
git checkout 5d46c39529819d1b31249e249ca399f306a108ac
mkdir -p build
cd build
cmake ..
make -j
Now let's play. Minimal interactive UI simulation of a simple MJCF scene with one falling cube:
bin/basic ../doc/_static/hello.xml
Test soure code: github.com/google-deepmind/mujoco/blob/5d46c39529819d1b31249e249ca399f306a108ac/sample/basic.cc. The only thing you can do is rotate the scene with the computer mouse it seems. Mentioned at: mujoco.readthedocs.io/en/2.2.2/programming.html#sabasic
Some more interesting models can be found under the model/ directory: github.com/google-deepmind/mujoco/tree/5d46c39529819d1b31249e249ca399f306a108ac/model E.g. the imaginary humanoid robot DeepMind used in many demos can be seen with:
bin/basic ../model/humanoid/humanoid.xml
A more advanced UI with a few controls:
bin/simulate ../doc/_static/hello.xml
Test soure code: github.com/google-deepmind/mujoco/tree/5d46c39529819d1b31249e249ca399f306a108ac/simulate. Mentioned at: mujoco.readthedocs.io/en/2.2.2/programming.html#sasimulate
A very cool thing about that UI is that you can manually control joints. There are no joints in the hello.xml, but e.g. with the humanoid model:
bin/simulate ../model/humanoid/humanoid.xml
under "Control" you move each joint of the robot separately which is quite cool.
Video 1.
Demo of MuJoCo's built-in simulate viewer by Yuval Tassa (2019)
Source.
There's also a bin/record test executable that presumably renders the simulation directly to a file:
bin/record ../doc/_static/hello.xml 5 60 rgb.out
ffmpeg -f rawvideo -pixel_format rgb24 -video_size 800x800 -framerate 60 -i rgb.out -vf "vflip" video.mp4
Mentioned at: mujoco.readthedocs.io/en/2.2.2/programming.html#sarecord but TODO that produced a broken video, related issues:
ROCm on Ubuntu Updated +Created
Tested on Ubuntu 23.10 with P14s:
sudo apt install hipcc
git clone https://github.com/ROCm/HIP-Examples
cd HIP-Examples/HIP-Examples-Applications/HelloWorld
make
TODO fails with:
/bin/hipcc -g   -c -o HelloWorld.o HelloWorld.cpp
clang: error: cannot find ROCm device library for gfx1103; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
make: *** [<builtin>: HelloWorld.o] Error 1
Run Zephyr on QEMU Updated +Created
Real hardware is for newbs. Real hardware is for newbs.
Tested on Ubuntu 23.10 we approximately follow instructions from: docs.zephyrproject.org/3.4.0/develop/getting_started/index.html stopping before the "Flash the sample" section, as we don't flash QEMU. We just run it.
sudo apt install --no-install-recommends git cmake ninja-build gperf \
  ccache dfu-util device-tree-compiler wget \
  python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \
  make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1
python3 -m venv ~/zephyrproject/.venv
source ~/zephyrproject/.venv/bin/activate
pip install west
west init ~/zephyrproject
cd ~/zephyrproject
west update
west zephyr-export
cd ~
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.1/zephyr-sdk-0.16.1_linux-x86_64.tar.xz
tar xvf zephyr-sdk-0.16.1_linux-x86_64.tar.xz
cd zephyr-sdk-0.16.1
./setup.sh
The installation procedure install all compiler toolchains for us, so we can then basically compile for any target. It also fetches the latest Git source code of Zephyr under:
~/zephyrproject/zephyr
The "most default" blinky hello world example which blinks an LED is a bit useless for us because QEMU doesn't have LEDs, so instead we are going to use one of the UART examples which will print characters we can see on QEMU stdout.
Let's start with the hello world example on an x86 target:
cd ~/zephyrproject/zephyr
west build -b qemu_x86 samples/hello_world -t run
and it outputs:
Hello World! qemu_x86
The qemu_x64 on the output comes from the CONFIG_BOARD macro github.com/zephyrproject-rtos/zephyr/blob/c15ff103001899ba0321b2c38013d1008584edc0/samples/hello_world/src/main.c#L11
#include <zephyr/kernel.h>

int main(void)
{
	printk("Hello World! %s\n", CONFIG_BOARD);
	return 0;
}
You can also first cd into the directory that you want to build in to avoid typing samples/hello_world all the time:
cd ~/zephyrproject/zephyr/samples/hello_world
zephyr west build -b qemu_x86 -t run
You can also build and run separately with:
west build -b qemu_x86
west build -t run
Another important option is:
west build -t menuconfig
But note that it does not modify your prj.conf automatically for you.
Let's try on another target:
rm -rf build
zephyr west build -b qemu_cortex_a53 -t run
and same output, but on a completely different board! The qemu_cortex_a53 board is documented at: docs.zephyrproject.org/3.4.0/boards/arm64/qemu_cortex_a53/doc/index.html
The list of all examples can be seen under:
ls ~/zephyrproject/zephyr/samples
which for example contains:
zephyrproject/zephyr/samples/hello_world
So run another sample simply select it, e.g. to run zephyrproject/zephyr/samples/synchronization:
west build -b qemu_cortex_a53 samples/synchronization -t run
Unable to lock screen on Ubuntu Updated +Created
Happened on P14s on Ubuntu 23.10, which started with fresh Ubuntu 23.10 install.
However it did not happen on Lenovo ThinkPad P51 (2017) also on Ubuntu 23.10 which had been upgraded several times from God knows what starting point... At first one had X11 (forced by Nvidia drivers) and the other Wayland, but moving to p14s X11 changed nothing.
Both were running GNOME Display Manager.
Same happens with Super + L, but also CLI commands: askubuntu.com/questions/7776/how-do-i-lock-the-desktop-screen-via-command-line
Older updates Updated +Created