NOTE: Pytorch3d no longer has to be compiled i have stripped out the function we use to make this a lot easier and also so we do not have to use WSL2 with linux and can now run directly on your windows system, i will leave this guide here for those that still want to explore working with linux wich i do still recommend.
Comments section is not checked often for issues please join the disco diffusion discord for assistance
You may now use the official disco diffusion notebook with this tutorial as it has been uodated to reflect the changes here for better cross platform support
Make sure to run PowerShell as Administrator.
(CHOOSE ONE!)
- Option A (control panel)
- Open control panel and click "Programs" from here select "Turn windows feature on or off"
- This should have opened a new window with a list of features, scroll all the way to the bottom
- Select "Windows Subsystem for Linux"
- Also select "Virtual Machine Platform"
- Restart your pc after installing
- Open control panel and click "Programs" from here select "Turn windows feature on or off"
- Option B (PowerShell)
- PowerShell:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
- PowerShell:
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
- Restart your pc after installing
- PowerShell:
Make sure to run PowerShell as Administrator.
- Update Windows 10 to version 21H2
- This might be listed under the "view optional updates" text/link on the update page
- check current version
- PowerShell:
winver
- PowerShell:
wsl -l -v
- PowerShell:
- If you do not have wsl version 2 from wsl command
- Make sure you have "Receive updates for other Microsoft products when you update Windows" checked in Advanced options of the Updates sections
- If unchecked rerun the windows update process again
- PowerShell:
wsl --update
- Make sure you have "Receive updates for other Microsoft products when you update Windows" checked in Advanced options of the Updates sections
- After updating WSL to version 2 we need to tell it to use version 2 on current distro and future ones
- PowerShell:
wsl --set-default-version 2
- PowerShell:
- Open the microsoft store app and search "Linux", i went with Ubuntu 20.04
- Setup username and password for linux distribution
- Run the following command to update some things
- Linux:
sudo apt update && sudo apt upgrade -y
- Linux:
- Download anaconda
- Linux:
wget https://repo.anaconda.com/archive/Anaconda3-2021.11-Linux-x86_64.sh
- Linux:
- Install the library
- Linux:
bash Anaconda3-2021.11-Linux-x86_64.sh
- Linux:
- Refesh bash for anaconda install
- Linux:
source ~/.bashrc
- Linux:
- Start Conda & Install Dependencies
- Linux:
conda config --set channel_priority false
conda update --all --yes
conda create -n disco_v5 python=3.8.10 --yes
conda activate disco_v5
conda install -c conda-forge opencv --yes
conda install pytorch=1.10.0 torchvision torchaudio cudatoolkit=11.3 -c pytorch -c conda-forge --yes
- Linux:
- Install needed pip dependencies
- Linux:
pip install lpips datetime timm pandas matplotlib ftfy
- Linux:
pip install opencv-python ipywidgets omegaconf>=2.0.0
- Linux:
pip install pytorch-lightning>=1.0.8 torch-fidelity einops wandb
- Linux:
pip install --upgrade jupyter_http_over_ws>=0.0.7
- Linux:
- Enable the extension for jupyter
- Linux:
jupyter serverextension enable --py jupyter_http_over_ws
- Linux:
- Start the jupyter server
- Linux:
jupyter notebook --NotebookApp.allow_origin='https://colab.research.google.com' --port=8888 --NotebookApp.port_retries=0 --no-browser
- Linux:
OK! made progress, but now for some reason unknow got this error. I manage to install everything in the tutorial using the mamba on top of conda. but when i run the notebook locally i get this error. :(
RuntimeError Traceback (most recent call last)
Input In [5], in <cell line: 176>()
173 print('Using device:', DEVICE)
174 device = DEVICE # At least one of the modules expects this name..
--> 176 if torch.cuda.get_device_capability(DEVICE) == (8,0): ## A100 fix thanks to Emad
177 print('Disabling CUDNN for A100 gpu', file=sys.stderr)
178 torch.backends.cudnn.enabled = False
File ~/anaconda3/envs/disco_v5/lib/python3.8/site-packages/torch/cuda/init.py:342, in get_device_capability(device)
329 def get_device_capability(device: Optional[_device_t] = None) -> Tuple[int, int]:
330 r"""Gets the cuda capability of a device.
331
332 Args:
(...)
340 tuple(int, int): the major and minor cuda capability of the device
341 """
--> 342 prop = get_device_properties(device)
343 return prop.major, prop.minor
File ~/anaconda3/envs/disco_v5/lib/python3.8/site-packages/torch/cuda/init.py:356, in get_device_properties(device)
346 def get_device_properties(device: _device_t) -> _CudaDeviceProperties:
347 r"""Gets the properties of a device.
348
349 Args:
(...)
354 _CudaDeviceProperties: the properties of the device
355 """
--> 356 _lazy_init() # will define _get_device_properties
357 device = _get_device_index(device, optional=True)
358 if device < 0 or device >= device_count():
File ~/anaconda3/envs/disco_v5/lib/python3.8/site-packages/torch/cuda/init.py:214, in _lazy_init()
210 raise AssertionError(
211 "libcudart functions unavailable. It looks like you have a broken build?")
212 # This function throws if there's a driver initialization error, no GPUs
213 # are found or any other error occurs
--> 214 torch._C._cuda_init()
215 # Some of the queued calls may reentrantly call _lazy_init();
216 # we need to just return without initializing in that case.
217 # However, we must not let any other threads in!
218 _tls.is_initializing = True
RuntimeError: Unexpected error from cudaGetDeviceCount(). Did you run some cuda functions before calling NumCudaDevices() that might have already set an error? Error 2: out of memory