Skip to content

Instantly share code, notes, and snippets.

View cwoffenden's full-sized avatar

Carl Woffenden cwoffenden

  • Basel, Switzerland
View GitHub Profile
@cwoffenden
cwoffenden / win-llvm.txt
Created March 13, 2024 14:14
Build LLVM (with Wasm) on Windows
Build LLVM (with Wasm) on Windows
---------------------------------
Tested with VS2019 (probably works with older versions). See here for original instructions:
https://emscripten.org/docs/building_from_source/index.html
http://llvm.org/docs/CMake.html
Make sure you have CMake (tested with 3.15.5), Ninja (tested with 1.9.0) and Git installed and on your Path.
@cwoffenden
cwoffenden / runbc7enc.py
Last active October 3, 2022 17:27
Tool to compress a directory of PNG files with bc7enc and log the error metrics
#!/usr/bin/env python3
# Tool to compress a directory of PNG files with bc7enc and log the error
# metrics as a CSV, with the aim to verify that any code changes neither impact
# the quality nor execution time. Since the aim isn't to keep the generated
# files, the outputs are always the same file (deleteme.dds|png), overwriting
# each time. bc7enc is currently limited to loading PNGs, so too is this script.
# Example usage:
#
# ./runbc7enc.py -b 5 -o /Volumes/Temp -x ./bc7enc-mine -l mine.csv -t -s .
# Most options are straightforward, the oddity being LLVM_ENABLE_DUMP to both boostrap and stage2 compilers
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_DUMP=On -DCLANG_ENABLE_BOOTSTRAP=On -DLLVM_ENABLE_PROJECTS='clang;clang-tools-extra;lld;lldb' -DBOOTSTRAP_CMAKE_BUILD_TYPE=Release -DBOOTSTRAP_LLVM_ENABLE_DUMP=On -DBOOTSTRAP_LLVM_INCLUDE_EXAMPLES=Off -DBOOTSTRAP_LLVM_INCLUDE_TESTS=Off ../LLVM/llvm
ninja stage2
@cwoffenden
cwoffenden / gcc-power9.txt
Last active April 12, 2022 15:55
Building GCC on Power9
# Clone git into a source dir and create a destination for the compiled source:
#
cd path/to/store/files
git clone git://gcc.gnu.org/git/gcc.git gcc-src
mkdir gcc-obj
# Show the list of branches and select the one we want:
#
cd gcc-src
git branch -a
@cwoffenden
cwoffenden / windows-oobe.md
Created February 19, 2022 14:37
Bypass Windows account creation

Bypass Windows account creation

  1. Start the OOBE and make sure you have an Internet connection
  2. Go through the first few screens for language options and such
  3. When you get to the Microsoft Account screen, hit Shift-F10 to open a command prompt
  4. The next step depends on whether you are on wireless or wired: a. Wireless: netsh wlan disconnect b. Wired: netsh interface show interface to get the interface name then netsh interface set interface name=”name from earlier” admin=DISABLED
  5. Type exit and hit the back arrow at the top
@cwoffenden
cwoffenden / dawn-linux.md
Created February 17, 2022 17:16
Building Dawn/WebGPU for Linux/Power9

Dawn Linux

Work-in-progress and notes for building Dawn for Linux on Power9 (x64 should be easier). Tested on Debian Bullseye.

  1. Depot Tools doesn't work, so CMake appears to be the only way. If this is of further interest Depot Tools fails because some prebuilt binaries aren't available for ppc64le (some are, some are out of date, and some are missing). Building gn manually (see building Chrome) then setting DEPOT_TOOLS_UPDATE=0 allows gn to generate the build scripts but this was still failing. CMake works so don't try any further.
  2. Install all the depdendencies. The ones to build Chrome were already added but also: sudo apt install libx11-dev xcb libxcb-xcb-dev x11-xkb-utils libx11-xcb-dev.
  3. GCC will build but with warnings (mostly ABI changes but also the UNREACHABLE() macro usage needs slightly reworking do be GCC friendly) so install Clang (which is what Dawn is developed with anyway).
  4. Clang needs setting as the default c
@cwoffenden
cwoffenden / dawn-gerrit.md
Created January 12, 2021 18:18
Instructions for getting patches into Dawn (and similar Gerrit projects)

Dawn

Project main URL:

https://dawn.googlesource.com/dawn/

Bug tracker:

https://bugs.chromium.org/p/dawn/