How to install python and deep learning libraries
1. Check if your computer has an NVIDIA graphics card
Platform |
Steps |
|---|---|
Windows |
|
Linux |
|
macOS |
The required NVIDIA GPU is not supported on macOS. |
2. Check the maximum supported CUDA version of your NVIDIA GPU
If your computer is running macOS or is not equipped with an NVIDIA graphics card, please skip this step.
Platform |
Steps |
|---|---|
Windows |
|
Linux |
|
Note
Older NVIDIA GPUs may not support the nvidia-smi command or may not display CUDA version.
If this happens, try updating your graphics card drivers first and check again.
Otherwise, your graphics card does not support CUDA.
Now, please check if your computer meets the basic requirements for running. If it does, you can continue with the next steps. Otherwise, your computer cannot run the project participating in LiGHTLIN through the following configuration methods.
Platform |
CPU only or nonuse GPU or non-CUDA GPU or NVIDIA GPU with CUDA < 11.8 |
NVIDIA GPU with CUDA >= 11.8 |
|---|---|---|
Windows 10/11 64-bit |
❌ |
✅ |
Linux x86-64 |
✅ |
✅ |
Otherwise (including macOS) |
❌ |
❌ |
3. Download and install Miniconda
If your computer has already installed Anaconda or Miniconda, please skip this step.
Platform |
Installation Steps |
|---|---|
Windows |
|
Linux |
|
4. Launch CONDA environment (for daily use)
Platform |
Steps to Launch |
|---|---|
Windows |
|
Linux |
|
5. Create a Python 3.12 virtual environment
Type conda create --name lightlin python=3.12 in the CONDA environment and press Enter.
Here, lightlin is the name of the virtual environment, and you can also change it to another name.
Please wait for the execution to complete before proceeding to the next step.
6. Activate the virtual environment (for daily use)
Type conda activate lightlin in the CONDA environment and press Enter.
When the beginning of a new line changes to (lightlin), it indicates a successful virtual environment switch.
Here, lightlin needs to be replaced with the virtual environment name you taken.
7. Install PyTorch and popular point-cloud-based deep learning libraries
If you encounter any errors while performing the steps correctly, it means that your system environment is not compatible and you should replace your computer for use.
Please select the corresponding command based on the result from Step 2 and run it in the activated virtual environment (such as lightlin).
Install PyTorch
Warning
This step is very easy to choose incorrectly, please read it carefully!
For NVIDIA Blackwell-architecture GPUs (such as Geforce RTX 50 series), YOU MUST INSTALL cu128! Please refer to here for the specific products included. Otherwise, PyTorch will cause an error like
NVIDIA GeForce RTX 5070 Ti with CUDA capability sm_120 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_61 sm_70 sm_75 sm_80 sm_86 sm_90 compute_37.
If you want to use the NVIDIA GeForce RTX 5070 Ti GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/
For NVIDIA GPUs prior to the Blackwell architecture (such as Geforce RTX 40 series and earlier), you can choose to install cu126 or cu118, but DO NOT INSTALL cu128, otherwise spconv will cause an error like
N > 0 assert faild. CUDA kernel launch blocks must be positive, but got N= 0
CUDA Version |
PyTorch |
Command |
|---|---|---|
>= 12.8 |
cu128 |
|
>= 12.6 |
cu126 |
|
>= 11.8 |
cu118 |
|
Not using CUDA |
cpu |
|
PyTorch Version |
Command |
|---|---|
cu128 |
For Windows:
For Linux x86-64:
|
cu126 |
|
cu118 |
|
cpu |
|
Install PyG (Pytorch Geometric)
PyTorch Version |
Command |
|---|---|
cu128 |
pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.7.0+cu128.html
pip install torch_geometric
|
cu126 |
pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.7.0+cu126.html
pip install torch_geometric
|
cu118 |
pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.7.0+cu118.html
pip install torch_geometric
|
cpu |
pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.7.0+cpu.html
pip install torch_geometric
|
Install NVIDIA Kaolin Library
PyTorch Version |
Command |
|---|---|
cu128 |
|
cu126 |
|
cu118 |
|
cpu |
|
8. Verify Installation
To ensure everything works properly later, please check your installation with the following steps:
Run Steps 4 and 6 to activate the target virtual environment.
Type
pip listand carefully check that the suffixes of pytorch, spconv, and kaolin are consistent with each other and compatible with your CUDA Version.Type
python.In the output, verify that the Python version is
3.12.X(you can ignore the X).Type the following commands one by one and press Enter after each:
import torch
import spconv
import torch_scatter
import kaolin
import torch_geometric
torch.cuda.is_available()
If no errors are reported, everything has been installed successfully!
Finally, you can type exit() and press Enter to exit Python.
9. Postscript (for daily use)
In the virtual environment, you need to master how to change the working directory
cd "/path/of/your/project" # For Linux
REM For Windows
cd /d "D:\path\of\your\project"
Note
The working directory is the folder where your commands are executed. You can see it in the prompt before you type a command, e.g.:
On Linux: the path shown before the
$,#etc, e.g.ubuntu@linuxopsys:~/path/of/your/project$(lightlin) [root@pc project]#(in the latter case, run
pwdto show the full path/path/of/your/project).On Windows: the path shown before the
>, e.g.D:\path\of\your\project>(base) D:\path\of\your\project>
and execute Python files by
python your_script.py
or using command-line arguments like
python your_script.py -h
We also recommend that you master the basic usage methods of conda and pip.
For example:
Clean after installing the library to save disk space:
conda clean -a
pip cache purge
Exit the current virtual environment to activate the default (base) environment:
conda deactivate
Remove a virtual environment:
conda env remove -n your_env_name