Hacker Newsnew | past | comments | ask | show | jobs | submit | LorenDB's favoriteslogin

Not to worry, there is a 278 page book about initialization in C++!

https://leanpub.com/cppinitbook

(I don't know whether it's good or not, I just find it fascinating that it exists)


This reminds me of the classic StackOverflow question (maybe inspired by it?): https://stackoverflow.com/questions/5508110/why-is-this-prog...

> Through some digging, I found that when a desktop enters S3 sleep, the system cuts power to PCIe GPUs

I am not sure how correct this assumption is. S3 is supposed to cut power to everything but RAM, but for example Gigabyte Aorus motherboards are notorious for an NVMe SSD sleep bug that randomly prevents the system from properly sleeping or waking.

This is fixed by adding the following udev rule:

  # Generic PCIe fix for sleep bugs by preventing wakeup from any PCIe port
  ACTION=="offline", SUBSYSTEM=="pci", DRIVER=="pcieport",     ATTR{power/wakeup}="disabled"
   
or more targeted:

  # Gigabyte sleep fix by preventing wakeup from problematic PCIe port, depends on motherboard model
  ACTION=="offline",  SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x43bc", ATTR{power/wakeup}="disabled"
   
You can find any glitched PCIe wakeup device with:

  1. cat /proc/acpi/wakeup (you'll have to trial and error your way through the wakeup devices if it isn't immediately clear)
  2. cat /sys/class/pci_bus/*/*/yourWakeupDevicePci/uevent | grep PCI_ID
  3. prepend "0x"
You also have the option of:

  udevadm info --attribute-walk /dev/whatever
  
but for that you need to know some basic identifier of your glitchy device.

Or if you want to shellscript it (less reliable than letting udev do it for you and needs to be done via systemd service file or another automation):

  # Gigabyte sleep fix, port depends on mobo model
  /bin/bash -c 'if grep 'RP05' /proc/acpi/wakeup | grep -q 'enabled'; then echo 'RP05' > /proc/acpi/wakeup; fi'";

Yes I really hate this (and other) Linux sleep issues.

Some other alternatives, also haven't hearded about this one:

  - SN DBS - https://www.snsystems.com/ - Used by a lot of game developers, to spread mostly compilation (but also shader compile, or custom jobs).

  - IncrediBuild - https://www.incredibuild.com/

  - Fast build - https://www.fastbuild.org/

  - icecream - https://github.com/icecc/icecream

  - Goma - https://chromium.googlesource.com/infra/goma/client/

  - Bazel / buck / like with various RBE back ends - https://bazel.build/remote/rbe

  - distcc - https://www.distcc.org/

  - ElectricAccelerator - https://docs.cloudbees.com/docs/cloudbees-build-acceleration/11.0/

  - and many others...
I've had mostly experience with IncrediBuild in the past, currently SN-DBS, but colleagues are looking into FASTBuild. Though my personal favorite is bazel

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: