Skip to content

Instantly share code, notes, and snippets.

View vicente-gonzalez-ruiz's full-sized avatar

Vicente González Ruiz vicente-gonzalez-ruiz

View GitHub Profile
  1. This recipe install OpenCV with CUDA suport in a virtual environment. See https://docs.opencv.org/4.x/d7/d9f/tutorial_linux_install.html and specifically https://docs.opencv.org/4.x/db/d05/tutorial_config_reference.html. This also helps: https://rodosingh.medium.com/using-cmake-to-build-and-install-opencv-for-python-and-c-in-ubuntu-20-04-6c5881eebd9a

  2. Install CUDA Toolkit from https://developer.nvidia.com/cuda-download. Use Download Installer for Linux Ubuntu 22.04 x86_64.

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb
sudo dpkg -i cuda-keyring_1.0-1_all.deb
sudo apt-get update
sudo apt-get -y install cuda
  1. Reboot and check that nvidia-smi is working.
1. Run nvidia-detector to see the recommended driver version (for example, nvidia-driver-550).
2. sudo apt install nvidia-driver-550
We can see the modules configured in the kernel with:
dkms status
We can know if there is any issue or conflict with the Nvidia module with:
sudo dmest | grep NV
# See: https://gist.github.com/Mahedi-61/2a2f1579d4271717d421065168ce6a73
# Remove any previous CUDA installation
sudo apt-get purge nvidia*
sudo apt remove nvidia-*
sudo rm /etc/apt/sources.list.d/cuda*
sudo apt-get autoremove && sudo apt-get autoclean
sudo rm -rf /usr/local/cuda*
# Install the required packages
# Install required pakages
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev
# Download from https://www.python.org/downloads/source/ the Python's sources
# Decompress, compile, and install (example)
tar -xf Python-3.10.*.tgz
cd Python-3.10.*/
./configure --enable-optimizations
make -j $(nproc)
# Install CUDA (see https://gist.github.com/vicente-gonzalez-ruiz/42801735d0fea2f4e0d22c2e75b2c556)
# Install opticalflow3d
pip install opticalflow3d
@vicente-gonzalez-ruiz
vicente-gonzalez-ruiz / jupyter_notebook_windows_10.txt
Last active December 21, 2023 16:11
Jupyter notebook windows 10
1. Download the last version of Python from (at this moment, version 3.12.0):
https://www.python.org/downloads/
2. Run the downloaded archive. Select the option "Add python.exe to PATH" and "Install Now". Select also "Disable path length limit".
3. Press <Win> + <R>, type "cmd", and press <Enter>.
4. Create a Python environment. For example (in the command line interpreter):
@vicente-gonzalez-ruiz
vicente-gonzalez-ruiz / install_jupyter_notebook_linux.txt
Last active December 21, 2023 16:19
Install Jupyter notebook in Linux (and OSX)
1. Create a Python environment. For example (in the command line interpreter):
python3 -m venv intercom_env
(obviously, you can re-use a old one, and you can skip this step).
2. Activate the environment. Run (tabulator key helps):
intercom_env/bin//activate
@vicente-gonzalez-ruiz
vicente-gonzalez-ruiz / tap_to_click.md
Created April 27, 2024 06:49
tap to click debian

root@miranda:/etc/X11/xorg.conf.d# cat 40-libinput.conf Section "InputClass" Identifier "libinput touchpad catchall" MatchIsTouchpad "on" MatchDevicePath "/dev/input/event*" Driver "libinput" Option "Tapping" "on" EndSection

ffplay -pattern_type glob -i '*.png'
Put:
bindsym XF86MonBrightnessUp exec --no-startup-id brightnessctl set +5%
bindsym XF86MonBrightnessDown exec --no-startup-id brightnessctl set 5%-
into:
~/.config/i3/config