20
I Use This!
Activity Not Available

News

Posted 3 months ago
I have been using the Glove80 keyboard for a few years now, and it suits me very well. I have some quibbles about the software1 and hardware. This blog post is about fixing the hardware. The keyboard has function keys F1 through F10. This ... [More] design decision — detailed at Why are there no F11 and F12 keys? — was to reduce the height of the keyboard for portability. Personally, I wouldn’t mind an extra 12mm in keyboard height; I would prefer to have the extra keys. I wondered if I could add them. The Glove80 designers cleverly left an “escape hatch” to facilitate extra buttons and other peripherals. I wondered if I could use that to add F6 and F7 keys. The keyboard is expensive, so I did not want to drill holes or dremel the case or solder directly onto any PCB. My idea was to use the provided GPIO pin header and sneak thin (30 AWG) wires through the power LED case holes such that I could undo everything cleanly if necessary. For the software side of the modifications, I used the generic ZMK port so I could follow the “west” tool setup instructions verbatim and build the firmware on my own machine (avoiding the recommended proprietary build pipelines). Once I found the right area of the documentation website the instructions were up-to-date and easy-to-follow. I wrote a ZMK patch I thought should work. Update 2026-09-29: I created another patch, for the official MoErgo ZMK firmware. Now that the software was ready to test, I bought some supplies: Supplies needed to convert Glove80 to Glove82. Some 30 AWG wire, a 2×6 1.27mm ribbon cable, and two Kailh Low Profile Choc switches. I opened the case, connected the ribbon cable, and performed a test with multimeter probes: Hardware setup for probing Glove80 extension pinout. After orienting myself to the pin-numbering scheme, Ribbon cable pinouts. I determined the correct pins and connected them. xev showed the new F6 key registering!: Running xev while probing ribbon cable. I started work hacking together a cable (with some soldering help from my son and daughter). Here is the result: Glove82 wiring harness installed in chassis. One more test of shorting the exported wires and I felt confident enough to tape the new harness to the inside of the case. Next, I screwed the cover back on, and routed and secured with Kapton tape the extra wire length I left for further mounting experimentation: Routing of wires outside chassis. To mount the key to the keyboard, I had been conceptualizing something 3D-printed and clip-on. However for the prototype my daughter suggested double-sided sticky tape (“the foam kind”). It turned out to be strong enough to support the key itself and key presses (I use the lightest 35gf switches): Key mounting test. I did the second half of the keyboard and… Behold, the final prototype: Working Glove82 prototype. It looks funny because the new keys are raised off the board. It turns out this doesn’t actually bother me or negatively impact usability. The risk of cutting into the case to make the new keys flush would bother me! When making a window fullscreen during testing it was immediately satisfying to mash F11 exactly where I expected it, instead of searching the web for the layout of the Glove80 lower layer. Potential Future Improvements Maybe I will find the motivation to design a clip-on 3D-printed mount to replace the tape. At some point I might create a fork of the official MoErgo firmware with my Glove82 patch, to get back the extra features that the vanilla ZMK port is missing (e.g., LED support). Upstream ZMK and the MoErgo branch have diverged though so this isn’t trivial. Update 2026-09-29: Done. For now though, the keyboard is usable as-is, so I will use it for a while and see how the modifications hold up. 1. I wish some heroes of the Internet would reverse engineer and re-implement the nRF52840 Bluetooth stack under a GPL-compatible license. Thank you to mtegel, lexano, and my daughter, for reviewing a draft of this post. [Less]
Posted 3 months ago
I have been using the Glove80 keyboard for a few years now, and it suits me very well. I have some quibbles about the software1 and hardware. This blog post is about fixing the hardware. The keyboard has function keys F1 through F10. This ... [More] design decision — detailed at Why are there no F11 and F12 keys? — was to reduce the height of the keyboard for portability. Personally, I wouldn’t mind an extra 12mm in keyboard height; I would prefer to have the extra keys. I wondered if I could add them. The Glove80 designers cleverly left an “escape hatch” to facilitate extra buttons and other peripherals. I wondered if I could use that to add F6 and F7 keys. The keyboard is expensive, so I did not want to drill holes or dremel the case or solder directly onto any PCB. My idea was to use the provided GPIO pin header and sneak thin (30 AWG) wires through the power LED case holes such that I could undo everything cleanly if necessary. For the software side of the modifications, I used the generic ZMK port so I could follow the “west” tool setup instructions verbatim and build the firmware on my own machine (avoiding the recommended proprietary build pipelines). Once I found the right area of the documentation website the instructions were up-to-date and easy-to-follow. I wrote a ZMK patch I thought should work. Update 2026-09-29: I created another patch, for the official MoErgo ZMK firmware. Now that the software was ready to test, I bought some supplies: Supplies needed to convert Glove80 to Glove82. Some 30 AWG wire, a 2×6 1.27mm ribbon cable, and two Kailh Low Profile Choc switches. I opened the case, connected the ribbon cable, and performed a test with multimeter probes: Hardware setup for probing Glove80 extension pinout. After orienting myself to the pin-numbering scheme, Ribbon cable pinouts. I determined the correct pins and connected them. xev showed the new F6 key registering!: Running xev while probing ribbon cable. I started work hacking together a cable (with some soldering help from my son and daughter). Here is the result: Glove82 wiring harness installed in chassis. One more test of shorting the exported wires and I felt confident enough to tape the new harness to the inside of the case. Next, I screwed the cover back on, and routed and secured with Kapton tape the extra wire length I left for further mounting experimentation: Routing of wires outside chassis. To mount the key to the keyboard, I had been conceptualizing something 3D-printed and clip-on. However for the prototype my daughter suggested double-sided sticky tape (“the foam kind”). It turned out to be strong enough to support the key itself and key presses (I use the lightest 35gf switches): Key mounting test. I did the second half of the keyboard and… Behold, the final prototype: Working Glove82 prototype. It looks funny because the new keys are raised off the board. It turns out this doesn’t actually bother me or negatively impact usability. The risk of cutting into the case to make the new keys flush would bother me! When making a window fullscreen during testing it was immediately satisfying to mash F11 exactly where I expected it, instead of searching the web for the layout of the Glove80 lower layer. Potential Future Improvements Maybe I will find the motivation to design a clip-on 3D-printed mount to replace the tape. At some point I might create a fork of the official MoErgo firmware with my Glove82 patch, to get back the extra features that the vanilla ZMK port is missing (e.g., LED support). Upstream ZMK and the MoErgo branch have diverged though so this isn’t trivial. Update 2026-09-29: Done. For now though, the keyboard is usable as-is, so I will use it for a while and see how the modifications hold up. 1. I wish some heroes of the Internet would reverse engineer and re-implement the nRF52840 Bluetooth stack under a GPL-compatible license. Thank you to mtegel, lexano, and my daughter, for reviewing a draft of this post. [Less]
Posted 8 months ago
We’ll release Valgrind 3.27.0 later today. While making sure the NEWS file was up to date I wrote about all the contributions made this release. Thanks all, and apologies if I missed something or someone. Aaron Merey added two new options to ... [More] helgrind. To control helgrind tracing of internal synchronization, threading and memory events use –show-events=1|2|3. Use –track-destroy=no|yes|all to checks for missing pthread_mutex_destroy and pthread_rwlock_destroy calls. With yes, helgrind warns when pthread_mutex_init or pthread_rwlock_init is called on the address of a live (undestroyed) lock. With all, Helgrind also reports undestroyed locks at process exit. Valgrind has separate VEX IR translators for AMD64 and x86 (32 bit) code. While the AMD64 translator has seen support for new encodings and instruction sets, the x86 translator has not. Alexandra Hájková decided to port the SSE4.1 instruction set from the AMD64 translator to the x86 translator and add backend support. This is ongoing work, see the bug dependency tree. But many more 32bit programs using SSE4.1 should now run under Valgrind. Andreas Arnez and Florian Krohm did a lot of work on the s390x support. Andreas added support for new s390x z/Architecture features from the 15th edition. This enables running binaries compiled with -march=arch15 or -march=z17 and exploiting the new MSA extensions 10-13. Florian Krohm integrated binutils objdump for s390x disassembly in VEX. And did a lot of s390x code and facilities cleanups.s390x machine models older than z196 are no longer supported. Andreas also showed there are still meaningful optimizations to be made on how memcheck tracks undefinedness bits as outlined in the original “Using Valgrind to detect undefined value errors with bit-precision” paper. His optimization of memcheck instrumenting a bitwise AND/OR with a constant is clever and simplifies the generated code. Martin Cermak maintains the Linux Test Program (LTP) valgrind integration, which checks our syscall wrappers work correctly. And he makes sure newer linux syscalls are wrapped. Valgrind 3.27.0 adds support for file_getattr, file_setattr, lsm_get_self_attr, lsm_set_self_attr, lsm_list_modules. And corrects various syscall and ioctl corner cases. Martin also added Valgrind address space manager support for tracking linux kernel lightweight guard pages, created through madvise (MADV_GUARD_INSTALL). These guard pages are very low overhead for the kernel because they aren’t tracked as separate VMAs and don’t show up in the process proc maps. But Valgrind does still need to know whether the addresses are accessible. A new –max-guard-pages option controls the memory Valgrind reserves for tracking these pages. Paul Floyd had more commits than all others combined for this release. Paul takes care of the alternative toolchains, Solaris/illumos, FreeBSD and Darwin/MacOS ports. Tested Oracle Solaris 11.4, OpenIndiana Hipster and OmniOS.FreeBSD works on both amd64 and arm64, support for 16.0-CURRENT has been added. Supported MacOS versions, 10.13 (bug fixes), 10.14, 10.15, 11.0 (Intel only), 12.0 (Intel only), 13.0 (Intel only, preliminary). No arm64 support yet. A lot of code in valgrind 3.27.0 to support MacOS was previously maintained by Louis Brunner out of tree. There are two new client requests (macros defined in valgrind.h) VALGRIND_REPLACES_MALLOC Returns 1 if the tool replaces malloc (e.g., memcheck). Returns 0 if the tool does not replace malloc (e.g., cachegrind and callgrind) or if the executable is not running under Valgrind. VALGRIND_GET_TOOLNAME Get the running tool name as a string. Takes two arguments, an input buffer pointer and the length of that buffer. [Less]
Posted 11 months ago
AI GoF disclaimer: I don’t expect this blog post to contribute to frontier AI gain-of-function research or I would refrain from publishing it. Please consider supporting Doom Debates to improve the quality of discourse around the risks of frontier AI ... [More] research, and MIRI to try to mitigate the risks. I have been wanting to experiment with open weights language models on the Talos II. I have a gfx803 card that I always wanted to use for compute, but it is now out-of-support for ROCm. I have made progress getting a gfx1201 card working on this machine and I wanted to write up all the interesting error messages for reference. I took a risk and bought a new GPU, the AMD Radeon AI Pro R9700 (ASRock Creator 32GB), without knowing if I could get it working with the Talos II mainboard, which is now seven years old. First I realized my existing power supply did not have enough free connectors; I needed a new “modular” power supply for the GPU’s new-style 12v-2x6 power connector (which is actually a 16 pin connector, with an array of 2 x 6 main big pins and 4 little pins at the top). That prerequisite project was nerve-racking but successful. Physically, the card fit fine in the mainboard and EATX chassis. With the latest Debian Trixie kernel driver, the card showed up as a PCIe device in lspci (validating the physical installation) but without displaying the card’s name. I figured the driver was not new enough to recognize the card’s product identifier. I read online that a Debian-derivative’s 6.17 kernel recognized the card on a different CPU architecture, so I temporarily enabled the Debian testing repository, installed linux-image, and rebooted. Now lspci displayed the card’s name, so that was progress. But as a side effect of the kernel upgrade, my virtual machines failed to start up. The libvirtd message was: qemu-system-ppc64: Can't support 64 kiB guest pages with 4 kiB host pages with this KVM implementation It turned out Debian ppc64le had changed the default page size from 64KiB to 4KiB. Debian though, with its characteristic flexibility, still provided a 64KiB page-size linux-image variant. With that the virtual machines worked again and the GPU continued to be recognized. Next I shifted to userspace; the Debian-packaged rocminfo segfaulted early during its initialization, so I looked upstream and found TheRock. I had lots of initial trouble with TheRock‘s CMake monorepo/subprojects; I am not yet sure what’s up with that, but I suspect it may be ppc64le-specific. That said, I was able to make progress by building individual subprojects one-by-one (this is probably a better approach anyway, at this stage of porting). Eventually I got amd-llvm bootstrapped, built with a minimal configuration with Trixie‘s gcc 14.2.0. Then I built amd-llvm with itself, in the TheRock-recommended configuration, except for the PowerPC and AMDGPU targets. Next I built rocminfo. It segfaulted in the same place as Debian‘s package! Some debugging resulted in a patch to accommodate ppc64‘s vDSO naming; that eliminated the segault. Then rocminfo ran and showed both the CPUs as “Agents” 0 and 1. But no sign of the GPU. I further debugged rocminfo and found it was traversing sysfs, and specifically the AMD Kernel Fusion Driver (kfd) topology. The card did not have an entry there. I looked at dmesg and noticed: [...] amdgpu 0033:03:00.0: amdgpu: Error parsing VCRAT [...] kfd kfd: amdgpu: Error adding device to topology [...] kfd kfd: amdgpu: Error initializing KFD node [...] kfd kfd: amdgpu: device 1002:7551 NOT added due to errors First I tried building and updating a .deb of the linux-firmware from its Git repository, to rule out the parsing error being caused by an outdated binary-only firmware blob. (This is my one disappointment with the ROCm stack; it would be great if the firmware and firmware toolchains were free software.) Rebooting with the new firmware produced the same result. I looked at the kernel source for that driver, and noticed extra debug printks. Debian helpfully enables the CONFIG_DYNAMIC_DEBUG kernel option. I tried dynamically reloading the amdgpu driver and various PCIe and GPU reset approaches, but I could not get the card back to its after-boot state. I would have to reboot to test each change. I added amdgpu.dyndbg="+p" to the kernel command line, and that gave me some extra kfd messages; with those I narrowed down the failure to the IO link entry of the Virtual Component Resource Association Table (VCRAT). I re-reviewed dmesg and, earlier than the parsing error, there was another clue: [...] amdgpu: IO link not available for non x86 platforms That message was printed during the creation of the CPU VCRAT (in kfd_create_vcrat_image_cpu). That was the #else branch of a platform-specific #ifdef. kfd_create_vcrat_image_gpu which did not have a corresponding #ifdef; “this could explain the subsequent parsing failure on the VCRAT IO link entry, on ppc64le, a non-x86 platform”, I thought. It was time to recompile the Linux kernel. Debian makes this surprisingly easy; I followed the official instructions to build a custom kernel .deb with my attempted fix applied to the amdgpu.ko module. Another reboot and no more VCRAT parsing failure message in dmesg. That seemed like more progress. (Perhaps a more proper solution would be to add IO link support to ppc64le upstream; I don’t know if there is an equivalent POWER9 capability, hardware-wise. For my purposes, I have not yet needed an IO link.) rocminfo still failed though, albeit in a new way: hsa api call failure at: /TheRock/rocm-systems/projects/rocminfo/rocminfo.cc:1329 Call returned HSA_STATUS_ERROR_OUT_OF_RESOURCES: The runtime failed to allocate the necessary resources. This error may also occur when the core runtime library needs to spawn threads or create internal OS-specific events. The co-timed dmesg messages were: [...] amdgpu 0033:03:00.0: amdgpu: bo 00000000bdd46d97 va 0x0ffffffbfe-0x0ffffffc1d conflict with 0x0ffffffc00-0x0ffffffe00 [...] amdgpu: Failed to map VA 0xffffffbfe000 in vm. ret -22 [...] amdgpu: Failed to map bo to gpuvm I analyzed the section of kernel driver code that generated those messages and noticed the use of AMDGPU_GPU_PAGE_SIZE in range calculations. It is hard-coded to 4096. I had a hunch that the driver needed the kernel’s page size to match. I did a quick side quest to change all my virtual machines to use 4KiB pages, reconfigured my custom Debian kernel for 4KiB pages, and rebooted again. Now the virtual machines loaded, and finally rocminfo showed the card’s information! [...] ******* Agent 3 ******* Name: gfx1201 Uuid: GPU-6413e1798933ffe0 Marketing Name: AMD Radeon Graphics [...] I think Debian‘s decision to use 4KiB pages is sensible, likewise amdgpu‘s assuming 4KiB pages, so I’m happy to have done this reconfiguration. I was only using 64KiB pages because it was the default when I first installed the operating system on the Talos II. The rest of the process was a grind through TheRock subprojects with a bunch of build failure workarounds. The hardest one was fixing static_assert failures about __bf16, reported by clang, when building hipblaslt: In file included from /TheRock/rocm-libraries/projects/hipblaslt/tensilelite/include/Tensile/DataTypes.hpp:42: In file included from /opt/rocm/include/hip/hip_fp8.h:30: In file included from /opt/rocm/include/hip/amd_detail/amd_hip_fp8.h:67: /opt/rocm/include/hip/amd_detail/amd_hip_bf16.h:155:15: error: static assertion failed due to requirement 'sizeof(__bf16) == sizeof(unsigned short)' 155 | static_assert(sizeof(__bf16) == sizeof(unsigned short)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /opt/rocm/include/hip/amd_detail/amd_hip_bf16.h:155:30: note: expression evaluates to '0 == 2' 155 | static_assert(sizeof(__bf16) == sizeof(unsigned short)); | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ Debugging led me to a workaround; this must be a configuration issue with how I built amd-llvm. It needs further investigation, but building amd-llvm with that hack meant that I could successfully build hipblaslt. The other TheRock dependencies were easier to build; I continued until I had all the dependencies of llama.cpp as-configured for ROCm, per this wiki entry. At this point llama.cpp built successfully and ran, with good performance! Here is an example run with a simple prompt: $ uname -srom Linux 6.17.13 ppc64le GNU/Linux $ build/bin/llama-cli -fa 1 -m ~/models/chatgpt-oss-20b/gpt-oss-20b-F16.gguf LoadLib(libhsa-amd-aqlprofile64.so) failed: libhsa-amd-aqlprofile64.so: cannot open shared object file: No such file or directory ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no ggml_cuda_init: found 1 ROCm devices: Device 0: AMD Radeon Graphics, gfx1201 (0x1201), VMM: no, Wave Size: 32 Loading model... ?? ?? ?? ?? ?? ?? ???? ???????? ???? ????? ????? ????? ?? ?? ????? ?? ?? ?? ????? ?? ?? ?? ?? ?? ?? ?? ????? ?? ?? ?? ????? ?? ????? ????? ????? ?? ?? ?? ?? build : b7533-c18428423 model : gpt-oss-20b-F16.gguf modalities : text available commands: /exit or Ctrl+C stop or exit /regen regenerate the last response /clear clear the chat history /read add a text file > write hello world in common lisp write hello world in common lisp <|channel|>analysis<|message|>We need to answer: "write hello world in common lisp". The user wants a "Hello, world" program in Common Lisp. Likely they want code snippet. We should provide simple Common Lisp code: `(print "Hello, World!")` or `(format t "Hello, World~%")`. Provide explanation. Also maybe show how to run with SBCL. Let's produce a response.<|end|><|start|>assistant<|channel|>final<|message|>Here’s a minimal “Hello, World!” program in **Common?Lisp**. You can copy it into a file (e.g. `hello.lisp`) and run it with any Common?Lisp implementation such as SBCL, CLisp, or CCL. ```lisp ;; hello.lisp ;; Common Lisp "Hello, World!" example ;; Print the string to the default output stream. (format t "Hello, World!~%") ``` ### How to run it ```bash # Using SBCL sbcl --script hello.lisp # Using CLisp clisp hello.lisp # Using CCL ccl hello.lisp ``` ### What each part does - `format` – a versatile printing function. - `t` – the target output stream (`*standard-output*`). - `"Hello, World!~%"` – the string to print, where `~%` inserts a newline. - `--script` (SBCL) or similar options let the interpreter treat the file as a script and exit automatically after execution. That’s all you need to see “Hello, World!” on your terminal in Common?Lisp! [ Prompt: 8.7 t/s | Generation: 103.1 t/s ] > I am very happy with this result! I will see how stable it is in the coming days. Now that I have a working proof-of-concept I will try to upstream some patches and ideally make the top-level TheRock build “just work” on ppc64le Debian. Thank yous: ROCm and amdgpu teams for making TheRock and the Linux kernel drivers free software, portable and well-documented. Debian maintainers for a highly-adaptable operating system. Raptor Computer Systems team for making Talos II future-proof. #talos-workstation and #debian-ai participants for support and feedback. Rene Cheng for power supply advice. Matthew Tegelberg for editing. [Less]
Posted 11 months ago
AI GoF disclaimer: I don’t expect this blog post to contribute to frontier AI gain-of-function research or I would refrain from publishing it. Please consider supporting Doom Debates to improve the quality of discourse around the risks of frontier AI ... [More] research, and MIRI to try to mitigate the risks. I have been wanting to experiment with open weights language models on the Talos II. I have a gfx803 card that I always wanted to use for compute, but it is now out-of-support for ROCm. I have made progress getting a gfx1201 card working on this machine and I wanted to write up all the interesting error messages for reference. I took a risk and bought a new GPU, the AMD Radeon AI Pro R9700 (ASRock Creator 32GB), without knowing if I could get it working with the Talos II mainboard, which is now seven years old. First I realized my existing power supply did not have enough free connectors; I needed a new “modular” power supply for the GPU’s new-style 12v-2x6 power connector (which is actually a 16 pin connector, with an array of 2 x 6 main big pins and 4 little pins at the top). That prerequisite project was nerve-racking but successful. Physically, the card fit fine in the mainboard and EATX chassis. With the latest Debian Trixie kernel driver, the card showed up as a PCIe device in lspci (validating the physical installation) but without displaying the card’s name. I figured the driver was not new enough to recognize the card’s product identifier. I read online that a Debian-derivative’s 6.17 kernel recognized the card on a different CPU architecture, so I temporarily enabled the Debian testing repository, installed linux-image, and rebooted. Now lspci displayed the card’s name, so that was progress. But as a side effect of the kernel upgrade, my virtual machines failed to start up. The libvirtd message was: qemu-system-ppc64: Can't support 64 kiB guest pages with 4 kiB host pages with this KVM implementation It turned out Debian ppc64le had changed the default page size from 64KiB to 4KiB. Debian though, with its characteristic flexibility, still provided a 64KiB page-size linux-image variant. With that the virtual machines worked again and the GPU continued to be recognized. Next I shifted to userspace; the Debian-packaged rocminfo segfaulted early during its initialization, so I looked upstream and found TheRock. I had lots of initial trouble with TheRock‘s CMake monorepo/subprojects; I am not yet sure what’s up with that, but I suspect it may be ppc64le-specific. That said, I was able to make progress by building individual subprojects one-by-one (this is probably a better approach anyway, at this stage of porting). Eventually I got amd-llvm bootstrapped, built with a minimal configuration with Trixie‘s gcc 14.2.0. Then I built amd-llvm with itself, in the TheRock-recommended configuration, except for the PowerPC and AMDGPU targets. Next I built rocminfo. It segfaulted in the same place as Debian‘s package! Some debugging resulted in a patch to accommodate ppc64‘s vDSO naming; that eliminated the segault. Then rocminfo ran and showed both the CPUs as “Agents” 0 and 1. But no sign of the GPU. I further debugged rocminfo and found it was traversing sysfs, and specifically the AMD Kernel Fusion Driver (kfd) topology. The card did not have an entry there. I looked at dmesg and noticed: [...] amdgpu 0033:03:00.0: amdgpu: Error parsing VCRAT [...] kfd kfd: amdgpu: Error adding device to topology [...] kfd kfd: amdgpu: Error initializing KFD node [...] kfd kfd: amdgpu: device 1002:7551 NOT added due to errors First I tried building and updating a .deb of the linux-firmware from its Git repository, to rule out the parsing error being caused by an outdated binary-only firmware blob. (This is my one disappointment with the ROCm stack; it would be great if the firmware and firmware toolchains were free software.) Rebooting with the new firmware produced the same result. I looked at the kernel source for that driver, and noticed extra debug printks. Debian helpfully enables the CONFIG_DYNAMIC_DEBUG kernel option. I tried dynamically reloading the amdgpu driver and various PCIe and GPU reset approaches, but I could not get the card back to its after-boot state. I would have to reboot to test each change. I added amdgpu.dyndbg="+p" to the kernel command line, and that gave me some extra kfd messages; with those I narrowed down the failure to the IO link entry of the Virtual Component Resource Association Table (VCRAT). I re-reviewed dmesg and, earlier than the parsing error, there was another clue: [...] amdgpu: IO link not available for non x86 platforms That message was printed during the creation of the CPU VCRAT (in kfd_create_vcrat_image_cpu). That was the #else branch of a platform-specific #ifdef. kfd_create_vcrat_image_gpu which did not have a corresponding #ifdef; “this could explain the subsequent parsing failure on the VCRAT IO link entry, on ppc64le, a non-x86 platform”, I thought. It was time to recompile the Linux kernel. Debian makes this surprisingly easy; I followed the official instructions to build a custom kernel .deb with my attempted fix applied to the amdgpu.ko module. Another reboot and no more VCRAT parsing failure message in dmesg. That seemed like more progress. (Perhaps a more proper solution would be to add IO link support to ppc64le upstream; I don’t know if there is an equivalent POWER9 capability, hardware-wise. For my purposes, I have not yet needed an IO link.) rocminfo still failed though, albeit in a new way: hsa api call failure at: /TheRock/rocm-systems/projects/rocminfo/rocminfo.cc:1329 Call returned HSA_STATUS_ERROR_OUT_OF_RESOURCES: The runtime failed to allocate the necessary resources. This error may also occur when the core runtime library needs to spawn threads or create internal OS-specific events. The co-timed dmesg messages were: [...] amdgpu 0033:03:00.0: amdgpu: bo 00000000bdd46d97 va 0x0ffffffbfe-0x0ffffffc1d conflict with 0x0ffffffc00-0x0ffffffe00 [...] amdgpu: Failed to map VA 0xffffffbfe000 in vm. ret -22 [...] amdgpu: Failed to map bo to gpuvm I analyzed the section of kernel driver code that generated those messages and noticed the use of AMDGPU_GPU_PAGE_SIZE in range calculations. It is hard-coded to 4096. I had a hunch that the driver needed the kernel’s page size to match. I did a quick side quest to change all my virtual machines to use 4KiB pages, reconfigured my custom Debian kernel for 4KiB pages, and rebooted again. Now the virtual machines loaded, and finally rocminfo showed the card’s information! [...] ******* Agent 3 ******* Name: gfx1201 Uuid: GPU-6413e1798933ffe0 Marketing Name: AMD Radeon Graphics [...] I think Debian‘s decision to use 4KiB pages is sensible, likewise amdgpu‘s assuming 4KiB pages, so I’m happy to have done this reconfiguration. I was only using 64KiB pages because it was the default when I first installed the operating system on the Talos II. The rest of the process was a grind through TheRock subprojects with a bunch of build failure workarounds. The hardest one was fixing static_assert failures about __bf16, reported by clang, when building hipblaslt: In file included from /TheRock/rocm-libraries/projects/hipblaslt/tensilelite/include/Tensile/DataTypes.hpp:42: In file included from /opt/rocm/include/hip/hip_fp8.h:30: In file included from /opt/rocm/include/hip/amd_detail/amd_hip_fp8.h:67: /opt/rocm/include/hip/amd_detail/amd_hip_bf16.h:155:15: error: static assertion failed due to requirement 'sizeof(__bf16) == sizeof(unsigned short)' 155 | static_assert(sizeof(__bf16) == sizeof(unsigned short)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /opt/rocm/include/hip/amd_detail/amd_hip_bf16.h:155:30: note: expression evaluates to '0 == 2' 155 | static_assert(sizeof(__bf16) == sizeof(unsigned short)); | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ Debugging led me to a workaround; this must be a configuration issue with how I built amd-llvm. It needs further investigation, but building amd-llvm with that hack meant that I could successfully build hipblaslt. The other TheRock dependencies were easier to build; I continued until I had all the dependencies of llama.cpp as-configured for ROCm, per this wiki entry. At this point llama.cpp built successfully and ran, with good performance! Here is an example run with a simple prompt: $ uname -srom Linux 6.17.13 ppc64le GNU/Linux $ build/bin/llama-cli -fa 1 -m ~/models/chatgpt-oss-20b/gpt-oss-20b-F16.gguf LoadLib(libhsa-amd-aqlprofile64.so) failed: libhsa-amd-aqlprofile64.so: cannot open shared object file: No such file or directory ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no ggml_cuda_init: found 1 ROCm devices: Device 0: AMD Radeon Graphics, gfx1201 (0x1201), VMM: no, Wave Size: 32 Loading model... ?? ?? ?? ?? ?? ?? ???? ???????? ???? ????? ????? ????? ?? ?? ????? ?? ?? ?? ????? ?? ?? ?? ?? ?? ?? ?? ????? ?? ?? ?? ????? ?? ????? ????? ????? ?? ?? ?? ?? build : b7533-c18428423 model : gpt-oss-20b-F16.gguf modalities : text available commands: /exit or Ctrl+C stop or exit /regen regenerate the last response /clear clear the chat history /read add a text file > write hello world in common lisp write hello world in common lisp <|channel|>analysis<|message|>We need to answer: "write hello world in common lisp". The user wants a "Hello, world" program in Common Lisp. Likely they want code snippet. We should provide simple Common Lisp code: `(print "Hello, World!")` or `(format t "Hello, World~%")`. Provide explanation. Also maybe show how to run with SBCL. Let's produce a response.<|end|><|start|>assistant<|channel|>final<|message|>Here’s a minimal “Hello, World!” program in **Common?Lisp**. You can copy it into a file (e.g. `hello.lisp`) and run it with any Common?Lisp implementation such as SBCL, CLisp, or CCL. ```lisp ;; hello.lisp ;; Common Lisp "Hello, World!" example ;; Print the string to the default output stream. (format t "Hello, World!~%") ``` ### How to run it ```bash # Using SBCL sbcl --script hello.lisp # Using CLisp clisp hello.lisp # Using CCL ccl hello.lisp ``` ### What each part does - `format` – a versatile printing function. - `t` – the target output stream (`*standard-output*`). - `"Hello, World!~%"` – the string to print, where `~%` inserts a newline. - `--script` (SBCL) or similar options let the interpreter treat the file as a script and exit automatically after execution. That’s all you need to see “Hello, World!” on your terminal in Common?Lisp! [ Prompt: 8.7 t/s | Generation: 103.1 t/s ] > I am very happy with this result! I will see how stable it is in the coming days. Now that I have a working proof-of-concept I will try to upstream some patches and ideally make the top-level TheRock build “just work” on ppc64le Debian. Thank yous: ROCm and amdgpu teams for making TheRock and the Linux kernel drivers free software, portable and well-documented. Debian maintainers for a highly-adaptable operating system. Raptor Computer Systems team for making Talos II future-proof. #talos-workstation and #debian-ai participants for support and feedback. Rene Cheng for power supply advice. Matthew Tegelberg for editing. [Less]
Posted over 1 year ago
The classpath.org domain expired a couple of days ago and none of the subdomain, like planet, devel, icedtea resolved. Oops. It has been renewed for at least 5 years now.
Posted over 1 year ago
A while ago, I wrote about my work to speed up GDB’s DWARF reader. I thought I’d write again with a few updates. Sharding Back then, I wrote: “maybe GDB could trade memory for performance and shard the resulting index and do separate ... [More] canonicalizations in each worker thread”. I did end up doing this. Recall that the canonicalization step goes through all the discovered DWARF entries of interest — basically, all the objects in the program that both have a name and are not in a function scope (except in some languages, there is always an exception with DWARF) — and ensures the names are in a normal form. For Ada, this step includes synthesizing the package hierarchy (something that should probably be done for Go as well, except nobody really works on the Go support in GDB). As an aside, sometime in the last few years we realized that this canonicalization has to be done for C as well, because in C there are multiple spellings of types like “short”. This is also implemented. Because GDB already reads DWARF CUs in chunks in separate threads, the sharding idea is that we can speed up canonicalization a bit by doing this separately. Previously, GDB combined all the results before processing. Sharding means that lookups are a little more complicated; but it turns out not to be too hard, because the number of shards is typically low (for reasons I haven’t yet investigated, the reader doesn’t scale past 8 threads or so). Background Reading The other major change I made is to do all the DWARF reading in the background. This is a trick to make gdb feel faster to users. The basic idea here is that in many cases, gdb does not immediately need the DWARF from the various files. So, if we push the reading into worker threads, maybe it will be completely read in by the time gdb does need it. This also somewhat benefits the situation where several shared libraries are loaded at once into the inferior. In this case, gdb already defers breakpoint re-setting until all the DWARF has been read — and with this change, all that work will be done in parallel. Making this work wasn’t entirely straightforward. The main issue here is that gdb determines the initial language and location for “list” (et al) based on the debug info. The patches arrange to set these things lazily as well. I also had to add some rudimentary thread-safety to BFD. Now, this can be defeated in a few ways. If you have a .gdbinit that sets a breakpoint, then that will cause the familiar pause, because setting a breakpoint will wait for the workers to complete. Or, if you debug a large executable and type very quickly, you may have to wait for the parsing to finish. However, when it does work, it feels like gdb starts instantly. [Less]
Posted over 1 year ago
I was curious about DWARF abbrev table efficiency the other day, so I instrumented gdb to record some simple stats about abbrevs: how many are seen, how many duplicates are seen, and how many bytes are used. Running gdb on itself, I discovered ... [More] that abbrevs are largely redundant. In particular, removing redundant abbrevs will remove 95% of abbrevs (10238 unique of 230714 total). Similarly the size of the abbrev tables reduces similarly (230714 bytes needed for the de-duplicated abbrevs, compared to 3848152 as seen in the executable). Something to think about when you consider the effort DWARF puts in to save a single byte in .debug_info, say by using a 1-byte form rather than a uleb. I was considering having gdb intern abbrevs and pre-reading all abbrevs so that later steps wouldn’t have to re-read these; but interning turns out to be too slow and so re-reading on demand seems like the way to go. [Less]
Posted over 3 years ago
Finally I got around implementing and committing badge support in GNUStep! I think it is one of the fine additions Apple did to the original OpenStep spec While Apple had it since MacOS 10.5, GNUstep didn't and GNUMail had to manage 3 different code ... [More] paths: One for GNUstep, one for 10.4 Mac and one for 10.5 and later which I implemented myself, since GNUMail originally didn't have it. First, I with Fred and Richard brought up GNUmail code to match the 10.4 code path, which is generic and just draws the Icon. To do this, I had to change the code, since ImageReps are not writable in GNUstep, so NSCustomImageRep had to be used and it woks both on GNUstep and on Mac. Later, proper badges support has been added in GNUstep, here the look with GNUMail and with a small test application, which is ported directly from Mac and compiled using xcode buildtool.  As we were tried to match certain Apple behaviours, like ellipsis, but also an addition: I made the colors themable.Here a nice screenshot of the two things working with the Sonne theme. Thematic was enhanced to handle the badgeColor with its three shades matching the ring, text and badge background. [Less]
Posted over 3 years ago
Working on most platforms! ArcticFox 42.1 is out. Here in action with WebGL on MacBook with 10.6 SnowLeopard. The WebGL test in question has been fixed with 42.0 release. While here it is running om the CI20 MIPS Board natively! What is still ... [More] broken? You can help! PowerPC is crashy... SPARC64 crashes on startup FreeBSD doesn't compile on recent versions anymore [Less]