Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
dream of how a kernel for GPU will be written
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 383

PostPosted: Wed Jan 15, 2025 1:23 pm    Post subject: dream of how a kernel for GPU will be written Reply with quote

I would like to hear the opinion of guys who are familiar with GPU. If I suddenly decided to write an OS that runs on GPU and used a process tree called for example GTR_dinamic, whose number of leaves would be equal to the number of maximum possible threads on GPU, and the root would be a process that could only be terminated by the Power off command. That is, it would be a correct tree, the root of which would be at the bottom, and all processes would go to it. What problems would I encounter with such an approach?

Last edited by Gentoopc on Wed Jan 15, 2025 1:41 pm; edited 2 times in total
Back to top
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 383

PostPosted: Wed Jan 15, 2025 1:34 pm    Post subject: Re: the dream of how the Linux kernel would work on a GPU Reply with quote

Gentoopc wrote:
and any binary tree could simply be mounted to GTR_dinamic_ as a branch to such a tree. and such mounting could be done by the process scheduler

Last edited by Gentoopc on Wed Jan 15, 2025 1:42 pm; edited 1 time in total
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9622
Location: beyond the rim

PostPosted: Wed Jan 15, 2025 1:41 pm    Post subject: Reply with quote

Quote:
If I suddenly decided to write an OS that runs on GPU


You would run into an instant roadblock as a GPU isn't capable to host an OS.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54699
Location: 56N 3W

PostPosted: Wed Jan 15, 2025 1:45 pm    Post subject: Reply with quote

Gentoopc,

How would you start such an operating system in today's hardware?
The GPU is not started until well after the CPU is running the kernel.

Then the GPU/RAM link is over PCIe, which is horribly slow compared to the CPU/RAM interface.

I think you will have the same problem as that which sank Intels Itanic :)
Lack of backwards compatibility.

There's more like that too.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 383

PostPosted: Wed Jan 15, 2025 1:51 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Gentoopc,


There's more like that too.


no. the GPU already has everything it needs including the BIOS. I'm talking about the OS from the very beginning. and I think that such an approach to the process system could just make it compatible with the Linux kernel. that is, you need to write a meta kernel that will allow you to run the Linux kernel. it's possible that it won't even be needed. maybe there will be a GENTOO kernel.
Back to top
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 383

PostPosted: Wed Jan 15, 2025 1:53 pm    Post subject: Reply with quote

Genone wrote:
Quote:
If I suddenly decided to write an OS that runs on GPU


You would run into an instant roadblock as a GPU isn't capable to host an OS.


you just need to write an operating system that can run on a GPU. you just need a different logic. if they could write an OS for a CPU, why can't they do it for a GPU? now people have an understanding of how things work. do you really think that people can't make a GPU display an interface similar to the bash interface? i'm talking about an OS from scratch.
Back to top
View user's profile Send private message
pingtoo
Veteran
Veteran


Joined: 10 Sep 2021
Posts: 1396
Location: Richmond Hill, Canada

PostPosted: Wed Jan 15, 2025 1:57 pm    Post subject: Re: dream of how a kernel for GPU will be written Reply with quote

Gentoopc wrote:
I would like to hear the opinion of guys who are familiar with GPU. If I suddenly decided to write an OS that runs on GPU and used a process tree called for example GTR_dinamic, whose number of leaves would be equal to the number of maximum possible threads on GPU, and the root would be a process that could only be terminated by the Power off command. That is, it would be a correct tree, the root of which would be at the bottom, and all processes would go to it. What problems would I encounter with such an approach?


Usually you need to write a boot loader who in term can load OS binary (kernel) to GPU.

In other work you need to write a small program that will initialise BUS and possibly initialise some RAM and some I/O port to facilitate human communication (as you want to be able to understand what you small binary is doing). This program will be very hardware specific so you will need to know your target hardware.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54699
Location: 56N 3W

PostPosted: Wed Jan 15, 2025 2:05 pm    Post subject: Reply with quote

Gentoopc,

The GPU has enough BIOS to initialise itself, that's it.

The CPU firmware does much more, like sets up memory timing and drive strengths, by trial and error from DDR3 or.
Looks around the system to see what is connected where and eventually, loads a boot loader/kernel.
The GPU can do none of that but its all required before the GPU can start.

If you are suggesting a whole new architecture, replacing the current CPU with a GPU, then maybe it can be made to work.
Then we are back to the Itanic. Nobody will use it because there is no software.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 383

PostPosted: Wed Jan 15, 2025 3:03 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Gentoopc,

The GPU has enough BIOS to initialise itself, that's it.

The CPU firmware does much more, like sets up memory timing and drive strengths, by trial and error from DDR3 or.
Looks around the system to see what is connected where and eventually, loads a boot loader/kernel.
The GPU can do none of that but its all required before the GPU can start.

If you are suggesting a whole new architecture, replacing the current CPU with a GPU, then maybe it can be made to work.
Then we are back to the Itanic. Nobody will use it because there is no software.


I will say more, that it is possible. to write a real-time kernel for GPU is just terrifying. I was also interested in whether it is possible to run the existing Linux kernel on GPU and people say that it is possible, but the kernel needs strong modification, and there will be a problem with GPU registers. I think that the real-time kernel is the best option, it filled a niche that is empty now. and on CPU its filling is not so interesting. unfortunately people are wasting time, and this is something that cannot be replenished. people persist and do not understand that now corporations have more important things to do. but soon they will solve them, and then we will not have a single chance to do what we want. there is some time, we need to keep up.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum