Skip to content

Instantly share code, notes, and snippets.

# Tested on Python3.10 only
# Reference: https://medium.com/@yunchaohe/steps-to-build-and-install-trt-llm-without-docker-and-root-privileges-75b5c175d0a7
conda create -n <env> python=3.10 -y
conda activate <env>
# git lfs is required
# you may use conda install git-lfs
pip install uv
uv pip install cmake
# Install Homebrew and prioritize linuxbrew binaries
mkdir ~/.linuxbrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C ~/.linuxbrew
eval "$(~/.linuxbrew/bin/brew shellenv)"
brew update --force --quiet
chmod -R go-w "$(brew --prefix)/share/zsh"
echo -e "\n# linuxbrew" >> ~/.zshrc
echo eval '"$($HOME/.linuxbrew/bin/brew shellenv)"' >> ~/.zshrc
echo export 'PATH="$HOME/.linuxbrew/bin:$PATH"' >> ~/.zshrc
echo export 'BREW_PREFIX=$(brew --prefix)' >> ~/.zshrc
@tchayintr
tchayintr / fix_failed_initialize_nvml_ollama
Created March 27, 2025 01:28
Fix Failed to initialize NVML: Unknown Error in ollama Docker container
# https://github.com/ollama/ollama/issues/4604
# Add `"exec-opts": ["native.cgroupdriver=cgroupfs"]` to `/etc/docker/daemon.json`
```
{
"default-runtime": "nvidia",
"runtimes": {
"nvidia": {
"args": [],
"path": "nvidia-container-runtime"
}
# What you will get from this Gist
## `python` command can be executed in `Command Prompt` and `Windows PowerShell`
## Learn how to simply use Python built-in `venv`
# Download Python Installer
Download Python (3.12 64-bit is recommended) from their official website (https://www.python.org/downloads/)
- https://www.python.org/ftp/python/3.12.7/python-3.12.7-amd64.exe
# Install Python
Launch the installer
uname -r # To check current kernal version
sudo vim /etc/apt/apt.conf.d/50unattended-upgrades
```
Unattended-Upgrade::Allowed-Origins {
"${distro_id}:${distro_codename}";
"${distro_id}:${distro_codename}-security";
"${distro_id}ESMApps:${distro_codename}-apps-security";
"${distro_id}ESM:${distro_codename}-infra-security";
// "${distro_id}:${distro_codename}-updates";
// "${distro_id}:${distro_codename}-proposed";
# To check if found portaudio if return nothing, the setup was not completed
ldconfig -p | grep portaudio
# Add to .bash_profile
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/<username>/.linuxbrew/lib
# Update the Linker Cache
ldconfig
# Or the last resort is
# Check CUDA archives at https://developer.nvidia.com/cuda-downloads
# Check cuDNN archives at https://developer.nvidia.com/cudnn-downloads
# Paths and variables
CUDA_VERSION = 12.6
WORKING_DIR = "~/nvidia_gpu_setup"
CUDA_TOOLKIT_FILENAME=cuda_12.6.0_560.28.03_linux.run
CUDA_TOOLKIT_PATH=https://developer.download.nvidia.com/compute/cuda/12.6.0/local_installers/cuda_12.6.0_560.28.03_linux.run
CUDNN_DIR="cudnn-linux-x86_64-9.3.0.75_cuda12-archive"
CUDNN_FILENAME=$CUDNN_DIR.tar.xz