Skip to content

Instantly share code, notes, and snippets.

@TheFern2
Last active September 28, 2023 20:47
Show Gist options
  • Save TheFern2/b26f4b41b3fcafe1f1e869ca31f48b13 to your computer and use it in GitHub Desktop.
Save TheFern2/b26f4b41b3fcafe1f1e869ca31f48b13 to your computer and use it in GitHub Desktop.
new linux install

Install cuda toolkit 12.2 Update 2

https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=deb_local

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/12.2.2/local_installers/cuda-repo-ubuntu2204-12-2-local_12.2.2-535.104.05-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2204-12-2-local_12.2.2-535.104.05-1_amd64.deb
sudo cp /var/cuda-repo-ubuntu2204-12-2-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda

Error with libnvidia-extra-535 535.104.05

sudo apt --fix-broken install

export PATH=$PATH:/usr/local/cuda/bin

auto removed nvidia-firmware-535-535.86.05

Install cudnn

https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html

sudo apt-get install zlib1g

https://developer.nvidia.com/rdp/cudnn-download

Get the tar

tar -xvf cudnn-linux-$arch-8.x.x.x_cudaX.Y-archive.tar.xz
sudo cp cudnn-*-archive/include/cudnn*.h /usr/local/cuda/include 
sudo cp -P cudnn-*-archive/lib/libcudnn* /usr/local/cuda/lib64 
sudo chmod a+r /usr/local/cuda/include/cudnn*.h /usr/local/cuda/lib64/libcudnn*

Miniconda3

curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -o Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
modified      /home/fernando/.bashrc

==> For changes to take effect, close and re-open your current shell. <==

If you'd prefer that conda's base environment not be activated on startup, 
   set the auto_activate_base parameter to false: 

conda config --set auto_activate_base false
conda create --name tf python=3.9

conda deactivate
conda activate tf

conda install -c conda-forge cudatoolkit=11.8.0
pip install nvidia-cudnn-cu11==8.6.0.163
mkdir -p $CONDA_PREFIX/etc/conda/activate.d
echo 'CUDNN_PATH=$(dirname $(python -c "import nvidia.cudnn;print(nvidia.cudnn.__file__)"))' >> $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh
echo 'export LD_LIBRARY_PATH=$CUDNN_PATH/lib:$CONDA_PREFIX/lib/:$LD_LIBRARY_PATH' >> $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh
pip install --upgrade pip
pip install tensorflow==2.13.*
conda install -c conda-forge jupyterlab

fish env_vars.fish

set -gx CUDNN_PATH "$CONDA_PREFIX/lib/python3.9/site-packages/nvidia/cudnn"
set -gx LD_LIBRARY_PATH "$CUDNN_PATH/lib:$CONDA_PREFIX/lib/:$LD_LIBRARY_PATH"

Testing compute

python3 -c "import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"

First steps after install

  • Set primary monitor, added bitwarden, dark reader, and adblock to firefox.
  • Set login screen to main monitor

https://www.reddit.com/r/Ubuntu/comments/i09vao/hello_is_their_a_way_to_tell_to_ubuntu_to_change/

sudo cp .config/monitors.xml /var/lib/gdm3/.config/
sudo chown gdm:gdm /var/lib/gdm3/.config/monitors.xml
gsettings set org.gnome.desktop.sound event-sounds false

sleep shortcut

keyboard -> custom shortcuts > systemctl suspend (Super + F2)

Firefox

remove password login ask open old tabs

Numpad?

gsettings set org.gnome.desktop.peripherals.keyboard remember-numlock-state true

apt apps

  • curl
  • neovim

Grub theme

Saved on backups

  • flameshot, spectacle for snapshots, I dunno maybe something better like the mac app that holds the pic
  • dropbox
  • ulauncher, maybe will not need in another distro
  • autokey?

Definitely install:

  • redshift-gtk, flux alternative
  • grub-customizer
  • filezilla
  • protonvpn
  • qbitorrent
  • obs, vlc, spotify
  • gparted?
  • virtualbox

fstab

UUID=71a6dc24-a8e9-45d9-8cd1-b760a589cfc7 /mnt/sda1 ext4 defaults 0 2

image

image

Linux is installed on ssd /dev/nvme0n1p2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment