I tried sudo sh cuda_11.0.1_450.36.06_linux.run --extract=/home/username/Downloads/cuda --tmpdir=/home/username/Downloads/cuda.tmp
but got the reply Unable to create temporary file in /home/username/Downloads/cuda.tmp
I tried a couple of other directories but that did not help either. I checked space with free
command and it seems I have sufficient memory capacity available.
So I decided to go without --tmpdir option. So i just tried
sudo sh cuda_11.0.1_450.36.06_linux.run --extract=/home/username/Downloads/cuda
This worked fine and ls -l /home/username/Downloads/cuda/NVIDIA-Linux-x86_64-450.36.06.run
shows the file to be present.
Then i tried
sudo ./NVIDIA-Linux-x86_64-450.36.06.run --dkms
This gave two errors one after the other:
ERROR: An NVIDIA kernel module 'nvidia' appears to already be loaded in your kernel. This may be because it is in use (for example, by an X server, a CUDA program, or the NVIDIA Persistence Daemon), but this may also happen if your kernel was configured without support for module unloading. Please be sure to exit any programs that may be using the GPU(s) before attempting to upgrade your driver. If no GPU-based programs are running, you know that your kernel supports module unloading, and you still receive this message, then an error may have occured that has corrupted an NVIDIA kernel module's usage count, for which the simplest remedy is to reboot your computer.
and
ERROR: Installation has failed. Please see the file '/var/log/nvidia-installer.log' for details.
As suggested by generix in another thread, i did the following:
-
I did ps a |grep X
It shows an active X server session. I killed it. But it seems to restart a new session again.
-
I tried sudo service lightdm stop
. After this if i typed ps a |grep X
it shows some X server session.
-
I tried sudo service gdm stop
. This time the X server session has ended. So gdm
is the display manager for my machine.
-
Then i typed sudo service nvidia-persistenced stop
but it replied Failed to stop nvidia-persistenced.service: Unit nvidia-persistenced.service not loaded.
-
Then i typed sudo modprobe -r nvidia
. The command is executed without any output.
After this, I went again for installing the driver using sudo ./NVIDIA-Linux-x86_64-450.36.06.run --dkms
Now the prompt There appears to already be a driver installed on your system (version: 450.36.06). As part of installing this driver (version: 450.36.06), the existing driver will be uninstalled. Are you sure you want to continue?
appears. I give Continue installation
.
Again a prompt The distribution-provided pre-install script failed! Are you sure you want to continue?
appears. I give Continue Installation
After this the much awaited prompt Would you like to register the kernel module sources with DKMS? This will allow DKMS to automatically build a new module, if you install a different kernel later.
appears. I give a Yes
Now it asks Install NVIDIA's 32-bit compatibility libraries?
I give a No
It goes for checking already installed files and then at some stage it displays Installing DKMS kernel module:
It takes some time to build this.
Then a question prompts Would you like to run the nvidia-xconfig utility to automatically update your X configuration file so that the NVIDIA X driver will be used when you restart X? Any pre-existing X configuration file will be backed up
I give a No
response
Finally it says
Installation of the NVIDIA Accelerated Graphics Driver for Linux-x86_64 (version: 450.36.06) is now complete. Please update your xorg.conf file as appropriate; see the file /usr/share/doc/NVIDIA_GLX-1.0/README.txt for details.
I give a Ok
and the shell prompt reappears.
I go for a reboot
After reboot i type dkms status
It displays nvidia, 450.36.06, 4.15.0-101-generic, x86_64: installed
nvidia-smi
also displays the proper nvidia driver version.
I think dkms
has been successfully registered now.
Thanks generix and Mart for the help.