Coder Social home page Coder Social logo

Comments (4)

th3j0ker avatar th3j0ker commented on July 24, 2024 3

Installing DLF on Linux for Noobs (like me)

Firstly thanks @nagadit for maintaining this repo, It helps a lot!

After a few days of research I was finally able to run DFL on linux with RTX3060 mobile GPU, anyone who is struggling with the same issue as I can follow these steps,

CPU => AMD Ryzen 9 5900HX with Radeon Graphics
GPU => Nvidia RTX-3060 Mobile GPU
OS => Ubuntu 21.10
Kernel=> 5.13.0-21-generic #21-Ubuntu SMP Tue Oct 19 08:59:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

I tested multiple linux distros (Fedora,Manjaro,Garuda,mint etc) and the one that was working perfectly with minimum hassle for installation was ubuntu, I used 21.10 because 20.04(LTS) was missing drivers for my mediatek network card you can use that too if you wish.

I realised that the cudatoolkit and cudnn that i was trying to install via anaconda (apart from being outdated) was not able to detect my GPU, so I decided to install all directly to system, instead of using conda install cudatoolkit.

Step 1.) install proprietary nvidia drivers from repository,

for some reason the latest driver for my RTX was not working properly hence I installed a stable one by typing in shell,

sudo apt install nvidia-driver-470

once installed, reboot.

type in shell nvidia-smi to verify installation

Step 2.) install cudatoolkit from repository,

**Important: If you install a cudatoolkit version that is not compatible with your driver it will automatically uninstall your currently installed nvidia driver.

check for version compatibility at https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html

sudo apt install nvidia-cuda-toolkit

this for me installed 11.3 cuda which is indeed compatible with nvidia 470 driver,

once this is installed, reboot.

type in shell nvcc --version to verify installation

Step 3.) install cudnn from nvidia official website,

for nvidia cudnn download, you will have to sign up for nvidia developers account and proceed with installation.

url: https://developer.nvidia.com/cudnn

be careful, cudnn should be compatible with the cuda version that we installed in previous step, so in by case the cudnn should be compatible with 11.3, which was 8.2.1.

choose a version that is compatible with your cuda version and download all three files .deb, i.e.

libcudnn8_8.2.1.32-1+cuda11.3_amd64.deb
libcudnn8-dev_8.2.1.32-1+cuda11.3_amd64.deb
libcudnn8-samples_8.2.1.32-1+cuda11.3_amd64.deb

install these with dpkg and reboot.

Step 4.) install anaconda

goto: https://www.anaconda.com/products/individual

download and install

Step 5.) setup conda environment

move to directory of your choice and type in shell,

conda create -n deepfacelab -c main python=3.9
conda activate deepfacelab

Note: removed cudnn and cudatoolkit as they are no longer required to be installed with conda

Step 6.) Initialize Deepfacelab environment

 git clone --depth 1 https://github.com/nagadit/DeepFaceLab_Linux.git
 cd DeepFaceLab_Linux
 git clone --depth 1 https://github.com/iperov/DeepFaceLab.git

Step 7.) install python requirements

Open requirements-cuda.txt file by typing,

nano DeepFaceLab/requirements-cuda.txt

and change the requirements file to,

opencv-python==4.1.2.30
tensorflow-gpu
tqdm
numpy
numexpr
h5py
ffmpeg-python
scikit-image
scipy
colorama
pyqt5
tf2onnx

save and proceed to installation by typing in shell

python -m pip install -r ./DeepFaceLab/requirements-cuda.txt

Finally!!

Step 8.) changing env.sh file in scripts,

goto scripts by typing in shell,

cd scripts/

open env.sh,

nano env.sh

edit the following line,

export DFL_PYTHON="python3.7"

and replace 3.7 with 3.9,

export DFL_PYTHON="python3.9"

save and exit

Step 9.) Enjoy!!!!!

from deepfacelab_linux.

billfang235 avatar billfang235 commented on July 24, 2024

As a reminder for myself and a note for people wondering the opencv-python==4.1.2.30 in requirements-cuda.txt, if pip could not find opencv-python==4.1.2.30, opencv-python-headless is a feasible alternative (tested in wslg).
opencv-python may induce load error in wlsg.https://github.com/NVlabs/instant-ngp/discussions/300

If Xseg editor cannot open display in wslg, check here https://github.com/microsoft/wslg/issues/558#issuecomment-1260817709.

from deepfacelab_linux.

smaiht avatar smaiht commented on July 24, 2024

I dont know, it's not working at all...

from deepfacelab_linux.

laurentbenaroya avatar laurentbenaroya commented on July 24, 2024

I have the same problem. I tried the proposed solution, but it doesn't solve the problem. In 5_Xseg_train.sh, the CPU is automatically selected.

from deepfacelab_linux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.