Categories
Ubuntu

Solve Svelte [dev:svelte] [error] No parser could be inferred for file

When running pnpm run dev on Svelte + Vite + Shacdn project, I received error

[dev:svelte] [error] No parser could be inferred for file
[dev:svelte] [error] No parser could be inferred for file
[dev:svelte] [error] No parser could be inferred for file

To solve this, create .prettierrc file and put this

Categories
Ubuntu

Fix [WARNING] Cannot find base config file “./.svelte-kit/tsconfig.json” [tsconfig.json]

When running Shacdn + Svelte, Vite, I got this error :

▲ [WARNING] Cannot find base config file "./.svelte-kit/tsconfig.json" [tsconfig.json]

To solve this, edit package.json and add prepare": "svelte-kit sync",. For example

"scripts": {
		"dev": "vite dev",
		"build": "vite build",
		"build:registry": "tsx scripts/build-registry.ts",
		"br": "pnpm build:registry",
		"preview": "vite preview",
		"test": "playwright test",
		"prepare": "svelte-kit sync",
		"sync": "svelte-kit sync",
		"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
		"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
		"test:unit": "vitest"
	},
Categories
Ubuntu

Upgrade and Install NVIDIA Driver 565 Ubuntu 24.04

Here are a quick step to upgrade to the latest Driver (which needed for running Docker NVIDIA Nemo)

  1. Uninstall existing NVIDIA libraries
sudo apt purge "nvidia*" "libnvidia*"

2. Install the latest NVIDIA Driver

Add PPA and check the driver version as you wish to install

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update 
sudo ubuntu-drivers list

Then to install

sudo apt install nvidia-driver-565

If you got error Failed to initialize NVML: Driver/library version mismatch the solution is reboot.

If you are using NVIDIA Container Toolkit,

sudo apt-get install -y nvidia-container-toolkit
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker
Categories
Ubuntu

Remote Desktop Ubuntu 24.04

There are a quick way to do remote desktop for Ubuntu 24.04 by enable its desktop sharing and connect using Remmina from the client. Here is the steps

  1. Enable Desktop Sharing at remote device/laptop/pc

Go to “System” -> “Desktop Sharing” and toggle both Desktop Sharing and Remote Control. In login details, filling the RDP username and Password

2. Connect via Client

Open Remmina and click “+”. Choose RDP and give the credentials the Remote user and password OS (not the RDP yet). Once you connected, then filling with the Login Details in RDP. Yes, we have two users/password here and you can set it to have same value.

Categories
Ubuntu

Solve multi-GPU not detected Docker-in-Docker Google Cloud

When I’m trying to do nvidia-smi inside the docker for multiple-gpus, its gave errors. I’m using docker API python module to run it. Checking on nvidia-gpus, its showing only single device, rather multiple

ls /proc/driver/nvidia/gpus

Solution is to ensure the gpus=all or gpus=2 is initialize properly. Running the docker manually first using

docker run --name caviar --detach --gpus all -it --privileged ghcr.io/ehfd/nvidia-dind:latest

This step showing all the GPUs is loaded. Then, the culprit is at Docker API. the proper way to do it is

Categories
Ubuntu

Fix docker compose project name must not be empty Docker-in-Docker

When running docker compose up for compose.yaml I got error:

docker compose up
WARN[0000] /docker-compose.yaml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion 
project name must not be empty

The quick solution is

  1. Rename it into docker-compose.yaml
  2. Move it into /home/USER like /home/ubuntu in this case.

Execute docker compose up from there.

Categories
LLM

Fix VLLM ValueError: Model architectures [‘Qwen2ForCausalLM’] failed to be inspected

When running VLLM, I got error “alueError: Model architectures [‘Qwen2ForCausalLM’] failed to be inspected”

vllm serve unsloth/DeepSeek-R1-Distill-Qwen-32B-bnb-4bit --enable-reasoning --reasoning-parser deepseek_r1 --quantization bitsa
ndbytes --load-format bitsandbytes --enable-chunked-prefill --max_model_len 6704 

The solution is put VLLM_USE_MODELSCOPE=True

For example

VLLM_USE_MODELSCOPE=True vllm serve unsloth/DeepSeek-R1-Distill-Qwen-32B-bnb-4bit --enable-reasoning --reasoning-parser deepseek_r1 --quantization bitsa
ndbytes --load-format bitsandbytes --enable-chunked-prefill --max_model_len 6704
Categories
Google Cloud

Fix Vertex AI Custom Job torch_xla $PJRT_DEVICE is not set.

Fix the problem running Vertex AI local-run with GPU based training docker asia-docker.pkg.dev/vertex-ai/training/pytorch-gpu.2-3.py310:latest producing error with Transformer Trainer()

gcloud ai custom-jobs local-run --gpu --executor-image-uri=asia-docker.pkg.dev/vertex-ai/training/pytorch-gpu.2-3.py310:latest --local-package-path=YOUR_PYTHON_PACKAGE --script=YOUR_SCRIPT_PYTHON_FILE

The error appear

/opt/conda/lib/python3.10/site-packages/transformers/training_args.py:1575: FutureWarning: `evaluation_strategy` is deprecated and will be removed in version 4.46 of 🤗 Transformers. Use `eval_strategy` instead
  warnings.warn(
Setting up Trainer...
Starting training...
  0%|          | 0/3060 [00:00<?, ?it/s]terminate called after throwing an instance of 'std::runtime_error'
  what():  torch_xla/csrc/runtime/runtime.cc:31 : $PJRT_DEVICE is not set.

exit status 139
ERROR: (gcloud.ai.custom-jobs.local-run) 
        Docker failed with error code 139.
        Command: docker run --rm --runtime nvidia -v -e  --ipc host 

This problem what(): torch_xla/csrc/runtime/runtime.cc:31 : $PJRT_DEVICE is not set. apparently because the PyTorch issue.

Categories
Google Cloud

Running Vertex AI Docker Training Locally

Downloading the vertex AI docker directly and running it locally as docker run will trigger `exit 1` error. The quick solution is to use

gcloud ai custom-jobs local-run

The detail at https://cloud.google.com/vertex-ai/docs/training/containerize-run-code-local

Categories
Google Cloud

Fix Google Cloud Vertex AI Attempted to access the data pointer on an invalid python storage.

After training using transformer, calling model.save_pretrained(path) trigger this error in Vertex AI Deep Learning VM. I’m using NVIDIA L4 instances and Jupyter Notebook.

This problem is not because transformers version after I tried several version.

This error happen because the model still in cuda GPU memory. To fix it, move the model to CPU first.

model.to('cpu')
model.save_pretrained('path')