I want to use Graphic Board RTX4090 on Python.

Current

~$ python
Python 3.9.16 (main, Mar  8 2023, 11:00:05)
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.is_available()
False
>>>

Update conda.

$ conda update -n base conda
Collecting package metadata (current_repodata.json): done
Solving environment: -
The environmenat is inconsistent, please check the package plan carefully
The following packages are causing the inconsistency:
 
...
 
Downloading and Extracting Packages
 
Preparing transaction: done
Verifying transaction: failed
 
RemoveError: 'requests' is a dependency of conda and cannot be removed from
conda's operating environment.
$ conda update --update-deps conda
 
Downloading and Extracting Packages
 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

Update libraries.

~$ sudo apt-get --purge remove cuda-*
~$ ubuntu-drivers devices
~$ sudo ubuntu-drivers autoinstall
  
~$ nvidia-smi
Sun Feb 11 01:27:13 2024
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.154.05             Driver Version: 535.154.05   CUDA Version: 12.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  NVIDIA GeForce RTX 4090        Off | 00000000:01:00.0 Off |                  Off |
|  0%   25C    P8              10W / 450W |     30MiB / 24564MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
 
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|    0   N/A  N/A     56083      G   /usr/lib/xorg/Xorg                            9MiB |
|    0   N/A  N/A     57246      G   /usr/bin/gnome-shell                         10MiB |
+---------------------------------------------------------------------------------------+
 
~$ python
Python 3.9.16 (main, Mar  8 2023, 14:00:05)
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.is_available()
True
>>>