Skip to content

Instantly share code, notes, and snippets.

View YCmove's full-sized avatar

YCmove

  • Taiwan
View GitHub Profile
@YCmove
YCmove / docker_could_not_select_device_driver.md
Last active September 16, 2024 13:21
docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].

First, create a docker sudoer group and add your account

sudo groupadd docker
sudo usermod -aG docker $USER

Second, enable rootless mode

nvidia-ctk runtime configure --runtime=docker --config=$HOME/.config/docker/daemon.json
systemctl --user restart docker
@YCmove
YCmove / batch_heic_to_jpg.md
Created June 14, 2024 17:34
Batch convert HEIC image to jpg
sudo apt install heif-convert

Inside the folder:

for f in *.HEIC; do heif-convert -q 100 "$f" "${f%.*}.jpg"; done
@YCmove
YCmove / github_timeout.md
Last active May 31, 2024 12:34
GitHub git clone - Connection timeout

Error git clone

$ git clone [email protected]:yourusername/xxx.git
Cloning into 'xxx'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
@YCmove
YCmove / ubuntu_dock.md
Last active May 28, 2024 11:26
Add/Pin a New Program to Ubuntu Dock panel

How to pin a program to the Ubuntu Dock Panel?

First: Show the current dock setting

$ gsettings get org.gnome.shell favorite-apps
['firefox_firefox.desktop', 'org.gnome.Nautilus.desktop', 'snap-store_ubuntu-software.desktop', 'google-chrome.desktop', 'org.gnome.Terminal.desktop', 'gnome-control-center.desktop', 'code_code.desktop', 'gimp_gimp.desktop']

Check the .desktop setting

Zotero offer the default Desktop Entry setting

@YCmove
YCmove / GroundingDINO_torchinfo_summary.md
Last active May 18, 2024 15:08
Model Summary of the GroundingDINO

Model Summary of the GroundingDINO

If you encountered a KeyError: 'captions' when trying to run summary(model), it is because GroundingDINO creates its own class GroundingDINO with various customized layers.

First, use torchinfo instead of torchsummary because both torchsummary and torch-summary were deprecated long ago.

However, you will need to make a small modification to the torchinfo.py file in your environment's site-packages directory. For example, you can find it at: /home/{user}/miniconda3/envs/GroundingDINO/lib/python3.8/site-packages/torchinfo/torchinfo.py.

Add a few lines of code here.

@YCmove
YCmove / mount.md
Last active May 16, 2024 12:44
Set up automatic mounting for the disk during boot time.

Set up automatic mounting for the disk during boot time.

Filesystem Status Check

Check the current filesystem status and how they are mounted on your computer.

$ mount
/dev/nvme0n1p2 on / type ext4 (rw,relatime,errors=remount-ro)
/dev/nvme0n1p1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
@YCmove
YCmove / cuda_nouveau.md
Last active May 9, 2024 16:45
CUDA Nouveau issus

CUDA Installation Problem:

WARNING: The Nouveau kernel driver is currently in use by your system. This driver is incompatible with the NVIDIA driver, and must be disabled before proceeding.

(Answer: Continue installation)
-> Performing CC sanity check with CC="/usr/bin/cc".
-> Performing CC check.
WARNING: The Nouveau kernel driver is currently in use by your system.  This driver is incompatible with the NVIDIA driver, and must be disabled before proceeding.
-> Nouveau can usually be disabled by adding files to the modprobe configuration directories and rebuilding the initramfs.
@YCmove
YCmove / cuda_install_xserver.md
Last active May 9, 2024 17:06
CUDA Installation failed

CUDA Installation failed.

You appear to be running an X server. Installing the NVIDIA driver while X is running is not recommended

$ sudo sh cuda_12.4.1_550.54.15_linux.run
 Installation failed. See log at /var/log/cuda-installer.log for details.

Check the cuda-installer.log.

$ less /var/log/cuda-installer.log
@YCmove
YCmove / kernel_change.md
Last active May 8, 2024 18:45
How to change kernel version?

Check the current kernel

$ dpkg --list 'linux-image-*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                  Version             Architecture Description
+++-=====================================-===================-============-===============================>
ii  linux-image-6.5.0-18-generic          6.5.0-18.18~22.04.1 amd64        Signed kernel image generic
@YCmove
YCmove / cuda_installation.md
Last active May 9, 2024 17:03
Install multiple CUDA on one machine

Install multiple CUDA on one machine

Check your GPU is is CUDA-capable

$ lspci | grep VGA
VGA compatible controller: NVIDIA Corporation GA102 [GeForce RTX 3090] (rev a1)

Check your OS