Failed to build Knet on a Windows 7 64 bit machine without GPU

33 views
Skip to first unread message

Iulian-Vasile Cioarca

unread,
Apr 17, 2019, 4:28:41 AM4/17/19
to knet-users
Hello, 

I successfully built and used Knet on a Windows 10 machine with Nvidia GPU. I also successfuly trained a model for traffic sign recognition.
Now I am trying to use the model on Windows 7 machine with no GPU and I get the following error when building Knet:

Building CuArrays ────────→ `C:\Users\cioarca\.julia\packages\CuArrays\qZCAt\deps\build.log`
┌ Error: Error building `CuArrays`:
│ Dependent package CUDAdrv.jl has not been built successfully
└ @ Pkg.Operations C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Pkg\src\Operations.jl:1075

  Building Knet ────────────→ `C:\Users\cioarca\.julia\packages\Knet\05UDD\deps\build.log`
┌ Error: Error building `Knet`:
│ Microsoft (R) C/C++ Optimizing Compiler Version 19.20.27508.1 for x64
│ Copyright (C) Microsoft Corporation.  All rights reserved.
│ 
│ conv.cpp
│ conv.cpp(6): fatal error C1034: algorithm: no include path set
│ ┌ Warning: nvcc not found, gpu kernels will not be compiled.
│ └ @ Main C:\Users\cioarca\.julia\packages\Knet\05UDD\deps\build.jl:138
│ [ Info: `'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\bin\Hostx64\x64\cl.exe' /Ox /LD -c conv.cpp`
│ ERROR: LoadError: failed process: Process(`'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\bin\Hostx64\x64\cl.exe' /Ox /LD -c conv.cpp`,
ProcessExited(2)) [2]
│ Stacktrace:
│  [1] error(::String, ::Base.Process, ::String, ::Int64, ::String) at .\error.jl:42
│  [2] pipeline_error at .\process.jl:785 [inlined]
│  [3] #run#515(::Bool, ::Function, ::Cmd) at .\process.jl:726
│  [4] run at .\process.jl:724 [inlined]
│  [5] inforun(::Cmd) at C:\Users\cioarca\.julia\packages\Knet\05UDD\deps\build.jl:9
│  [6] build_cxx() at C:\Users\cioarca\.julia\packages\Knet\05UDD\deps\build.jl:121
│  [7] build() at C:\Users\cioarca\.julia\packages\Knet\05UDD\deps\build.jl:139
│  [8] top-level scope at none:0
│  [9] include at .\boot.jl:326 [inlined]
│  [10] include_relative(::Module, ::String) at .\loading.jl:1038
│  [11] include(::Module, ::String) at .\sysimg.jl:29
│  [12] include(::String) at .\client.jl:403
│  [13] top-level scope at none:0
│ in expression starting at C:\Users\cioarca\.julia\packages\Knet\05UDD\deps\build.jl:147
└ @ Pkg.Operations C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Pkg\src\Operations.jl:1075

I know CuArrays is supposed to fail, since I don't have GPU.
I also installed VisualStudio 2019 with C++ development environment.

Did anyone else encounter this issue?

Thank you for your help,

Iulian

Iulian-Vasile Cioarca

unread,
May 31, 2019, 10:42:14 AM5/31/19
to knet-users
Meanwhile I found a workaround based on https://stackoverflow.com/questions/931652/fatal-error-c1034-windows-h-no-include-path-set and on hacking on the 'build.jl' code from Knet package folder in order to generate the 'libknet8.dll'.
I'm not very experienced, but I understand that some paths needed for compilation of conv,cpp cannot be found(altough I added in PATH the location of cl.exe), so the solution that I found was to add them by calling 'vcvars64.bat' from the VStudio installation directory.
Steps below:

# manually add the vcvars64.bat (C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build) and cl.exe(C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.21.27702\bin\Hostx64\x64) paths to System Env PATH
In julia:
cd(C:\\Users\\USERNAME\\.julia\\packages\\Knet\\HwZrA\\deps)
run(`vcvars64.bat`) #make sure compiler dependencies are in PATH
run(`cl.exe $["/Ox","/LD","/openmp"] -c conv.cpp`) # get .obj file
run(`cl.exe $["/Ox","/LD","/openmp"] /LD /Fe:libknet8.dll conv.obj`) # generate .dll

I am sure this is not the most elegant solution, but I managed to generate the 'libknet8.dll' file and use Knet on a CPU only machine.

Iulian
Reply all
Reply to author
Forward
0 new messages