1

This is a followup question to my original question related to the Ubuntu 19.10 freeze where I had to restart the machine every time.

I looked up at my swapfile and it is of 2G size. I do have a 16G of RAM. But the memory that is being used by the swapfile is '0'. I don't understand what is going on with this.

$ swapon
        NAME      TYPE SIZE USED PRIO
        /swapfile file   2G   0B   -2
$ free    
              total        used        free      shared  buff/cache   available
    Mem:       16383568     2503164    11927228      477108     1953176    13073208
    Swap:       2097148           0     2097148

The following is the image. Can some one help me with this?

Update: The following are the version of the NVIDIA driver I have.

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 435.21       Driver Version: 435.21       CUDA Version: 10.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce RTX 2080    Off  | 00000000:08:00.0  On |                  N/A |
|  0%   49C    P8    17W / 225W |    394MiB /  7981MiB |      9%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1045      G   /usr/lib/xorg/Xorg                            24MiB |
|    0      1444      G   /usr/lib/xorg/Xorg                           101MiB |
|    0      1652      G   /usr/bin/gnome-shell                         206MiB |
|    0      6468      G   /usr/lib/firefox/firefox                       6MiB |
+-----------------------------------------------------------------------------+

Update 2: The following are the results of systcl vm.swappiness and grep -i swap /etc/fstab

~$ sysctl vm.swappiness
    vm.swappiness = 60
~$ grep -i swap /etc/fstab
    /swapfile                                 none            swap    sw              0       0

Update 3: Added the result for ls -al /usr/share/gnome-shell/extensions - Did not have the folder extensions under /.local/share/gnome-shell

$ ls -al /usr/share/gnome-shell/extensions
total 20
drwxr-xr-x 5 root root 4096 Oct 17  2019 .
drwxr-xr-x 6 root root 4096 Nov 27 09:32 ..
drwxr-xr-x 2 root root 4096 Oct 17  2019 desktop-icons@csoriano
drwxr-xr-x 3 root root 4096 Oct 17  2019 ubuntu-appindicators@ubuntu.com
drwxr-xr-x 3 root root 4096 Oct 17  2019 ubuntu-dock@ubuntu.com

Update 3: Here I am attaching the drivers I am using for the NVidia. I have tried 435 but I kept on seeing some display issues with it. They come and go. They are something like this.

enter image description here

Now I tried the 430 in the drivers section. This seems to work fine so far. I have seen those out of order pixels but very rarely. What could be the reason for this? And I tried installinng the newly release 440 drivers for the nVidia but it kept on failing and therefore as a lost resort I had to move back to 430.

enter image description here

  • You are not using swap which would be correct. As long as you are not trying to hibernate. Suspend should still work as it does not use swap. Better to just copy & paste terminal output & post that. Have you updated UEFI and if SSD, the SSD firmare? Did you install more than one nVidia driver? You have to purge before install, or else you get conflicts & weird results. – oldfred Apr 19 '20 at 19:08
  • @oldfred I have not updated the SSD firmware. I have installed onle one nVidia driver in the system. I have updated the question as you said. Could you take a look at it? – Baradwaj Aryasomayajula Apr 19 '20 at 21:58
  • Make sure you have latest UEFI firmware, there were issues last year and AMD published new UEFI that vendors then had to release. And updated SSD firmware is also a good idea. – oldfred Apr 19 '20 at 22:28
  • Edit your question and show me sysctl vm.swappiness, and grep -i swap /etc/fstab, and know that at https://www.geforce.com/drivers you'll find a newer 440.82 Nvidia driver that you can try. Report back. Start comments to me with @heynnema or I may miss them. – heynnema Apr 19 '20 at 22:34
  • Also show me ls -al ~/.local/share/gnome-shell/extensions and ls -al /usr/share/gnome-shell/extensions. – heynnema Apr 20 '20 at 01:16
  • @heynnema Thanks for responding. I have update the comments and I am about to install the 440.82 from the site. Should I purge or do some other activity before installing or the fie will take care of it? – Baradwaj Aryasomayajula Apr 20 '20 at 01:31
  • Your fstab, vm.swappiness, and gnome-shell/extensions all look fine. You could purge 435, but I'd just go ahead and install 440 and see if it helps. If you run into trouble, then purge all of the nvidia stuff and then reinstall 440. Do you have a HDD or SSD? If SSD, what brand? – heynnema Apr 20 '20 at 01:36
  • @heynnema Mine is a Samsung 860 1TB SSD. Will install the 440 and get back to you. – Baradwaj Aryasomayajula Apr 20 '20 at 01:48
  • @heynnema I tried updating the drivers to 440 but it kept failing. I used the existing drivers for now in the software and updates -> Additional Drivers secction of Ubuntu. I am attaching an image. Can you please take a look. – Baradwaj Aryasomayajula Apr 20 '20 at 12:47
  • @BaradwajAryasomayajula For your Samsung SSD, in Windows, download the "Samsung Magician" software, and check the firmware of the SSD. Regarding the Nvidia drivers, yes, they can be a pain. Switch to the nouveau driver, then do dpkg -l *nvidia* | grep ii and then sudo apt-get purge packagename to remove all of the Nvidia stuff, and retry 440. Report back. – heynnema Apr 20 '20 at 14:28

2 Answers2

2

I would say to just leave it as is. The swap file is a file stored on your hard drive or SSD that is used as a place for inactive data in your RAM when your system is running low on RAM. Also, by the looks of it, your system isn't using the swap file at all. This is because you probably aren't using that much RAM, so your system doesn't need to use the swap file. However, you should keep it to give your system a buffer if it's running low on RAM, just in case you ever do something RAM intensive. Besides, resizing/deleting your swap file is kind of complicated, and is only necessary for very specific use cases.

  • Thanks a lot for the comment. The reason I am worried is because, I might have to perform heavy calculations for my project. – Baradwaj Aryasomayajula Apr 20 '20 at 01:51
  • re: "The swap file is a file stored on your hard drive or SSD that is used as RAM when your system is running low on physical RAM. It basically acts like extra ram.". This is definitely incorrect. You don't understand what swap is and how it works. Swap is used to move active, but recently unneeded pages, out to swap, so that memory can be used for active, currently needed, pages, and then swaps pages back in as necessary. It's not an extension of memory, and running low on memory is not a prerequisite for using swap space. – heynnema Apr 20 '20 at 14:23
  • Okay, thanks for correcting me. Still though, I would suggest leaving the swap file as is unless you have a specific reason for changing it. – Drew Howden Tech Apr 23 '20 at 13:52
1

I think your issue on update 3 is that you are using the proprietary NVIDIA driver. In my experience, open-source Linux drivers tend to be more stable than their proprietary counterparts. Also, I find that despite what most of the Linux community tells you, games have the exact same performance no matter what driver you are using (proprietary or open source). So I would suggest switching back to the open source driver, and seeing how well the display works after that.