# How to compile opencv to support CUDA multi arch for 7.5 and 8.6

**URL:** <https://forum.opencv.org/t/how-to-compile-opencv-to-support-cuda-multi-arch-for-7-5-and-8-6/12220>\
**Category:** Uncategorized\
**Tags:** build, cuda\
**Created:** [March 3, 2023, 8:30am UTC](https://forum.opencv.org/t/how-to-compile-opencv-to-support-cuda-multi-arch-for-7-5-and-8-6/12220 "2023-03-03T08:30:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![toplinuxsir](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@toplinuxsir](https://forum.opencv.org/u/toplinuxsir)\
**Post date:** [March 3, 2023, 8:30am UTC](https://forum.opencv.org/t/how-to-compile-opencv-to-support-cuda-multi-arch-for-7-5-and-8-6/12220/1 "2023-03-03T08:30:38Z")

</div>

How to compile opencv to support CUDA multi arch for 7.5 and 8.6?  
-D CUDA\_ARCH\_BIN = “7.5 8.6” -D CUDA\_ARCH\_PTX=“7.5 8.6” ?  
That’s right ? Thanks!

---

<div class="post-metadata">

**Author:** ![cudawarped](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@cudawarped](https://forum.opencv.org/u/cudawarped)\
**Post date:** [March 3, 2023, 8:54am UTC](https://forum.opencv.org/t/how-to-compile-opencv-to-support-cuda-multi-arch-for-7-5-and-8-6/12220/2 "2023-03-03T08:54:43Z")

</div>

If you know that you are only going to use 7.5 and 8.6 then

> -DCUDA\_ARCH\_BIN = 7.5,8.6

if you want it to be forward compatible with any future generations just incase you could also include the ptx, i.e.

> -DCUDA\_ARCH\_PTX=8.7
