fix kt-kernel installation issue (#1603)

* update README for kt-kernel for installation issues

* update install.sh

* update install.sh

* update install.sh

* update install.sh

* update install.sh

* update README

* fix sudo issue

* fix install issue

* fix import issue

* fix import issue

* update install.sh

* fix import issue

* fix import issue

* fix import issue

* update README

* update install

* update install
This commit is contained in:
Jiaqi Liao 2025-11-12 15:56:02 +08:00 committed by GitHub
parent 26b86aa96b
commit 02801c3c4e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 332 additions and 32 deletions

View file

@ -12,6 +12,7 @@
#include <numa.h>
#include <cstdio>
#include <errno.h>
size_t MemoryRequest::total_size() {
size_t total = 0;
@ -53,12 +54,15 @@ void SharedMemBuffer::alloc(void* object, MemoryRequest requests) {
if (buffer) {
free(buffer);
}
buffer = std::aligned_alloc(64, total_size);
if (!buffer) {
printf("cannot aligned alloc %ld bytes\n", total_size);
perror("aligned_alloc"); // errno == ENOMEM/EINVAL
void* newbuf = nullptr;
int rc = posix_memalign(&newbuf, 64, total_size);
if (rc != 0 || !newbuf) {
errno = rc; // posix_memalign returns error code instead of setting errno
printf("cannot aligned alloc %zu bytes (align=%d)\n", (size_t)total_size, 64);
perror("posix_memalign"); // ENOMEM/EINVAL
exit(1);
}
buffer = newbuf;
size = total_size;
for (auto& req : object_requests) {
req.update_base_ptr(buffer);