Post

Ubuntu Setup

0. Delete Ubuntu

  • Run Diskpart
    • win+R: diskpart
  • Check disk
    • list disk
  • Select the disk saved system files of ubuntu
    • select disk disk_number
  • Check partition
    • list partition
  • Select the system partition
    • select partition 1
  • assign letter=p
  • Run notepad as administrator
    • Go to the disk p and delete the ubuntu folder
  • Back to the Diskpart
    • romove letter=p
  • Run Disk manager
    • delete the disk volume of ubuntu storage.

1. Install Ubuntu

2. Install Anaconda3

2.1 Download

Anaconda3

1
cd Downloads
1
bash Anaconda3-xxxx.xx-Linux-x86_64.sh

2.2 bashrc setting

1
nano ~/.bashrc
  • export
1
export PATH="/home/username/anaconda3/bin:$PATH"
1
source ~/.bashrc

2.3 Command

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
conda create -n your_env_name python=X.X(3.6,3.7,etc.)

source activate your_env_name(env_name)

source deactivate your_env_name(env_name)

conda remove -n your_env_name(env_name) --all

conda list

conda install package_name(package_name)
conda install scrapy==1.3 
conda install -n env_name package_name

#Check env
conda env list 
#or
conda info -e
#or
conda info --envs

conda update conda

conda update anaconda

conda update --all

conda update python

2.4 put images source

3.Install Pycharm

Pycharm

4.ROS

  • ROS2 - humble - ubuntu 22.04
  • ROS1 - ubuntu 20.04

5.Install Nvidia driver

1
ubuntu-drivers devices
1
sudo apt-get install nvidia-driver-535
  • hardware key
1
Enroll MOK 
  • reboot and check
1
nvidia-smi

6.CUDA

CUDA

  • nano ~/.bashrc
    1
    2
    
    export PATH=/usr/local/cuda-12.3/bin${PATH:+:${PATH}}
    export LD_LIBRARY_PATH=/usr/local/cuda-12.3/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
    

7.cuDNN

cudnn

  • Extract
1
cd ~/Downloads/cudnn-xxxxxxxxxxxxx`
  • move
1
2
3
sudo cp include/cudnn*.h /usr/local/cuda/include 
sudo cp -P lib/libcudnn* /usr/local/cuda/lib64 
sudo chmod a+r /usr/local/cuda/include/cudnn*.h /usr/local/cuda/lib64/libcudnn*
  • Check
1
cat /usr/local/cuda-12.3/include/cudnn_version.h | grep CUDNN_MAJOR -A 2

8.Pytorch

https://pytorch.org/get-started/previous-versions/

  • Check
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
>>import torch

>>print(torch.__version__)

>>print(torch.version.cuda)

>>print(torch.backends.cudnn.version())

>>torch.cuda.is_available()

>>torch.cuda.device_count()

>>torch.cuda.get_device_name(0)

>>torch.cuda.current_device()

9.Docker

Do not install docker-desktop!


This post is licensed under CC BY 4.0 by the author.