How to Set Up Python, CUDA, cuDNN, C++ Build Tools, FFMPEG & Git for AI Applications

Community Article Published October 2, 2024

Tutorial Link : https://youtu.be/DrhUHnYfwC0

image

This comprehensive guide is essential for anyone looking to utilize AI, generative AI applications, and open source software on their personal computer. I'll walk you through the precise steps to correctly install specific Python versions, switch between them, and set up various CUDA and cuDNN versions. Additionally, I'll demonstrate how to install Microsoft Visual Studio and C++ Build Tools, which are necessary for compiling certain applications like InsightFace or XPose on your system.

Video Resources

🔗 Detailed Instructions Page (Freely Accessible) ⤵️

🔗 SECourses Discord Server for Comprehensive Assistance ⤵️

🔗 SECourses Reddit Community ⤵️

🔗 SECourses GitHub Repository ⤵️

🔗 Previous Essential Tutorial ⤵️

Recommended Versions as of September 30, 2024

  • Python 3.10.11
  • CUDA 12.4
  • cuDNN 8.9 - most recent version - manually added to system path
  • C++ Build Tools LTSC 17.8 - latest version

After completing this tutorial, you should be able to seamlessly use a wide range of AI applications, including Automatic1111 SD Web UI, Kohya, SUPIR, IDM VTON, LivePortrait, FaceFusion 3, Rope Pearl, Rope Next, Roop, InstantID, Forge Web UI, Fooocus, CogVideoX, SwarmUI, ComfyUI, Stable Diffusion, SDXL, SD3, ControlNet, and many others. This covers virtually all popular open-source and proprietary AI applications that can be run locally on Windows.

This video also addresses common errors, such as:

onnxruntime\python\onnxruntime_pybind_state.cc:866 onnxruntime::python::CreateExecutionProvider Instance CUDA_PATH is set but CUDA wasnt able to be loaded. Please install the correct version of CUDA and cuDNN as mentioned in the GPU requirements page

Video Sections

  • 0:00 Introduction to the tutorial
  • 2:00 Verifying current Python, FFMPEG, and CUDA versions
  • 2:28 Proper installation of Python 3.10 and 3.11
  • 4:25 Installing and understanding the importance of py launcher
  • 4:56 Changing default Python version to 3.10 after installing both 3.10 and 3.11
  • 5:10 Using system environment variables to set default applications
  • 6:15 Correct installation of Microsoft Visual Studio for on-device library compilation
  • 7:33 Uninstalling previously installed applications before proper reinstallation
  • 8:18 Proper installation of CUDA 11.8 and 12.4 on Windows for AI applications
  • 12:53 Switching between CUDA 11.8 and CUDA 12.4
  • 13:33 Downloading and setting up the latest FFMPEG
  • 16:03 Installing the latest cuDNN libraries
  • 17:23 Installing the correct C++ Compile Build Tools compatible with CUDA 11.x and 12.x
  • 19:12 Checking and removing previously installed C++ Compile Build tools
  • 20:30 Downloading and installing Git for repository cloning
  • 21:31 Installing and running LivePortrait AI on Windows, including animal Live Portrait
  • 23:28 Resolving frozen CMD issues, paused application installs or executions
  • 24:04 Exporting CMD installation logs on Windows 11 for error reporting
  • 24:49 Resolving the "CUDA_PATH is set but CUDA wasn't able to be loaded" error
  • 25:09 Installing older cuDNN 8.9.7 to fix CUDA-related errors
  • 27:34 Setting up and using nvitop to monitor GPU and VRAM usage
  • 28:56 Running the animal version of LivePortrait for animating animal faces
  • 29:55 Installing and running FaceFusion 3 locally
  • 30:31 Identifying and resolving Git-related cloning errors
  • 33:31 Addressing DLL-related ONNX Runtime errors in FaceFusion 3
  • 33:50 Fixing ONNX Runtime errors by copying cuDNN 9.4 DLL files
  • 34:38 Testing Face Fusion 3 with provided demo materials