Categories
Uncategorized

Fix ‘DESCRIPTION.txt’ FASTAPI test pypi

When uploading python module into test pypi and install it, I got this error

build_meta.py", line 317, in run_setup
          exec(code, locals())
          ~~~~^^^^^^^^^^^^^^^^
        File "<string>", line 3, in <module>
      FileNotFoundError: [Errno 2] No such file or directory: 'DESCRIPTION.txt'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed to build 'fastapi' when getting requirements to build wheel

This error because the FASTAPI in test pypi is broken. To solve this issue, try to clean purge then install the fastapi ahead before the module

python -m pip cache purge
pip install fastapi --index-url https://pypi.org/simple/
Categories
Ubuntu

Fix new SSH keys compute.29xx: Permission denied (publickey) on GCP VM

There are several things need to do solve this issue.

  1. Register you SSH keys into project metadata in GCP. Go to “metadata” in GCP VM and add your SSH Keys

Or register with

echo "${USERNAME}:$(cat ~/.ssh/id_rsa.pub)" >> /tmp/current-ssh-keys.txt

gcloud compute instances add-metadata INSTANCES \                    
  --zone=ZONE \
  --metadata-from-file=ssh-keys=/tmp/new-ssh-keys.txt

2. Add into authorized_keys from another user within same username

3. Restart SSH server

Categories
Ubuntu

Install Davinci Resolve 21 Photo on Ubuntu 24.04

Here are the quick steps to install the latest Davinci Resolve 21 with photo album editor. First download the installer file.

Then, start to install the pre-requisities packages

sudo apt install libglib2.0-0t64 libxcb-cursor0 libaprutil1t64 libapr1t64

Then install

SKIP_PACKAGE_CHECK=1 ./DaVinci_Resolve_21.0b1_Linux.run

After installed, now fix the installer issue

sudo mkdir -p /opt/resolve/libs/unneeded/

sudo mv /opt/resolve/libs/libgio* /opt/resolve/libs/unneeded/

sudo mv /opt/resolve/libs/libglib* /opt/resolve/libs/unneeded/

sudo mv /opt/resolve/libs/libgmodule* /opt/resolve/libs/unneeded/

Now you can run it

/opt/resolve/bin/resolve
Categories
Ubuntu

Solve RuntimeError: Tensor.item() cannot be called on meta tensors

Quick fix to solve this error

uv pip install transformers==4.57.6
Categories
Ubuntu

Fix GDM3 not started in Ubuntu 24.04

The GDM3 going on black screen and you need to go to TTY1 to restart it sudo systemctl restart gdm3.

To permanently fix this and load GDM3 automatically as you login into the desktop

sudo apt install ubuntu-gnome-desktop
sudo apt install --reinstall ubuntu-desktop
sudo apt install gdm3
sudo dpkg-reconfigure gdm3
Categories
Ubuntu

Enable NCCL P2P RTX 4090 on Ubuntu

Make two RTX or more together works in P2P. The step will be, update GRUB, remove all the NVIDIA drivers, re-install with the latest version, patch and run samples.

First thing, make sure to enable Resize BAR and disable IOMMU in BIOS (I’m using ASUS WRX80SAGE).

Install required packages

sudo update-alternatives --config gcc
sudo apt install -y pkg-config libglvnd-dev git cmake gcc-13 g++-13 gcc-13 g++-13
  1. Update GRUB

sudo vim /etc/default/grub and add amd_iommu=on iommu=pt


GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pci=nommconf amd_iommu=on iommu=pt"

Then, sudo update-grub

Install NVIDIA Driver

Next, download the NVIDIA drivers and install it

wget -c https://us.download.nvidia.com/XFree86/Linux-x86_64/590.44.01/NVIDIA-Linux-x86_64-590.44.01.run

chmod +x NVIDIA-Linux-x86_64-590.44.01.run
sudo ./NVIDIA-Linux-x86_64-590.44.01.run

Next, install the patch

git clone https://github.com/aikitoria/open-gpu-kernel-modules.git
cd open-gpu-kernel-modules

# IMPORTANT! Check into branch with same driver
# Otherwise you will get error nvidia-smi is returning "NVML: Driver/library version mismatch"

git checkout 590.44.01-p2p

./install.sh

sudo reboot

Last, download cuda samples. Make sure to have NVCC installed with you, I’m using 12.8 :
https://developer.nvidia.com/cuda-12-8-0-download-archive

Then, I download the cuda samples with 12.8 version
https://github.com/NVIDIA/cuda-samples/tree/v12.8

sudo apt install gcc-10 g++-10 gcc-10 g++-10 -y
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10 --slave /usr/bin/g++ g++ /usr/bin/g++-10

# to change others
sudo update-alternatives --config gcc
wget -c https://github.com/NVIDIA/cuda-samples/archive/refs/tags/v12.8.zip

unzip v12.8.zip
cd cuda-samples-12.8
mkdir build && cd build
cmake ..
cmake --build . --config Release
./Samples/1_Utilities/deviceQuery/deviceQuery

The result will be



Supports Cooperative Kernel Launch:            Yes
  Supports MultiDevice Co-op Kernel Launch:      Yes
  Device PCI Domain ID / Bus ID / location ID:   0 / 66 / 0
  Compute Mode:
     < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >
> Peer access from NVIDIA GeForce RTX 4090 (GPU0) -> NVIDIA GeForce RTX 4090 (GPU1) : Yes
> Peer access from NVIDIA GeForce RTX 4090 (GPU1) -> NVIDIA GeForce RTX 4090 (GPU0) : Yes

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 13.2, CUDA Runtime Version = 12.8, NumDevs = 2
Result = PASS

If you need to remove NVIDIA drivers entirely, follow the step below

Remove NVIDIA

sudo systemctl stop gdm3

sudo apt-get --purge remove "*nvidia*"
sudo apt-get --purge remove "*cuda*" "*cudnn*" "*cublas*" "*cufft*" "*cufile*" "*curand*" "*cusolver*" "*cusparse*" "*gds-tools*" "*npp*" "*nvjpeg*" "nsight*" "*nvvm*" "*libnccl*"

sudo /usr/bin/nvidia-uninstall

# disable iommu
ls -l /sys/class/iommu/

# reboot
sudo reboot

To check if everything is done completely. Run this command, if return result like this, then we need to remove it

cat /proc/driver/nvidia/version 

NVRM version: NVIDIA UNIX Open Kernel Module for x86_64 570.148.08 Release Build 
Sat Jan 17 05:57:24 PM WIB 2026 GCC version: gcc version 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04)

To remove it

sudo modprobe -r nvidia_drm nvidia_modeset nvidia_uvm nvidia || true
sudo rm -rf /lib/modules/$(uname -r)/kernel/drivers/video/nvidia*
sudo rm -rf /lib/modules/$(uname -r)/updates/dkms/nvidia*
sudo depmod -a
sudo update-initramfs -u
sudo reboot

Check if everything is cleared

nvidia-smi
command not found: nvidia-smi

cat /proc/driver/nvidia/version                                     
cat: /proc/driver/nvidia/version: No such file or directory

Disable Novoeau and reboot

sudo bash -c "echo blacklist nouveau >  /etc/modprobe.d/blacklist-nouveau.conf"

sudo bash -c "echo options nouveau modeset=0 >> /etc/modprobe.d/blacklist-nouveau.conf"

sudo update-initramfs -u
sudo reboot

Categories
Ubuntu

Install Davinci Resolve 20 on Ubuntu 24.10

First, install the depedencies

sudo apt install libfuse2t64 ocl-icd-libopencl1

sudo apt-get install -qq libglu1-mesa-dev libx11-xcb-dev '^libxcb*'

Then install the packages

sudo SKIP_PACKAGE_CHECK=1 ./DaVinci_Resolve_*.run

After installed, the Davinci Resolve will not working or launching after your click the Icon on Ubuntu.

To solve this, launch terminal and execute /opt/resolve/bin/resolve

You will see the error below

/opt/resolve/bin/resolve: symbol lookup error: /lib/x86_64-linux-gnu/libpango-1.0.so.0: undefined symbol: g_once_init_leave_pointer

Fix this by

sudo mkdir -p /opt/resolve/libs/unneeded/

sudo mv /opt/resolve/libs/libgio* /opt/resolve/libs/unneeded/

sudo mv /opt/resolve/libs/libglib* /opt/resolve/libs/unneeded/

sudo mv /opt/resolve/libs/libgmodule* /opt/resolve/libs/unneeded/

Now your Davinci Resolve should be works 100% on Ubuntu!

Categories
Ubuntu

Google Work Account Huawei Matepad with MicroG and Aurora

Here are the right way to register and use your working gmail account into Huawei Matepad.

1. Download the HW version from MicroG website

https://github.com/microg/GmsCore/releases/download/v0.3.11.250932/com.android.vending-84022622-hw.apk

https://github.com/microg/GmsCore/releases/download/v0.3.11.250932/com.google.android.gms-250932022-hw.apk

https://github.com/microg/GsfProxy/releases/download/v0.1.0/GsfProxy.apk

Install all the packages.

2. Download and install Aurora Store

https://www.auroraoss.com/files/AuroraStore/Release

3. Google Account Setup

In MicroG, which you can also access from “Apps” in settings, ensure its have all the permissions needed.

You can enable the “Work profile” and “Google Device Registration” options before add a new account.

First step, before you add a new account, disable the options in settings like “Trust Google For App Permissions”, “Allow apps to find accounts”, “Authenticate with device registration” and “Strip device name for authentication”.

Keep the receive two-step verification prompts

Login as usual.

4. Fix Google work account access in MicroG

To solve this issue, back to the google account settings in microG, now enable everything like Trust Google For App Permissions”, “Allow apps to find accounts”, “Authenticate with device registration” and “Strip device name for authentication”.

Reboot your device.

Congrats! Now everything is working. You can download and use any Google Services in your Huawei, both on work and personal gmail account.

Categories
Ubuntu

Disable Google Chrome Update in Ubuntu

To avoid auto update google chrome version, the simple steps to do are

  1. Edit the launcher at Ubuntu
sudo vim /usr/share/applications/google-chrome.desktop

And edit every Exec with --simulate-outdated-no-au='Tue, 31 Dec 2099 23:59:59 GMT' --check-for-update-interval=31536000

For example

Exec=/usr/bin/google-chrome-stable --simulate-outdated-no-au='Tue, 31 Dec 2099 23:59:59 GMT' --check-for-update-interval=31536000

2. Disable update on APT and comment it

sudo vim /etc/apt/sources.list.d/google-chrome.list

Done!

Categories
Ubuntu

Fix VLLM RuntimeError: NCCL error: unhandled system error

Running VLLM with tensor-parallel-size more than 1, triggered this error:

RuntimeError: NCCL error: unhandled 
system error (run with NCCL_DEBUG=INFO for details)
Exception: WorkerProc initialization failed due to a
n exception in a background process. See stack trace for root cause.
(EngineCore_0 pid=236) Process EngineCore_0:

This error is not about NCCL_P2P_DISABLE=1, but this vague error because when tensor-parallel-size using multiple GPUs, its need memory for sharing each other.

So, the solution is to add --shm-size 10g. Remove all the environment variable passed to docker to investigate. Be careful, environment variable that caused VLLM error may cancellout the other env.

Here is some example that works

docker run --rm -it \
  --gpus all \
  --network host -p 8000:8000 -p 8080:8080 --shm-size 10g \
  -e NCCL_P2P_DISABLE=1 \
  -v /model/llama-3-2-1b:/model \
  nvcr.io/nvidia/ai-dynamo/vllm-runtime:0.4.1 \
  python3 -m vllm.entrypoints.openai.api_server \
    --model /model \
    --tensor-parallel-size 2 \
    --served-model-name model \
    --dtype bfloat16 \
    --gpu-memory-utilization 0.90 \
    --max-model-len 8192