Git Product home page Git Product logo

Comments (9)

quaertym avatar quaertym commented on July 19, 2024

This can be related:

I am working on windows support for Knet.jl. I tried to build CUDAdrv.jl on windows and it uses discovery.jl of CUDAapi.jl . I realized that names in this line should include nvcuda but it is not there. I fixed it by manually adding it. If you can guide me, I can submit a PR for this.

from cudaapi.jl.

maleadt avatar maleadt commented on July 19, 2024

No, nvcuda was already being searched for:

const libcuda = Compat.Sys.iswindows() ? "nvcuda" : "cuda"

The problem was more complicated, see #10

The only thing I haven't been able to fix, is cl.exe discovery. Even after (instructing the user to) source vcvarsall.bat, I can't manage to deduce the location of cl.exe from the environment variables. The heuristics @musm has added don't seem to work on Community 2017 anymore.
I'm thinking of just having the user put cl.exe in his PATH, and be done with it. If there's no easy way to discover cl.exe, we shouldn't be trying to:

CUDAapi.jl/src/discovery.jl

Lines 293 to 298 in 58bcab6

msvc_path = try
find_binary("cl")
catch ex
isa(ex, ErrorException) || rethrow(ex)
error("Could not find the Microsoft Visual C++ Compiler (cl.exe); did you install Visual Studio and put cl.exe on your PATH?")
end

from cudaapi.jl.

musm avatar musm commented on July 19, 2024

https://github.com/Microsoft/vswhere

is needed for newer vc studio installations, which is in included in the 2017 visual studio installation, and can be used to find CL.exe

CUDA 9 is required for VC2017 support

from cudaapi.jl.

musm avatar musm commented on July 19, 2024

Also see JuliaAttic/CUDArt.jl#70

from cudaapi.jl.

maleadt avatar maleadt commented on July 19, 2024

Right, but how do I get the actual path to cl.exe from that. Sure, it'll help to find or activate a prompt with the VS vars sourced, but even in that prompt cl.exe doesn't seem discoverable.

And yes, CUDAapi needs a compatibility database for matching VS versions to CUDA versions.

from cudaapi.jl.

musm avatar musm commented on July 19, 2024

vsdevcmd.bat has cl sourced (I just tried it)

https://github.com/Microsoft/vswhere/wiki/Find-VC

from cudaapi.jl.

maleadt avatar maleadt commented on July 19, 2024

Mine doesn't, I must be missing a part of VS then.

Can you confirm this picks up the path to cl.exe?

vswhere = download("https://github.com/Microsoft/vswhere/releases/download/2.2.11/vswhere.exe")

vs_install_path = chomp(readstring(`$vswhere  -latest -property installationPath`))
if !isdir(vs_install_path)
    error("Cannot find a proper Visual Studio installation. Make sure Visual Studio is installed.")
end

vs_version_major = parse(split(chomp(readstring(`$vswhere  -latest -property installationVersion`)), '.')[1])
if vs_version_major >= 15
    vs_cmd_prompt = joinpath(vs_install_path, "VC", "Auxiliary", "Build", "vcvarsall.bat")
else
    vs_cmd_prompt = joinpath(vs_install_path, "VC", "vcvarsall.bat")
end

# check whether 32 or 64 bit archtecture
# NOTE: Actually, nvcc in x86 visual studio command prompt doesn't make 32-bit binary
#       It depends on whether CUDA toolkit is 32bit or 64bit
if Int == Int64
    arch = "amd64"
else
    arch = "x86"
end

run(`cmd /C "$vs_cmd_prompt" $arch \& where cl.exe`)

EDIT: yeah seems to work here after installing a boatload of VC++ tools. Figured I only needed the compiler, apparently not.

from cudaapi.jl.

maleadt avatar maleadt commented on July 19, 2024

@quaertym: the changes to CUDAapi in #10 should fix Windows support. What remains for Knet, from a quick first glance, is that the Knet package build scripts calls out to make instead of building directly. But you can pretty easily recreate that in Julia, see e.g.: https://github.com/JuliaGPU/CUDArt.jl/blob/51ada407672d779ee11e69ad3cbd2642364b1330/deps/build.jl#L58-L77
(but don't use the logging_run because I'll be removing that from CUDAapi)

from cudaapi.jl.

quaertym avatar quaertym commented on July 19, 2024

@maleadt Thanks. My problem was getting nvcuda.dll without versions at the end. #10 seems like a fix.

from cudaapi.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.