# Can I get opencv to use gpu on python without using visual studio?

**URL:** <https://forum.opencv.org/t/can-i-get-opencv-to-use-gpu-on-python-without-using-visual-studio/13375>\
**Category:** Python\
**Tags:** gpu\
**Created:** [May 31, 2023, 2:35pm UTC](https://forum.opencv.org/t/can-i-get-opencv-to-use-gpu-on-python-without-using-visual-studio/13375 "2023-05-31T14:35:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![giwonkim](https://avatars.discourse-cdn.com/v4/letter/g/278dde/32.png) [@giwonkim](https://forum.opencv.org/u/giwonkim)\
**Post date:** [May 31, 2023, 2:35pm UTC](https://forum.opencv.org/t/can-i-get-opencv-to-use-gpu-on-python-without-using-visual-studio/13375/1 "2023-05-31T14:35:08Z")

</div>

Visual studio cannot be used because of the company’s security. I made a Python program using k-means with opencv to cluster colors, but the cpu consumption is too high.

Can I use gpu on opencv without visual studio? Please let me know if there is a way.

---

<div class="post-metadata">

**Author:** ![laurent.berger](https://avatars.discourse-cdn.com/v4/letter/l/ec9cab/32.png) [@laurent.berger](https://forum.opencv.org/u/laurent.berger)\
**Post date:** [May 31, 2023, 4:41pm UTC](https://forum.opencv.org/t/can-i-get-opencv-to-use-gpu-on-python-without-using-visual-studio/13375/2 "2023-05-31T16:41:54Z")

</div>

I don’t understand there is no relationship between vs and cuda.  
If you want cuda with opencv\_python you have to build yourself  
About kmeans there is no cuda function in opencv

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [May 31, 2023, 6:58pm UTC](https://forum.opencv.org/t/can-i-get-opencv-to-use-gpu-on-python-without-using-visual-studio/13375/3 "2023-05-31T18:58:20Z")

</div>

do not expect miracles. stuff doesn’t simply “run on a GPU”. because you want it. there has to be an actual implementation that targets GPUs.

OpenCV (almost) always comes with OpenCL support. learn about `UMat` (see also “T-API”).

> **[OpenCV Transparent API | LearnOpenCV #](https://learnopencv.com/opencv-transparent-api/)**
>
> How to use Transparent API ( T-API or TAPI ) in OpenCV 3 to significantly speed up existing code. TAPI uses OpenCL under the hood.

if you want CUDA specifically, you could give this a look:

> **[Releases · cudawarped/opencv-python-cuda-wheels](https://github.com/cudawarped/opencv-python-cuda-wheels/releases)**
>
> Automated CI toolchain to produce precompiled opencv-python, opencv-python-headless, opencv-contrib-python and opencv-contrib-python-headless packages. - cudawarped/opencv-python-cuda-wheels
