Can Unreal 5 run without the 10GiB PyTorch?

I have limited SSD space and won’t use Machine Learning. Can I run UE5 with PyTorch deleted?

3 Likes

Yes - you can delete the PythonFoundationPackages plugin and run UE5. You will not be able to use certain experimental features such as the MLDeformer plugin.

Actually you can’t. If you delete PythonFoundationPackages or just torch folders Unreal Engine (as for 5.1.1) will download them back.

The interesting thing (besides having 5.7 GB of PyTorch you’re not using) that Unreal also is saving 4.1 GB of PyTorch just for Linux (???) and 0.4 GB for Mac (???). In sum it’s 10.3 GB of PyTorch. Is it a bug? Is it neccessary?

1 Like

I’ve found a solution for myself - wrote .bat file that replaces all files inside torch directories with empty files of the same names.
I’ve checked - the next time you launch EGS it wouldn’t notice the difference and wouldn’t try to redownload them.

How it works:

  1. Create .bat file with whatever name you find appropriate. I’ve named mine reduce_to_atoms.bat. Copy the contents below to your .bat file.
@echo off
echo This script will permanently empty all files in the current and child directories.
echo Be careful before using it!
echo.
pause
for /f "delims=" %%f in ('dir /s /b /a-d ^| findstr /v ".bat"') do (
  echo. > "%%f"
)
echo Done...
pause
  1. Put .bat in one the three torch folders that you want to occupy less space (UE_5.1\Engine\Plugins\Experimental\PythonFoundationPackages\Content\Python\Lib\Win64\site-packages\torch or similar folders for Linux or Mac`)

  2. Run it, press any button to confirm. Be careful - this .bat will actually empty all files in current directory and children folders wherever you run it.

  3. Voila, you just saved 10GB of disk space. (probably until next big Unreal Engine update)

3 Likes

Can we know what other plugins depend on it besides MLDeformer which you mentioned? I’m about to delete the PythonFoundationPackages, and we need to know it’s safe to be deleted.