Skip to main content

Posts

Increase WSL memory

wsl -- shutdown Open PS and do the following. [These are two lines] Write-Output "[wsl2] memory=10GB" >> "${env:USERPROFILE}\.wslconfig" # to see Get-Content "${env:USERPROFILE}\.wslconfig" To see total memory: top htop free -h   Components of the command: Write-Output "[wsl2] memory=26GB" : This writes the string [wsl2] memory=10GB . [You must write [wsl2] in one line and memory=10GB in another line] [wsl2] indicates that the settings being configured are for WSL2, which is the second version of WSL with better performance and more advanced features. memory=26GB sets the maximum memory that WSL2 is allowed to use to 10 GB. >> "${env:USERPROFILE}\.wslconfig" : >> is the append operator, which adds the output to the specified file, instead of overwriting it. If the file doesn't exist, it will create one. ${env:USERPROFILE} is a PowerShell expression that references the current user's profile directory. For m

Find Process That is Using Your File / Folder

 https://superuser.com/a/643312  Resource Monitor or resmon.exe Performance >> CPU >> Processes Select all processes by clicking the checkbox next to "Image" in the headers Use the search field in the Associated Handles section, example /path/to/folder You can end a process if you want

After Windows 11 Upgrade

Disable show more options (command prompt as admin): reg add “HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32” /f /ve Restart. To Reverse: reg delete “HKEY_CURRENT_USER\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}” /f​ 

NVIDIA DEEPSTREAM SDK Install

  CUDA Lib Not installed: So: Installed using docker instead Docker Running:

NVIDIA TAO

 https://www.youtube.com/watch?v=kErfKDZ50To Note: there are two versions of tao 1 for tensorflow 2 and another for tensorflow 1 [Actually this is false - detectnet_v2 only has tf 1.15 version and should work well within automl]. careful: TF1 looks like: Configuration of the TAO Toolkit Instance dockers: ['nvidia/tao/tao-toolkit'] format_version: 2.0 toolkit_version: 4.0.1 published_date: 03/06/2023 TF2 looks like: [if installed in automl when tf2 installed already probably] (automl) rb@victus:~/eta$ tao info Configuration of the TAO Toolkit Instance task_group: ['model', 'dataset', 'deploy'] format_version: 3.0 toolkit_version: 5.2.0.1 published_date: 01/16/2024 older or newer version of tao is installed probably depending on python version tao model or just tao - for inference python 2.6.9 worked best - see notebook aws (base) rb@victus:~/eta$ curl https://get.docker.com | sh && sudo systemctl --now enable docker [On AMI docker was already ther

Install Ubuntu Dual Boot HP Victus

Download Ubuntu: https://ubuntu.com/download/alternative-downloads [I'm downloading Ubuntu 20.04.6 Desktop (64-bit)] Download Rufus [Portable is fine]: https://rufus.ie/en/ [Mine: 4.4] Use DD Mode Secure boot state: Off If on, Hold Shift and Click Restart -> Troubleshoot -> Advanced Options -> UEFI Firmware Settings -> Restart -> Go To Boot -> Secure Boot -> Disable -> Exit -> Save and Exit Seems you can boot from device using this as well: Shift + Restart -> Use a device In HP Victus -> F9 Can also work, I did above Install Ubuntu Keyboard and Language: US Normal Installation -> Other Options Tick Both Download Updates and Install third-party [Although you can do any] Select: Something else First need to create two partitions from the unallocated space (one for ubuntu another for swap) For Ubuntu: Click free space -> create a new partition (click + or Add) Primary - Beginning of this space - Ext4 journaling file system Since we have 200GB fre

Davinci Resovle

 Intall paid version - unpaid version lags because it has no GPU acceleration support. Need to Install Microsoft HEVC if media doesn't load Click on change if asked to change fps

Filename or extension too long windows

Open Run command by pressing Windows + R and type Regedit and hit enter. This command will open the Registry editor console. Now navigate to the following path. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem From the left-hand side click on the FileSystem and from the right-hand side look for the DWORD named LongPathsEnabled. Double click on the LongPathsEnabled DWORD and set the Value data as 1 and click on OK.

GCC Cuda Incompatible RuntimeError

 RuntimeError: The current installed version of g++ (11.3.0) is greater than the maximum required version by CUDA 11.2. Please make sure to use an adequate version of g++ (>=5.0.0, <11.0) gcc --version sudo apt -y install gcc-10 g++-10 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10 https://github.com/facebookresearch/detectron2/issues/667 subprocess.CalledProcessError: Command '['which', 'c++']' returned non-zero exit status 1 As INSTALL.md says you need gcc>=4.9.

VSCODE Settings

Packages: GitLens Ruff Flake8 Python (To Disable double envs like: (automl)(base)): Didn't work and: conda config --set auto_activate_base False : This worked autoDocstring - Python Docstring Generator Open the settings (File > Preferences > Settings)   or use the keyboard shortcut (Ctrl + ,) you can use search there and To change size of fonts in Tabs etc Ctrl +  and Ctrl - to change Then adjust font size in editor with Ctrl and mouse scroll For debugging:  Python Debugger: Debug using launch.json and in .vscode/launch.json or change to any path you like  "cwd" : "${fileDirname}" {     // Use IntelliSense to learn about possible attributes.     // Hover to view descriptions of existing attributes.     // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387     "version" : "0.2.0" ,     "configurations" : [         {             "name" : "Python Debugger: Current File" ,             &

Protect ec2 key Permissions too open

 Move to C drive first - the pem file Right Click > Properties > Security > Advanced > Change Permissions > Disable Interitance > Convert inherited permissions into explicit permissions on this object Change owner to: RB\rames Then remove all Permission entries and add you - Full control

Joplin

 Linux https://github.com/laurent22/joplin/issues/6612 sudo add-apt-repository universe sudo apt install libfuse2 https://joplinapp.org/help/#desktop-applications wget -O - https://raw.githubusercontent.com/laurent22/joplin/dev/Joplin_install_and_update.sh | bash It's not free if you want to sync in Joplin Cloud but works for dropbox or onedrive, I used dropbox sudo rm -r ~/.joplin sudo rm -r ~/.config/joplin-desktop sudo rm ~/.local/share/applications/appimagekit-joplin.desktop

Open ec2 on nautilus (File Browser Ubuntu)

Working method ssh-add /home/rb/eta/ec2_ramesh_key.pem In Connect to server do: sftp://ec2-user@ec2-35-91-46-202.us-west-2.compute.amazonaws.com  To rename: Right click >> Add to Bookmark Then you can rename the bookmark https://smashingweb.info/connect-remote-server-nautilus-using-key-file-pem-file/ gedit ~/.ssh/config Well some info were already there ex. from VSCode # Read more about SSH config files: https://linux.die.net/man/5/ssh_config Host Automl6     HostName ec2-35-91-46-202.us-west-2.compute.amazonaws.com     User ec2-user     IdentityFile /home/rb/eta/ec2_ramesh_key.pem Host Automl4     HostName ec2-54-187-190-154.us-west-2.compute.amazonaws.com     User ec2-user     IdentityFile /home/rb/eta/ec2_ramesh_key.pem Host Automl5     HostName ec2-35-89-188-226.us-west-2.compute.amazonaws.com     User ec2-user     IdentityFile /home/rb/eta/ec2_ramesh_key.pem do this in terminal: ssh Automl4 This will get you connected to Amazon ec2 server Then in Nautilus: Ctrl+L ssh://Autom

Windows like file sorting in linux

 in terminal : locale sudo update-locale LC_COLLATE=C restart required https://askubuntu.com/questions/239371/how-do-i-list-folders-with-underscores-first or edit  ~/.profile export LC_COLLATE=C this doesn't require logging out but is temporary killall nautilus && LC_COLLATE=C nautilus &

Fix Grub (lost) on Windows 11 - Or after Removing Ubuntu Partition

 Tried on HP Victus The grub is lost because the windows is set as default for login in BIOS. If you set Ubuntu as default grub will be back. Go to BIOS settings (F10) and Boot Settings and OS boot manager and put ubuntu on top. You get grub back (you can select between ubuntu and windows then) Select Windows [Didn't Work]: Hold Shift+Restart After Restart Again F9 and Windows and got to: Advanced Options > Command Prompt and do: X:\Windows\System32> bootrec /fixmbr X:\Windows\System32> bootrec /fixboot sometimes this gives error: Access is denied. if so, do this X:\Windows\System32> bootsect/nt60 sys Then do: X:\Windows\System32> bootrec /fixboot Repair Grub : Do this before deleting partition [Did but didn't work] Might need to do it by creating an installation media in USB (F9) for boot options HP Victus. X:\Windows\System32> bootrec /fixmbr X:\Windows\System32> bootrec /fixboot sometimes this gives error: Access is denied. if so, do this X:\Windows\Syst

Long Path Windows

 https://robocorp.com/docs/troubleshooting/windows-long-path gpedit.msc Computer Configuration > Administrative Templates > System > Filesystem. On the right, find the "Enable win32 long paths" item and double-click it set to "Enabled" Restart If doesn't work: regedit.msc HKEY-LOCAL-MACHINE > SYSTEM > CurrentControlSet > Control > FileSystem. On the right, find the LongPathsEnabled item and double-click it, Value data: 1

Bitlocker after unlock

  Source Computer > HKEY_CLASSES_ROOT > Drive > shell New > Key, and name the new key "runas" Select runas, double-click (Default) on the runas interface, in the pop-up edit box enter the value data "Lock the Drive" and click OK to save. Right-click the runas folder, click New > Key, and name the newly created Key "Command". In the Command folder interface, double-click (Default), and in the pop-up edit box enter "c:\windows\System32\manage-bde -lock -ForceDismount E:" (E represents the BitLocker encrypted drive that needs to be locked). @%SystemRoot%\System32\manage-bde -lock -ForceDismount K:

Detection and Segmentation

 Add layers during training Net to Net [?] Ian Goodfellow Network Morphism Microsoft Deep Visual-Semantic: Alignments for Generating Image Descriptions Types of RNN - Vanilla RNN / Simple RNN / Elman RNN - Long Short Term Memory (LSTM) - Helps improve gradient flow during back prop Computer Vision Tasks  - Classification [already done] - Very basic  - Localization  - Segmentation  - Detection 1. Semantic Segmentation - Grass, Cat, Tree, Sky in 1 image. [No object just pixels] - No box but all pixels are classified. 2. Classification + Localization - Class = Cat and a box around cat [Single Object] 3. Object detection  - Box around objects - Dog, Dog, Cat 4. Instance Segmentation - All pixels are classified - Dog Cat Dog  3 and 4 - Multiple objects. Semantic Segmentation  - For every pixel we want to say what it is - cat, grass, sky, etc - Two Cows will be classified as cow, both are not differentiated like cow 1 and cow 2. - Instance segmentation does this. - Just labeling the

Initial Apps HP

 

Installing Nvidia Driver and CUDA Ubuntu Victus

  Get corresponding CUDA for your TF Version: https://www.tensorflow.org/install/source#gpu https://developer.nvidia.com/cuda-11-8-0-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=runfile_local Example: wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run sudo sh cuda_11.2.2_460.32.03_linux.run --override --override to override gcc version check [Existing package manage installation of driver found] : Continue Update: I only installed Toolkit no driver/samples/demo suite/doc - note driver version is 520 export PATH=/usr/local/cuda-11.8/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} export CUDA_HOME=/usr/local/cuda Now install CUDNN: https://developer.nvidia.com/rdp/cudnn-archive For my case: Download cuDNN v8.6.0 (October 3rd, 2022), for CUDA 11.x Download tar: [doesn't work anymore withou

Install WSL2 Ubuntu

wsl enable from windows features wsl enter in command prompt WSL 2 requires an update to its kernel component. For information please visit https://aka.ms/wsl2kernel dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart wsl --set-default-version 2 Still got: WSL 2 requires an update to its kernel component. For information please visit https://aka.ms/wsl2kernel wsl --update Failed to attach disk 'X:\WSL_IMPORT\ubuntu\ext4.vhdx' to WSL2: The system cannot find the path specified. Error code: Wsl/Service/CreateInstance/MountVhd/HCS/ERROR_PATH_NOT_FOUND wsl --unregister ubuntu wsl --install sudo apt install gcc  [Didn't help but installed first] sudo apt install g++ [Helped] - for detectron2 ImportError: libGL.so.1: cannot open shared object file: No such file or directory sudo apt-get install libgl1 import tensorflow as tf print(len(tf.config.list_physical_devices('GPU'))) from tensorflow.python.client import device_lib print(device_lib.