Unsupported gpu architecture compute_30 on a CUDA 5 capable gpu
Asked Answered
H

2

19

I'm currently trying to compile Darknet on the latest CUDA toolkit which is version 11.1. I have a GPU capable of running CUDA version 5 which is a GeForce 940M. However, while rebuilding darknet using the latest CUDA toolkit, it said

nvcc fatal : Unsupported GPU architecture 'compute_30'

compute_30 is for version 3, how can it fail while my GPU can run version 5 Is it possible that my code detected my intel graphics card instead of my Nvidia GPU? if that's the case, is it possible to change its detection?

Hege answered 10/11, 2020 at 18:17 Comment(1)
Your darknet build harness will need to be changed to remove the reference to compute_30 in order for it to be usable with CUDA 11.x. CUDA 11.x no longer supports compute capability 3.0. This particular error has nothing to do with the GPU you have (this is a compile-time issue, and the compile process does not depend on a particular GPU).Isopleth
O
34

Support for compute_30 has been removed for versions after CUDA 10.2. So if you are using nvcc make sure to use this flag to target the correct architecture in the build system for darknet

-gencode=arch=compute_50,code=sm_50

You may also need to use this one to avoid a warning of architectures are deprecated.

-Wno-deprecated-gpu-targets 
Ocrea answered 10/11, 2020 at 18:49 Comment(2)
While a correct observation, how does this answer the question? What should be done to solve the problem?Jessejessee
For anyone else reading this question and to answer @talonmies' comment, somewhere in your Makefile you should find a reference to compute_30. You can replace it with compute_50. In the case of darknet, as an example, compute_20 is already commented out: # -gencode arch=compute_20,code=[sm_20,sm_21] \ This one is deprecated?. You can do the same with compute_30 to comment it out as there are other compute_## flags specified that will take its place (compute_35, compute_50, compute_52).Melyndamem
H
1

I added the following:

makefiletemp = open('Makefile','r+') 
list_of_lines = makefiletemp.readlines()
list_of_lines[15] = list_of_lines[14]
list_of_lines[16] = "ARCH= -gencode arch=compute_35,code=sm_35 \\\n"

makefiletemp = open('Makefile','w')
makefiletemp.writelines(list_of_lines)
makefiletemp.close()

right before the #Compile Darknet

!make

command. That seemed to work!

Hals answered 3/5, 2021 at 22:27 Comment(1)
That's one way to edit a file!Sitsang

© 2022 - 2024 — McMap. All rights reserved.