Casey Primozic’s Notes

Misc. notes, code, and other content I want to post publicly that don’t warrant a full blog post

By Casey Primozic

Subscribe to RSS

Google Cloud Platform Gems

I was reading a Hacker News thread for an article comparing GCP to some alternatives like AWS. I’ve been a GCP user for a good while now, and it’s definitely my go-to public cloud. We also use it at my dayjob at Osmos. Reading the article and comments got me thinking about some of my favorite GCP features. GCP has a few excellent gems which are better than pretty much any competing cloud offering:
Read more →

Fixing Nginx Reverse Proxy Server Not Compressing gltf/glb Files

I’ve been building some interactive sketches/games in Three.JS, and I wanted to deploy it on my server. I export the models used by the level from Blender in glTF format, which is a modern, well-supported, and commonly used format for this. Specifically, I exported the models as a .glb file. The Problem When I loaded my levels in the browser, I noticed that the .glb file wasn’t getting compressed with gzip.
Read more →

Speeding Up Geodesic Tracing in geometry-central

As part of some recent work in procedural mesh generation, I’ve been working with a computational geometry library called geometry-central to trace geodesic paths on the surface of 3D meshes. geometry-central is written in C++, and I compiled the library to WebAssembly with Emscripten in order to use it in the browser. As I recently learned, a geodesic path is the straightest path along a surface. It’s the path you would take if you were to walk in a straight line across the surface of some manifold for some distance in some direction.
Read more →

Fixing rust-analyzer to work with uuid_unstable for v7 UUIDs

Recently, one of my coworkers added code that uses v7 UUIDs. v7 UUIDs are a new type of UUID that contains a timestamp along with randomness, making them useful for DB primary keys and similar things. However, that code broke my rust-analyzer install for local development. I already was running rust nightly locally, so there was some other issue. It said that Uuid::new_v7() wasn’t a function even though the v7 feature was enabled for the uuid crate and it was at the latest version.
Read more →

Fixing HSA_STATUS_ERROR_OUT_OF_RESOURCES Error with Stable Diffusion

I’ve been using Stable Diffusion XL via the Automatic1111 web UI to generate PBR textures for use in my Three.JS projects, as I’ve written about previously. Everything was going great until at random, the generation started crashing at 100% and I got this error in my console: :0:rocdevice.cpp :2786: 58285575154 us: 154003: [tid:0x7f59ee1216c0] Callback: Queue 0x7f583ec00000 Aborting with error : 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.
Read more →