Skip to content

Instantly share code, notes, and snippets.

View alvarovm's full-sized avatar
🏠
Working from home

Alvaro Vazquez-Mayagoitia alvarovm

🏠
Working from home
View GitHub Profile
@alvarovm
alvarovm / MACE_install.md
Last active February 27, 2024 17:35 — forked from jingsk/MACE_install.md
Install MACE with cuda-enabled Pytorch

Mace installation on ANL's Swing as of 1/30/24

Check resources available on Swing: NVIDIA A100 GPUs (8 GPUs per node) - 1/8 node allocated when requesting 1 gpu

MACE requires Pytorch2, which needs CUDA 11.8 or 11.7. Check required CUDA versions here

Install Torch and Cuda

Create a Conda environment with Python 3.10

conda create -n "CUDA-torch-base" python=3.10.0
@alvarovm
alvarovm / blur-banner-to-pdf.sh
Created October 31, 2023 06:57
Bash script to blur some pages of PDF files
#!/bin/bash
# Create an empty array to store the random numbers
#Percentage of pages blured
porc=0.50
#npages=$(pdfinfo ${1} | grep Pages | awk '{print $2}')
#echo "total pages ${npages}"
$>unison /mnt/c/Users/v/docs/ ssh://logos//home/vama/docs/
Unison 2.52.1 (ocaml 4.04.2): Contacting server...
bash: line 1: unison: command not found
Fatal error: Lost connection with the server

https://alliance.seas.upenn.edu/~bcpierce/wiki/index.php?n=Main.UnisonFAQTroubleshooting

The command line "unison work ssh://remote.dcs.ed.ac.uk/work" fails, with "fatal error: could not connect to server." But when I connect directly with ssh remote.dcs.ed.ac.uk/work, I see that my PATH variable is correctly set, and the unison executable is found.

Logitec Camera C210 (maybe C270) - Error - lvrs64.sys , lvuvc64.sys Windows 11 memory integrity

Problem

There problem with the Logitech webcam software are the drivers lvrs64.sys and lvuvc64.sys. These drivers are blocking Windows memory integrity.

Solution

I managed to make this working removing all the drivers from Win11, and use native Win11 native drivers.

  • Windows+X > Device Manager> Imaging Devices > Uninstall device > remove with drivers.
  • Disconnect and connect camera [Error will pop up, ignore it]

Intel GPU on Win11 22H2 WSL2 Ubuntu 20.04, gcc 9.4.0

Notes of support of Intel GPU in WSL can be found here https://github.com/intel/compute-runtime/blob/master/WSL.md

My test is in a laptop Lenovo Carbon X1 Gen 10 with processor i7-1280p. I installed the latest Intel GPU driver (as in 9/30/2022) gfx_win_101.3430_101.2111.

I am using the follow configuration for WSL in c:\User\myuser\.wslconfig:

[wsl2]

Create /etc/apt/sources.list.d/clangofficial.list with the follow lines

deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-14 main
deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic-14 main

Add the key: wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -

@alvarovm
alvarovm / clangoffload.md
Created June 30, 2022 22:50 — forked from anjohan/clangoffload.md
Build Clang with OpenMP Target Offloading for NVIDIA GPUs

Note to self

This works with Clang 12 on Manjaro, and maybe other Linux versions. CUDA 11.1 is installed with pacman in /opt/cuda.

Download

git clone https://github.com/llvm/llvm-project.git

First build

VASP 6.x.x in Polaris (NVHPC+OpenACC+OpenMP+CUDA math+CrayMPI)

VASP is a commercial code for materials and solid state simulations. Users must have a license to use this code in ALCF systems. More information on how to get access to VASP binaries can be found here.

General compiling/installing instructions provided by VASP support

Instructions and samples of makefile.include could be found in vasp.at wiki page

The follow makefile.include was tailore for Polaris, originally taken from here

How to set up a KillSwitch with OpenVPN for a Raspberry Pi Zero W

Having a KillSwitch is important when you are using an VPN, you also make sure that in case the openvpn service stops working your connections and other services do not use regular a trackable ISP's IP.

The follow instruction are meant to use UFW to config a firewall that prevents leakings.

Firewall set up

sudo apt install ufw

The complete NWChem documentation can be found here.

Getting the code

The SRC only file of Nwchem 7.0.2 can be downloaded as follow.

wget https://github.com/nwchemgit/nwchem/releases/download/v7.0.2-release/nwchem-7.0.2-release.revision-b9985dfa-srconly.2020-10-12.tar.bz2