setup.ps1 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. ## enable or disable installed components
  2. $install_cuda=$false
  3. $vcpkg_folder=".\"
  4. $temp_folder=".\temp"
  5. ###########################
  6. New-Item -Path . -Name $temp_folder -ItemType "directory"
  7. Set-Location $temp_folder
  8. # Download and install Chocolatey
  9. Set-ExecutionPolicy unrestricted
  10. Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
  11. choco.exe install -y cmake ninja powershell git vscode
  12. choco-exe install -y visualstudio2019buildtools --package-parameters "--add Microsoft.VisualStudio.Component.VC.CoreBuildTools --includeRecommended --includeOptional --passive --locale en-US --lang en-US"
  13. if ($install_cuda) {
  14. # Download and install CUDA
  15. Invoke-WebRequest https://developer.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.105_418.96_win10.exe -OutFile .\cuda_setup.exe
  16. .\cuda_setup.exe -s nvcc_10.1 cuobjdump_10.1 nvprune_10.1 cupti_10.1 gpu_library_advisor_10.1 memcheck_10.1 nvdisasm_10.1 nvprof_10.1 visual_profiler_10.1 visual_studio_integration_10.1 cublas_10.1 cublas_dev_10.1 cudart_10.1 cufft_10.1 cufft_dev_10.1 curand_10.1 curand_dev_10.1 cusolver_10.1 cusolver_dev_10.1 cusparse_10.1 cusparse_dev_10.1 nvgraph_10.1 nvgraph_dev_10.1 npp_10.1 npp_dev_10.1 nvrtc_10.1 nvrtc_dev_10.1 nvml_dev_10.1 occupancy_calculator_10.1 fortran_examples_10.1
  17. $env:CUDA_PATH = "${env:ProgramFiles}\NVIDIA GPU Computing Toolkit\CUDA\v10.1"
  18. $env:CUDA_PATH_V10_1 = $env:CUDA_PATH
  19. $env:CUDA_TOOLKIT_ROOT_DIR = $env:CUDA_PATH
  20. $env:PATH += ";${env:CUDA_PATH}\bin;"
  21. $features = "full"
  22. }
  23. else {
  24. $features = "opencv-base,weights,weights-train"
  25. }
  26. Remove-Item -r $temp_folder
  27. Set-Location ..
  28. Set-Location $vcpkg_folder\
  29. git.exe clone https://github.com/Microsoft/vcpkg
  30. Set-Location vcpkg
  31. .\bootstrap-vcpkg.bat
  32. .\vcpkg.exe install darknet[${features}]:x64-windows