How to install GPU version OpenCV via conda?

6k views Asked by At

I can't get the sudo access and also have to install OpenCV4-GPU in the conda virtual environment via conda and pip. Thus, I can't use apt to install the OpenCV Dependencies.

Could someone help me with that? Or give me some comments on it. Many thanks!

1

There are 1 answers

1
Victor Sonck On

You can use CUDA enabled OpenCV in Python, I use it every day! But not using precompiled packages. That means you'll have to build OpenCV from scratch with CUDA support enabled. This means you'll have to setup your Nvidia drivers and CUDA/cuDNN on your system which is almost impossible to do without root privileges.

However, if your server already has these packages installed correctly, you can try to compile it like in this link. However, please bear in mind that this process is rather complicated and will require a lot of troubleshooting most of the time. Especially if you don't have root privileges. Also: the last 2 steps of the compilation process require root access. You could try and ask your system admin to do it for you OR setup a docker container with GPU access. You could work in that and compile OpenCV in the container.

Good luck!