Installing CUDA 11.1 on Ubuntu 20.04 for NVIDIA GeForce 1650 Ti (notebook)

Mona_Jalal: <p><strong>TLDR: I need CUDA 11.1 for torch 1.8. I cannot install CUDA 11.1</strong></p>
<p>I purged everything related to cuda/nvidia and installed the nvidia driver for 1650 Ti (notebook) from scratch from NVIDIA Website and again it installed cuda 11.2 for me while I do need CUDA 11.1 for PyTorch 1.8 GPU version.  How can I install CUDA 11.1 in Ubuntu 20.04 for NVIDIA GeForce 1650 Ti (notebook) GPU?</p>
<p>$ sudo apt-get --purge remove “<em>cublas</em>” “cuda*” “nsight*”</p>
<pre><code>$ sudo apt-get --purge remove "*nvidia*"
$ sudo rm -rf /usr/local/cuda*
$ sudo apt-get autoclean
$ sudo apt-get autoremove
$ sudo apt-get purge nvidia*
</code></pre>
<p>Downloaded the CUDA 11.1 from NVIDIA Website:</p>
<pre><code>$ wget https://developer.download.nvidia.com/compute/cuda/11.1.0/local_installers/cuda_11.1.0_455.23.05_linux.run
</code></pre>
<p>Downloaded the NVIDIA driver for 1650 Ti (notebook) for Linux 64 bit from NVIDIA Website and:</p>
<pre><code>$ sudo init 3
</code></pre>
<p>then installed the nvidia driver</p>
<pre><code>$ ./NVIDIA-Linux-x86_64-460.56.run

$ reboot
</code></pre>
<p>then in ubuntu gui terminal</p>
<pre><code>mona@goku:~$ sudo sh cuda_11.1.0_455.23.05_linux.run
[sudo] password for mona:
Installation failed. See log at /var/log/cuda-installer.log for details.
The log in vi /var/log/nvidia-installer.log reads as:
ERROR: Installation has failed. Please see the file '/var/log/nvidia-installer.log' for details. You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com.
</code></pre>
<p>After the nvidia-driver is installed, even without installing CUDA 11.1 that I downloaded I see that version 11.2 for cuda is installed</p>
<pre><code>$ nvidia-smi
Fri Mar 5 20:16:41 2021
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.56 Driver Version: 460.56 CUDA Version: 11.2 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 GeForce GTX 165... Off | 00000000:01:00.0 Off | N/A |
| N/A 39C P8 3W / N/A | 10MiB / 3911MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 1173 G /usr/lib/xorg/Xorg 4MiB |
| 0 N/A N/A 1703 G /usr/lib/xorg/Xorg 4MiB |
+-----------------------------------------------------------------------------+
</code></pre>
<p>The log is:</p>
<pre><code>nvidia-installer log file '/var/log/nvidia-installer.log'
creation time: Fri Mar  5 20:30:23 2021
installer version: 455.23.05

PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

nvidia-installer command line:
    ./nvidia-installer
    --ui=none
    --no-questions
    --accept-license
    --disable-nouveau
    --no-cc-version-check
    --install-libglvnd

Using built-in stream user interface
-&gt; Detected 12 CPUs online; setting concurrency level to 12.
ERROR: An NVIDIA kernel module 'nvidia-drm' 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.
ERROR: Installation has failed.  Please see the file '/var/log/nvidia-installer.log' for details.  You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com.</code></pre>