Closed vajonam closed 3 years ago
I found the regex that matches the existing block, ^ARCH=\.*[\s\S]*\]
but sed needs to do acrobatics when doing multiline replacements.
that seems to do the trick,
perl -0777 -pe 's/^ARCH=\.*[\s\S]*\]/ARCH=FOOBAR/gm' -i Makefile
will leave to your on if you want to use perl
Do you need to override the whole thing or just add one to the beginning?
I actually need to remove a line from the begning
From Yolov4 readme
You also need to specify for which graphics card the code is generated. This is done by setting ARCH=. If you use a never version than CUDA 11 you further need to edit line 20 from Makefile and remove -gencode arch=compute_30,code=sm_30 \ as Kepler GPU support was dropped in CUDA 11. You can also drop the general ARCH= and just uncomment ARCH= for your graphics card.
I would like to override the whole thing, gives the most control, I was thinking something like
export DARKNET_BUILD_ARCH="-gencode arch=compute_61,code=sm_61 -gencode arch=compute_61,code=compute_61"
and have this replace the Makefile.
@bennetthardwick ping.. can you add this, I would like to avoid the steps of hand editing the Makefile during my container build. Thanks so much.
Hey sorry about the delay, I pushed f80401b and published 3.0.4. Let me know if that doesn't work for you :+1:
@bennetthardwick works perfectly thanks!
@bennetthardwick I finally got a GPU and while comping darknet for GPU, I found that I need to be able to specify the ARCH= for my GPU in the darknet makefile. Can you please add a
DARKNET_ARCH
enviroment variable I can set to be able to override theARCH=
setting in the darknet makefile.it seems that some arch's have been deprecated and cause compile issues on darknet.