- Set CUDA as Synchronous mode:
export CUDA_LAUNCH_BLOCKING=1 - Use CUDA GDB :
/usr/local/cuda/bin/cuda-gdb --arg foo arg1 arg2Enable GDB option :
| import os | |
| import argparse | |
| import requests | |
| import sys | |
| def print_help(): | |
| help_text = """ | |
| Download ZED SDK AI models from Stereolabs. | |
| Usage: |
| #include <iostream> | |
| #include <fstream> | |
| #include <vector> | |
| #include <cstdint> | |
| class BinaryVectorStream { | |
| private: | |
| std::vector<uint8_t>& data; | |
| size_t position; |
| # From https://docs.ultralytics.com/fr/integrations/tensorrt/#installation | |
| from ultralytics import YOLO | |
| import os | |
| import cv2 | |
| # Export the model to TensorRT format, this will take a long time but should be done only once (per GPU) | |
| if not os.path.isfile('yolov8n.engine'): | |
| # Load the YOLOv8 model | |
| model = YOLO('yolov8n.pt') | |
| import cv2 | |
| import numpy as np | |
| calib_fx=615 | |
| calib_baseline=10 | |
| def depth_to_disp(depth_filename, disp_filename): | |
| cv_file = cv2.FileStorage(depth_filename, cv2.FILE_STORAGE_READ) | |
| matrix = cv_file.getNode("depth").mat() | |
| cv_file.release() |
| # https://github.com/microsoft/mimalloc | |
| VERSION="1.8.2" | |
| wget https://github.com/microsoft/mimalloc/archive/refs/tags/v${VERSION}.zip | |
| unzip v${VERSION}.zip | |
| cd mimalloc-${VERSION} | |
| mkdir build ; cd build ; cmake .. ; make -j ; sudo make install | |
| cd ../../ | |
| rm -rf v${VERSION}.zip mimalloc-${VERSION} | |
| sudo ln -s /usr/local/lib/libmimalloc.so /usr/lib/libmimalloc.so |
| import os | |
| import shutil | |
| from concurrent.futures import ThreadPoolExecutor | |
| def remove_file(file_path): | |
| try: | |
| os.remove(file_path) | |
| print(f"File '{file_path}' removed successfully.") | |
| except Exception as e: | |
| print(f"Failed to remove file '{file_path}': {e}") |
https://ubuntu.com/core/docs/networkmanager/configure-wifi-access-points
nmcli d wifi hotspot ifname <interface> ssid <ssid> password <password>Example:
| #!/bin/bash | |
| host=$(cat /etc/hostname) | |
| echo "PC Name: ${host}" | |
| cpu=$(cat /proc/cpuinfo | grep "model name" | head -1 | sed "s/model name : //") | |
| echo "CPU: ${cpu}" | |
| motherboard=$(sudo dmidecode -t 2 | grep "Product Name" | sed "s/ Product Name: //") | |
| echo "Motherboard: ${motherboard}" |
| #!/usr/bin/env bash | |
| set -x | |
| LT4_MAJOR=32 | |
| LT4_MINOR_OLD=6 | |
| LT4_MINOR=7 | |
| if [ "$EUID" -ne 0 ] | |
| then echo "Please run as root" |