Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
No need for schedulers?
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
This topic is locked: you cannot edit posts or make replies.    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
stefan11111
l33t
l33t


Joined: 29 Jan 2023
Posts: 949
Location: Romania

PostPosted: Sun Jan 19, 2025 6:00 pm    Post subject: Reply with quote

Gentoopc wrote:

Now I will try to say the main thing

we need to run two functions in parallel

Code:
 
foo();
foo1();



this will be impossible on the CPU because the code is executed line by line. first foo() will be called; then foo1(); to solve this problem we need a new programming language and changes to the CPU components, but no one will do this, it is expensive and you are right when you said that you and we do not have such an opportunity.

I made a post about this when you hit report instead of quote, but I will make another one.

What you seem to be implying is that when running on a GPU, everything can magically become parallel.
So you would want to have a language for the GPU where every instruction is by default executed in parallel.

Think of the following:
Code:

int x = 0;
x++;
x = 2;


What is the value of x after running everything in parallel?
if x++; is run first, then x = 2; x will be 2.
if x = 2; is run first, then x++; x will be 3.
This is ignoring the fact that x++ is not atomic.

Here's another problem, a classical one:
Code:

int x = 0;
int i;
int j;

for(i = 1; i <= 1000; i++) {
    x++;
}

for (j = 1; j <= 1000; j++){
    x++;
}

This also runs into problems if you run these loops in parallel.
When running on a single thread, the value of x should be 2000 after the for loops are finished.
What if, on a particular iteration, you read x on the first thread, read x on the second thread, increment x on the first thread, increment x on the second thread.
Then, after these 2 x++; are run, the value of x is only increased once, by 1.

As you see, writing parallel programs is not as simple as: 'take a serial program and give each instruction a thread'

Now, with the above example, you could use locks, such that only one thread modifies x at any time.
If you do that, on a CPU, you will see that it takes ages for the program to complete.
This is because the locking/unlocking introduces way more overhead than is saved by the extra thread.

Now, imagine doing this on a GPU, which has slower individual cores than a CPU.
The program would run even slower.

What I'm trying to say is that throwing threads at a program does not necessarily make it faster and has to be done with care to avoid races.
Would you get any advantage running a kernel on a GPU instead of a CPU?
Most likely not, as very few things are parallelizable.
Would you get any advantage running an irc client, a web browser, etc, on a GPU?
Again, most likely not.
But you would for sure have the disadvantage of weaker cores that a CPU.

Now, multiplying 1000000 matrices with 1000000 other matrices in parallel?
Then yes, you should do that on a GPU. The overhead of the weaker cores is massively outweighed my the number of cores you can use at once.
This is what a GPU is designed to do.

So throwing more threads at all programs and writing a language where every instruction is run in parallel would definitely not make all programs faster, and would break most of them.
Some programs are easily parallelizable, but most aren't.
_________________
My overlay: https://github.com/stefan11111/stefan_overlay
INSTALL_MASK="/etc/systemd /lib/systemd /usr/lib/systemd /usr/lib/modules-load.d *udev* /usr/lib/tmpfiles.d *tmpfiles* /var/lib/dbus /usr/bin/gdbus /lib/udev"
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3911
Location: Rasi, Finland

PostPosted: Sun Jan 19, 2025 7:43 pm    Post subject: Reply with quote

logrusx wrote:
Zucca wrote:
Only one area I could see where kernel could possibly utilize GPU is networking tasks.


GPU is totally unfit to handle such tasks.
Well. I have to say I'm no expert on this field at all, but have a look at this.
I don't really know how much is possible to do with GPU regarding network packets. But at least something.
_________________
..: Zucca :..

My gentoo installs:
init=/sbin/openrc-init
-systemd -logind -elogind seatd

Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2675

PostPosted: Sun Jan 19, 2025 7:56 pm    Post subject: Reply with quote

Zucca wrote:
logrusx wrote:
Zucca wrote:
Only one area I could see where kernel could possibly utilize GPU is networking tasks.


GPU is totally unfit to handle such tasks.
Well. I have to say I'm no expert on this field at all, but have a look at this.
I don't really know how much is possible to do with GPU regarding network packets. But at least something.


All examples given pertain to processing large amounts of data or just fast processing of data.

  • Morpheus AI:
    Quote:
    NVIDIA Morpheus is a performance-oriented, application framework that enables cybersecurity developers to create fully optimized AI pipelines for filtering, processing, and classifying large volumes of real-time data.

  • Line-rate radar signal processing: signal processing. What more can I say about it?
  • Real-time DSP services over GPU: signal processing again.


Nothing networking here. Only very fast data analysis/calculations and the fast transfer of data to the GPU which I think nowadays is just a side effect of using PCI Express. Back in the old days it was AGP which had only one way of fast transfer of data i.e. CPU->GPU. And before that it was just PCI or even earlier - ISA. I have a recollection of having Voodo II somehow intercepting the output or a regular 2D graphics card, but I wasn't that interested in how things worked exactly those days.

Best Regards,
Georgi

p.s. signal processing is not the best utilization of a GPU. For as long as the processing is simple, the only advantage is the very high speed because signal processing is sequential in nature. It always depends on past values/results. I can think of a few applications for filters which can use large matrices, but I still see limited use. Maybe I'm wrong about that but more or less - that's it. But if the signal gets complex and therefore its processing gets complex, you're loosing the speed, which at a first glance is the only benefit. Or maybe processing multiple streams at once.

Still, all listed are very specialized tasks and have nothing to do with handling network operations, but transferring data from the NIC to the GPU. It also looks like NVIDIA pushing AI and similar stuff that cells their GPU's. Marketing hype, nothing more.


Last edited by logrusx on Sun Jan 19, 2025 8:39 pm; edited 1 time in total
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3911
Location: Rasi, Finland

PostPosted: Sun Jan 19, 2025 8:38 pm    Post subject: Reply with quote

Took some time to find it, but I knew I read somewhere long ago about gpgpu packet filtering. So the link I posted wasn't what I remembered, that's indeed something different.

I believe it was this, what I was remembering. Well... It's a research paper. Looks like they got the concept working. What remains is real world implementation. I haven't seen one, but although, I haven't been actively looking for one.
_________________
..: Zucca :..

My gentoo installs:
init=/sbin/openrc-init
-systemd -logind -elogind seatd

Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2675

PostPosted: Sun Jan 19, 2025 8:53 pm    Post subject: Reply with quote

Zucca wrote:
Took some time to find it, but I knew I read somewhere long ago about gpgpu packet filtering. So the link I posted wasn't what I remembered, that's indeed something different.

I believe it was this, what I was remembering. Well... It's a research paper. Looks like they got the concept working. What remains is real world implementation. I haven't seen one, but although, I haven't been actively looking for one.


Unfortunately, there's specialized hardware for that too. And it's much more CPU like wrt it can run a normal OS and no one is in the rush to use GPU's to replace it, which kind of proves my point. Note that it's expensive too and if it was more efficient to do it on the GPU people would have already switched.

I'll give it the benefit of the doubt, but I want to see it first. Also the paper is from 2013. GPU's have progressed immensely since then. I bet it would have been already the norm if it was viable.

Best Regards,
Georgi
Back to top
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 412

PostPosted: Mon Jan 20, 2025 7:26 am    Post subject: Reply with quote

Zucca wrote:
Only one area I could see where kernel could possibly utilize GPU is networking tasks.

you are right, huge flows of information are transmitted over networks. some servers simply choke. and in this case 1024 cores are better than 32. I do not argue that you can scale servers, but the price of a xeon processor with 64 cores and a GPU with 1024 cores is different, it is in favor of the GPU. and no matter how anyone wants it, but Internet networks will be tied to AI. xeon is not suitable for these purposes.
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3911
Location: Rasi, Finland

PostPosted: Mon Jan 20, 2025 7:42 am    Post subject: Reply with quote

It, however, looks like network packet manipulation is nowdays handled by DPUs or FPGAs.
Since while GPU could be powerful in simple packet manipulation tasks, DPUs are specifically made to do that exact thing, and FPGAs can be optimized.
_________________
..: Zucca :..

My gentoo installs:
init=/sbin/openrc-init
-systemd -logind -elogind seatd

Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 412

PostPosted: Mon Jan 20, 2025 7:44 am    Post subject: Reply with quote

stefan11111 wrote:
.


Now I understand why we have nothing good in this direction. You find a problem but do not solve it, you just tell everyone about it and its complexity. Now you can run a function on the GPU in several threads at the same time, in parallel. Personally, I use it, but in my tasks I always have to return the result to the CPU. This kills everything. A CPU in which you can run functions in different threads, but not in parallel, you can only do it sequentially. If all the software ran on the GPU, this would not have happened. The problem of parallel computing exists, but this does not mean that they are not needed. The fact that you are sharpened and can program only on the CPU and cannot think how to implement it on the GPU does not mean that we should all refuse and not develop parallel computing. They are needed, and new algorithms are needed. You are just scared to hear about it and you are trying to find a hundred reasons not to deal with it. You would rather sit on an 8-core Xeon all your life just because you know how to write software for it.
Back to top
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 412

PostPosted: Mon Jan 20, 2025 7:58 am    Post subject: Reply with quote

logrusx wrote:

GPU is totally unfit to handle such tasks.

[/quote]

you are amateurs. I see it now. in some countries there is strong censorship, and all traffic is checked. for this you need huge computing capabilities. and if you want to enter this area in such a country you will have to follow their laws, you will install the software that they say, and perhaps this software will require huge computing capabilities. xeon will not suit you here. you are naive village guys who want to find many reasons to confirm that old hardware is better than new. this is the main philosophy of linux.
Back to top
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 412

PostPosted: Mon Jan 20, 2025 8:14 am    Post subject: Reply with quote

Zucca wrote:

some kind of nonsense is happening. I have to explain the basics of parallel programming to people who do not know how to do it, who are used to programming only for one CPU core, I have to explain and show them all the advantages of parallel computing so that they pay attention to the GPU and want to see Linux on the GPU. I have to tell others how good it is to have a server on the GPU with 6000 CUDA core and that it is better than 8 AMD CPU cores. Guys, we simply must do everything to switch to a new kernel that will work on the GPU. This kernel must be real-time. We need to take into account all the mistakes of the past. The Linux kernel may soon come under the control of Microsoft, please do not be surprised at this, I already reminded you of the case with the Russian developers, which best showed who we all are for Linux Torvalds, and that he can do anything. Maybe I was wrong and you are not the people who want to live freely. Then I will not be able to get through to you. Slaves do not want to listen to anything. The owners have already decided everything for them. xeon and epyc.
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3911
Location: Rasi, Finland

PostPosted: Mon Jan 20, 2025 8:52 am    Post subject: Reply with quote

Since you're going all-in conspiracy theory and you're unwilling to accept that GPUs cannot be programmed like CPUs... I'm out.

We've been here before.
_________________
..: Zucca :..

My gentoo installs:
init=/sbin/openrc-init
-systemd -logind -elogind seatd

Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 412

PostPosted: Mon Jan 20, 2025 8:54 am    Post subject: Reply with quote

Gentoopc wrote:


and apparently the main thing that I said, but maybe missed, but it is worth considering that Microsoft and Google are trying to buy and absorb all the small centers in which AI can originate. They are buying up all the startups. Only they will have legal rights to do this. What can we oppose them? There must be a community that will have the opportunity, at least the tools for working and deploying AI. When everything is closed, and novice programmers in this area will not be able to realize their ideas, due to the fact that there will be no tool and environment in which this can be done, what will be left for them? Use the tools of corporations? But will it not happen that what is done with the help of their tools will belong to them? This has already been said. And so adults just sit and do nothing. What are you waiting for? Are you waiting for a miracle? If not here, then where should that free space appear where ideas can be realized that will not be bought by corporations for pennies or selected in accordance with licensing agreements?
Back to top
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 412

PostPosted: Mon Jan 20, 2025 9:03 am    Post subject: Reply with quote

Zucca wrote:
Since you're going all-in conspiracy theory and you're unwilling to accept that GPUs cannot be programmed like CPUs... I'm out.

We've been here before.


There is no conspiracy theory. There are only facts. And I have already given them. And I will voice them to you once again: Linux Torvalds kicked out the kernel developers like dogs. It clearly showed who is the boss and he will dispose of his property as he sees fit. Perhaps the kernel will go to Microsoft. It is just not ready yet, in terms of games. Other facts, that all the cents where a new AI trend can arise are bought, this is also a fact. There is no conspiracy theory here. And yes, you can go. But where will you go? You are just little children who want to hide from problems. Well, good luck to you.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Mon Jan 20, 2025 10:11 am    Post subject: Reply with quote

Gentoopc,

Your 'facts' are worthless without some supporting citations.
Until you provide those references, your 'facts' are only assertions or even only opinions.
_________________
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: 412

PostPosted: Mon Jan 20, 2025 10:30 am    Post subject: Reply with quote

NeddySeagoon wrote:
Gentoopc,

Your 'facts' are worthless without some supporting citations.
Until you provide those references, your 'facts' are only assertions or even only opinions.


to whom and why should I prove anything? those people who can change something and have the knowledge that could create a real-time microkernel for GPU know that I am telling the truth, because they are in the know about what is happening. others can find information on what I have said. this information is available. if I wanted to convince someone of something, I would of course try to be convincing and provide links. but I just want you to understand the problem that awaits us, and that simply burying your head in the sand is not the way out. we must free ourselves from the burden of obligations that they impose on us in the form of license agreements. we pay money for hardware and we can use this hardware. we need to make a real-time microkernel that can work independently on their hardware without any firmware. the kernel must work with the hardware directly, that is why it is the kernel. and I think this approach, when you have space in the future, will force them to reconsider many things, and not do whatever they want. the free community has to come up with something, and that something has to be significant. switching to gpu lays the foundation for everything. you can implement many things without having millions of dollars. you don't even need to reinvent the wheel. everything is there. you just need to set the right priorities. if you think this is stupid, then there really is nothing more to talk about.
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2675

PostPosted: Mon Jan 20, 2025 10:32 am    Post subject: Reply with quote

I'm willing to admit I might be partially wrong about some stuff. There still might be good use cases for the GPU outside of what it was initially designed for.

However the general idea I stand behind is correct. A GPU is not capable of hosting a kernel. Whatever kind of it. It's highly parallel, but that also makes it's less sequential. And that can't change, because this is embedded in the hardware. Whoever has programmed an FPGA and dealt with the problem what to use the triggers for - memory or logic, understands what I'm talking about. More logic - faster and more parallel and more memory - slower and more sequential the program should be. Still the number of triggers is the same and you should make a compromise between the two.

Also the GPU can't drive itself. It needs an OS running on a CPU to drive it and to drive the tasks that can be offloaded. It's a co-processor. Some of us remember the times of co-processors. There were SX and DX processors(386 and 486, I don't remember what the situation with 8086 and 286 was), the latter containing additional circuitry for arithmetic operations, which made it faster overall. There were co-processors sold as a separate part you could fit on the motherboard or even in-between the CPU and the socket. I hesitate to say those were ALU's because I don't really remember if they were just an addition to the ALU.

If the GPU was to change more toward being able to host a kernel and conduct more general tasks, that would defeat the purpose of it being specialized, it being a G(raphic) PU. That would make it less specialized and more general purpose, less efficient with the tasks it can now handle with ease. That would make it less GPU and more CPU.

The models of the CPU and GPU are fundamentally different. One must be universal and the other - specialized.

Best Regards,
Georgi
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Mon Jan 20, 2025 10:36 am    Post subject: Reply with quote

Gentoopc,

If you wish to engage in a serious debate, by providing some supporting evidence for your technical position, this topic can be unlocked.
While you keep going over the same, so far, baseless claims, over and over, its time to stop.
_________________
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
Display posts from previous:   
This topic is locked: you cannot edit posts or make replies.    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
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