Hello, first time posting here so apologies firsthand if it’s an already asked question or any mistakes made.
I’m currently trying to compile a pointnet2 PyTorch implementation as a function library/module from this repo 2 which borrowed the idea from this previous repo 1.
For reference, I’m currently trying to perform this within a Virtual Environment that uses Python 3.6.9, with Pytorch version 1.7.1+cu110, CUDA version 11.1, NVCC version 10.1. Machine is running Pop_OS 18.04 LTS which is a derivative of the Ubuntu 18.04 LTS OS.
NVCC --version output:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Fri_Feb__8_19:08:17_PST_2019
Cuda compilation tools, release 10.1, V10.1.105

nvidia-smi output:
Wed Dec 16 04:53:03 2020       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 455.28       Driver Version: 455.28       CUDA Version: 11.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce GTX 108...  Off  | 00000000:01:00.0  On |                  N/A |
| 48%   30C    P8    18W / 250W |    837MiB / 11177MiB |      6%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1343      G   /usr/bin/gnome-shell               92MiB |
|    0   N/A  N/A      1771      G   /usr/lib/xorg/Xorg                378MiB |
|    0   N/A  N/A      1862      G   /usr/bin/gnome-shell              215MiB |
|    0   N/A  N/A      2227      G   ...oken=14138817340175859824       12MiB |
|    0   N/A  N/A      2465      G   ...AAAAAAAAA= --shared-files       83MiB |
|    0   N/A  N/A      5915      G   ...AAAAAAAAA= --shared-files       11MiB |
|    0   N/A  N/A     11099      G   ...AAAAAAAAA= --shared-files       24MiB |
+-----------------------------------------------------------------------------+

Following the repo instructions, I’ve managed to actually compile the library and have it installed into my virtual environment, as can be seen below:
(test_env) nick_pc@pop-os:~/3DSSD-pytorch/lib/pointnet2$ python setup.py install
running install
running bdist_egg
running egg_info
writing pointnet2.egg-info/PKG-INFO
writing dependency_links to pointnet2.egg-info/dependency_links.txt
writing top-level names to pointnet2.egg-info/top_level.txt
/home/nick_pc/.virtualenvs/qe_env/lib/python3.6/site-packages/torch/utils/cpp_extension.py:352: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
  warnings.warn(msg.format('we could not find ninja.'))
reading manifest file 'pointnet2.egg-info/SOURCES.txt'
writing manifest file 'pointnet2.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_ext
creating build/bdist.linux-x86_64/egg
copying build/lib.linux-x86_64-3.6/pointnet2_cuda.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/egg
creating stub loader for pointnet2_cuda.cpython-36m-x86_64-linux-gnu.so
byte-compiling build/bdist.linux-x86_64/egg/pointnet2_cuda.py to pointnet2_cuda.cpython-36.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying pointnet2.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pointnet2.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pointnet2.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pointnet2.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
__pycache__.pointnet2_cuda.cpython-36: module references __file__
creating 'dist/pointnet2-0.0.0-py3.6-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing pointnet2-0.0.0-py3.6-linux-x86_64.egg
creating /home/nick_pc/.virtualenvs/qe_env/lib/python3.6/site-packages/pointnet2-0.0.0-py3.6-linux-x86_64.egg
Extracting pointnet2-0.0.0-py3.6-linux-x86_64.egg to /home/nick_pc/.virtualenvs/qe_env/lib/python3.6/site-packages
Adding pointnet2 0.0.0 to easy-install.pth file

Installed /home/nick_pc/.virtualenvs/qe_env/lib/python3.6/site-packages/pointnet2-0.0.0-py3.6-linux-x86_64.egg
Processing dependencies for pointnet2==0.0.0
Finished processing dependencies for pointnet2==0.0.0

However, whenever I try to actually import the compiled library, I instead get the following error stating that there isn’t a libcudart.so.9.0, indicating that the library expects CUDA version 9.0 instead.
>>> import pointnet2_cuda as pointnet2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: libcudart.so.9.0: cannot open shared object file: No such file or directory

I’m currently under the impression that the cause of this is because the CUDA code used to define the pointnet2 libary was somehow written to use CUDA 9.0, however I’m very new to CUDA programming so I’m likely quite wrong on this aspect as well. So far all other PyTorch codes that don’t rely on much older versions of PyToch has not faced any similar issue on this machine.
I don’t want to downgrade the CUDA version, so what I’m wondering is whether there is a way to force the library to be compiled using the CUDA version that I have so that it could be used within my Virtual Environment?
Looking forward to any suggestions/help, and thank you for any replies firsthand!
EDIT: Fixed structure of post
EDIT2: Changed the tag to be more appropriate
EDIT3: Changed some wording to clarify the intention of the PyTorch Extension