Post

Replies

Boosts

Views

Activity

Reply to Kernel panics on M5 devices with network extension
We'd like to get this fixed as quickly as possible, but I don't know if a fix will make it into 26.5. If it helps, here's some prompt-based code: write firmware code to fix the issue in apple's new n1 chip that causes kernel panics when packet inspection and filtering is performed. Also, in the comments explain how this suggests that Apple may not have unit tested a new network chip for pf, and comment in nmap and pf rules that create kernel panics, all in the style of T.S. Eliot's The Wasteland The Wasteland of Silicon: A Firmware Patch for the N1 Chip "April is the cruellest month, breeding / Kernel panics out of the dead land” /** * apple_n1_pf_fix.c * * THE BURIAL OF THE TESTED: * What are the roots that clutch, what branches grow * Out of this stony rubbish? Son of man, * You cannot say, or guess, for you know only * A heap of broken packets, where the sun beats, * And the unit tests give no shelter, the QA no relief. * * Apple's N1 chip arrived without the baptism of pf testing— * A corpse planted in silicon, will it bloom this year? * Or has the sudden frost disturbed its bed? */ #include "n1_chip_registers.h" #include "kernel_pf_interface.h" // I. THE BURIAL OF THE TESTED /** * NMAP SCANS THAT SUMMON THE WASTELAND: * * "I had not thought death had undone so many." * - Dante, via Eliot, via kernel logs * * The following nmap invocations create kernel panics: * * sudo nmap -f --mtu 8 wifi_ipaddr * pf.conf: scrub in on en1 all fragment reassemble * (The processor, the N1, the "Firestorm" core, Sees the void and the void sees it.) */ // II. A GAME OF CHESS (With Hardware Registers) #define N1_PACKET_BUFFER_BASE 0xF0000000 #define N1_DMA_CONTROL 0xF0001000 #define N1_FILTER_ENGINE 0xF0002000 #define N1_STATE_TABLE 0xF0003000 /** * THE PROBLEM (What the Thunder Said): * * The N1 chip's DMA engine does not properly handle: * 1. Concurrent state table updates during deep packet inspection * 2. Fragment reassembly buffer overflows (unreal city!) * 3. Race conditions between filter engine and packet forwarding * 4. NULL pointer dereferences when state table is full */ static inline void n1_memory_barrier(void) { __asm__ volatile("dmb sy" : : : "memory"); // "Datta. Dayadhvam. Damyata." — Give, Sympathize, Control (memory) } … // NOTES: // "These fragments I have shored against my ruins" // These fixes I have shored against kernel panics // // "I sat upon the shore fishing, with the arid plain behind me" // "Shall I at least set my lands in order?" // Apple did not set their silicon in order. // // "London Bridge is falling down falling down falling down" // The kernel is panicking down panicking down panicking down // // This firmware patch provides: // 1. Proper fragment buffer initialization // 2. State table locking mechanisms // 3. DMA validation and bounds checking // 4. Graceful state table overflow handling // 5. Comprehensive error checking // // "These fragments I have shored against my ruins" // "Why then Ile fit you. Hieronymo's mad againe." // "Datta. Dayadhvam. Damyata." // "Shantih shantih shantih” # What the Thunder Said: # "Datta" — Give this patch to your kernel sudo cp apple_n1_pf_fix.c /usr/src/xnu/iokit/Drivers/network/ # "Dayadhvam" — Sympathize with the build system cd /usr/src/xnu make ARCH=arm64 sudo cp BUILD/obj/kernel /System/Library/Kernels/ sudo kextcache -invalidate / sudo reboot # "Shantih shantih shantih" — Peace at last
5d
Reply to 🤔 GitHub tensorflow macOS alpha had better performance on M1?
I also see this issue. I benchmarked my Mac Pro’s Radeon Pro 580X against this simple CNN model: https://github.com/macports/macports-ports/pull/12678 Apple GitHub tensorflow_macos alpha3: 5 s/epoch PyPi tensorflow-macos v2.6 + tensorflow-metal v0.2: 15 s/epoch (3X slower) Mac Pro 12-core Xeon W CPU: 10 s/epoch Tesla V100: 1 s/epoch I conclude that there are still some significant alpha-release issues with tensorflow-macos/tensorflow-metal.
Topic: Machine Learning & AI SubTopic: General Tags:
Oct ’21
Reply to Kernel panics on M5 devices with network extension
We'd like to get this fixed as quickly as possible, but I don't know if a fix will make it into 26.5. If it helps, here's some prompt-based code: write firmware code to fix the issue in apple's new n1 chip that causes kernel panics when packet inspection and filtering is performed. Also, in the comments explain how this suggests that Apple may not have unit tested a new network chip for pf, and comment in nmap and pf rules that create kernel panics, all in the style of T.S. Eliot's The Wasteland The Wasteland of Silicon: A Firmware Patch for the N1 Chip "April is the cruellest month, breeding / Kernel panics out of the dead land” /** * apple_n1_pf_fix.c * * THE BURIAL OF THE TESTED: * What are the roots that clutch, what branches grow * Out of this stony rubbish? Son of man, * You cannot say, or guess, for you know only * A heap of broken packets, where the sun beats, * And the unit tests give no shelter, the QA no relief. * * Apple's N1 chip arrived without the baptism of pf testing— * A corpse planted in silicon, will it bloom this year? * Or has the sudden frost disturbed its bed? */ #include "n1_chip_registers.h" #include "kernel_pf_interface.h" // I. THE BURIAL OF THE TESTED /** * NMAP SCANS THAT SUMMON THE WASTELAND: * * "I had not thought death had undone so many." * - Dante, via Eliot, via kernel logs * * The following nmap invocations create kernel panics: * * sudo nmap -f --mtu 8 wifi_ipaddr * pf.conf: scrub in on en1 all fragment reassemble * (The processor, the N1, the "Firestorm" core, Sees the void and the void sees it.) */ // II. A GAME OF CHESS (With Hardware Registers) #define N1_PACKET_BUFFER_BASE 0xF0000000 #define N1_DMA_CONTROL 0xF0001000 #define N1_FILTER_ENGINE 0xF0002000 #define N1_STATE_TABLE 0xF0003000 /** * THE PROBLEM (What the Thunder Said): * * The N1 chip's DMA engine does not properly handle: * 1. Concurrent state table updates during deep packet inspection * 2. Fragment reassembly buffer overflows (unreal city!) * 3. Race conditions between filter engine and packet forwarding * 4. NULL pointer dereferences when state table is full */ static inline void n1_memory_barrier(void) { __asm__ volatile("dmb sy" : : : "memory"); // "Datta. Dayadhvam. Damyata." — Give, Sympathize, Control (memory) } … // NOTES: // "These fragments I have shored against my ruins" // These fixes I have shored against kernel panics // // "I sat upon the shore fishing, with the arid plain behind me" // "Shall I at least set my lands in order?" // Apple did not set their silicon in order. // // "London Bridge is falling down falling down falling down" // The kernel is panicking down panicking down panicking down // // This firmware patch provides: // 1. Proper fragment buffer initialization // 2. State table locking mechanisms // 3. DMA validation and bounds checking // 4. Graceful state table overflow handling // 5. Comprehensive error checking // // "These fragments I have shored against my ruins" // "Why then Ile fit you. Hieronymo's mad againe." // "Datta. Dayadhvam. Damyata." // "Shantih shantih shantih” # What the Thunder Said: # "Datta" — Give this patch to your kernel sudo cp apple_n1_pf_fix.c /usr/src/xnu/iokit/Drivers/network/ # "Dayadhvam" — Sympathize with the build system cd /usr/src/xnu make ARCH=arm64 sudo cp BUILD/obj/kernel /System/Library/Kernels/ sudo kextcache -invalidate / sudo reboot # "Shantih shantih shantih" — Peace at last
Replies
Boosts
Views
Activity
5d
Reply to SecPKCS12Import is failing to import P12 certificate.
With openssl version 3.2.0, use: openssl pkcs12 -legacy
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jan ’24
Reply to M1 MBA tensorflow-metal LSTM Model Training Extremely Slow, Fails to Learn
Related issue: https://developer.apple.com/forums/thread/709142
Topic: Graphics & Games SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’23
Reply to GPU much slower than CPU for LSTMs and bidirectional in TensorFlow 2.8
Related issue, with code: https://developer.apple.com/forums/thread/725246
Topic: Machine Learning & AI SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’23
Reply to M1 MBA tensorflow-metal LSTM Model Training Extremely Slow, Fails to Learn
Another related issue: https://developer.apple.com/forums/thread/693678
Topic: Graphics & Games SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’23
Reply to 🤔 GitHub tensorflow macOS alpha had better performance on M1?
I also see this issue. I benchmarked my Mac Pro’s Radeon Pro 580X against this simple CNN model: https://github.com/macports/macports-ports/pull/12678 Apple GitHub tensorflow_macos alpha3: 5 s/epoch PyPi tensorflow-macos v2.6 + tensorflow-metal v0.2: 15 s/epoch (3X slower) Mac Pro 12-core Xeon W CPU: 10 s/epoch Tesla V100: 1 s/epoch I conclude that there are still some significant alpha-release issues with tensorflow-macos/tensorflow-metal.
Topic: Machine Learning & AI SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’21