This should help to get the basics of a fresh linux install working properly with current nvidia drivers (560), cuda (12.6) and miniconda (python 3.10, 3.11, 3.12 etc).
Many linux guides don't adequately explain these important steps to get things setup right.
This guide presumes you are able to install an ubuntu based linux distro safely to empty ssd.
If not check youtube for guides and i recommend unplugging all other drives before installing if unsure.
It should also work if you're using Windows WSL, although i've not tested so check second video as driver install may not be needed.
After linux is installed go to update manager and install any updates.
If you have any issues or prefer videos then these are very helpful.
Open terminal and copy/paste the following command lines one at a time.
Check current nvidia driver version and install 560.
nvidia-smiDriver is from here if you want to check latest version...
https://launchpad.net/~graphics-drivers/+archive/ubuntu/ppa
sudo add-apt-repository ppa:graphics-drivers/ppasudo apt updatesudo apt install nvidia-driver-560Reboot PC.
Check version is correct and install CUDA.
nvidia-smisudo apt install -y build-essentialwget https://developer.download.nvidia.com/compute/cuda/12.6.3/local_installers/cuda_12.6.3_560.35.05_linux.runsudo sh cuda_12.6.3_560.35.05_linux.runAfter accepting make sure to uncheck drivers 560 at top of menu if they are selected.
sudo apt updatesudo apt upgradenano ~/.bashrcPress the down arrow and copy this text to end of file.
export PATH=/usr/local/cuda-12.6/bin${PATH:+:${PATH}}export LD_LIBRARY_PATH=/usr/local/cuda-12.6/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}Press ctrl+o to save then ctrl+x to exit.
source ~/.bashrcCheck cuda is working.
nvcc --versionInstall miniconda.
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.shbash ./Miniconda3-latest-Linux-x86_64.shPress enter > pgdn > yes > enter > yes
Close terminal then open terminal, you should see (base) at start and python should be 3.10.
You may also need if asked.
sudo apt update -y && sudo apt install -y python3-tkpython --versionsudo apt install gitYou can stop here and install any generator or trainer using existing guides.
Recommended to increase swapfile size to 32gb to avoid crashing!
sudo swapon --showsudo swapoff -asudo dd if=/dev/zero of=/swapfile bs=1M count=32768 status=progresssudo chmod 600 /swapfilesudo mkswap /swapfilesudo swapon /swapfilesudo swapon --showsudo nano /etc/fstabAdd the following line to the end of the file if it doesn't exist.
/swapfile none swap sw 0 0Bonus if using linux mint (not tested on ubuntu) you can disable the os gui and run like a server from command line.
This saves a small amount of vram and performance.
sudo nano /etc/default/grubChange "quiet splash" to "text"
Press ctrl+o to save then ctrl+x to exit.
sudo update-grubsudo systemctl set-default multi-user.targetReboot PC.
Login and press up arrow to switch to whatever training/generating folders scripts you use.
To open desktop.
startxExtra quick ComfyUI install guide: https://github.com/comfyanonymous/ComfyUI?tab=readme-ov-file#installing
This is the command to install pytorch nightly instead which might have performance improvements.
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu124pip install -r requirements.txtRun ComfyUI with --listen 0.0.0.0 to access from another browser on network to save performance otherwise remove.
cd ComfyUIpython main.py --listen 0.0.0.0Install node manager https://github.com/ltdrdata/ComfyUI-Manager
cd ComfyUI/custom_nodesgit clone https://github.com/ltdrdata/ComfyUI-Manager.gitHopefully this is helpful to anyone struggling with basic linux setup. Let me know how it goes! :)




