Skip to content

Instantly share code, notes, and snippets.

View YCmove's full-sized avatar

YCmove

  • Taiwan
View GitHub Profile
@YCmove
YCmove / cuda_remove.md
Last active May 8, 2024 14:55
Remove/Uninstall all CUDA driver

Remove/Uninstall all CUDA driver

Remove nvidia driver

sudo apt-get --purge remove "*cuda*" "*cublas*" "*cufft*" "*cufile*" "*curand*" \
 "*cusolver*" "*cusparse*" "*gds-tools*" "*npp*" "*nvjpeg*" "nsight*" "*nvvm*"
sudo apt-get --purge remove "*nvidia*" "libxnvctrl*"
sudo apt --purge remove cudnn*
@YCmove
YCmove / gist:09f191676d776a33ac8d6ea1982c80af
Last active May 8, 2024 11:58
colmap - Unsupported gpu architecture 'compute_native’ and error: parameter packs not expanded with ‘...’

colmap - Unsupported gpu architecture 'compute_native’

Problem

Compiling colmap failed with error message Unsupported gpu architecture 'compute_native’.

Solution

Check your GPU's Compute Capability. For example, GeForce RTX 3090 has Compute Capability 8.6, then compile with the number:

cmake .. -GNinja -DCMAKE_CUDA_ARCHITECTURES=86

@YCmove
YCmove / colmap1.md
Last active May 8, 2024 12:06
colmap - error: parameter packs not expanded with ‘...’

colmap - error: parameter packs not expanded with ‘...’

Problem

colmap make failed with with error message error: parameter packs not expanded with ‘...’

Solution

Make sure you have gcc 10 and g++ 10, if not, install them first sudo apt install gcc-10 g++-10

@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

@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_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 / 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 / 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 / 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 / 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