My specific situation is that I'm training neural networks on a system which I would also like to use for other work. During the training of some models my PC sometimes doesn't respond for a few seconds, the frame-rate of even relatively light programs like my web-browser becomes unbearably low, and this is to the point where the PC is hardly usable.
This used to not be much of a problem as I was working with small models which would train in 10 minutes during which I could just take a break. But now I'm running into the problem that I have models which I need to train for multiple days, during which my PC is practically unusable.
The desired behavior would be that my 'normal' processes such as using my IDE, text editor or browser get full priority, while the task of training the neural net just gets the computing time that's left.
Is this at all possible in Ubuntu (I'm using 20.04 LTS in case that matters), and if so, how?