-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CUDA driver device support does not match toolkit #70
Comments
Your CUDA driver is way to recent, and its CUDA compatibility level does not support sm_20. |
To elaborate a little more, we use the CUDA driver to compile PTX code to GPU assembly, whereas |
We have the 384.11 driver, installed with ubuntu's package manager and visible when calling http://www.nvidia.com/download/driverResults.aspx/122825/en-us Moreover as long as the driver supports the GPU there's generally no maximum driver version enforced for CUDA. This answer makes that general statement and also a specific one about our card's Fermi architecture. I'm not sure I understand...the driver can compile without nvcc? In any case, how would I find which driver version should work? Thanks! |
Yeah, that's how CUDAnative works. Generate PTX code, let the driver JIT-compile it to SASS assembly. Anyway, I don't have a sm_20 device (or any unsupported one, for that matter), so I can't really test this. Could you run the following code?
|
That's really cool! I'm no GPU expert, so I didn't know that was possible. I should read your paper :-) Here's the output. It seems to have worked except that julia> using CUDAnative
TRACE: LLVM.jl is running in trace mode, this will generate a lot of additional output
DEBUG: Checking validity of bundled library at /home/cody/src/julia_06/usr/lib/libLLVM-3.9.1.so
julia> kernel() = nothing
kernel (generic function with 1 method)
julia> mod, entry = CUDAnative.irgen(kernel, Tuple{})
(source_filename = "kernel"
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v32:32:32-v64:64:64-v128:128:128-n16:32:64"
target triple = "nvptx64-nvidia-cuda"
define void @julia_kernel_63254() #0 !dbg !4 {
top:
%0 = call i8**** @jl_get_ptls_states()
%1 = bitcast i8**** %0 to i8***
%2 = getelementptr i8**, i8*** %1, i64 3
%3 = bitcast i8*** %2 to i64**
%4 = load i64*, i64** %3, !tbaa !6
ret void, !dbg !9
}
declare i8**** @jl_get_ptls_states()
attributes #0 = { "no-frame-pointer-elim"="true" }
!llvm.module.flags = !{!0}
!llvm.dbg.cu = !{!1}
!0 = !{i32 1, !"Debug Info Version", i32 3}
!1 = distinct !DICompileUnit(language: DW_LANG_C89, file: !2, producer: "julia", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !3)
!2 = !DIFile(filename: "REPL[2]", directory: ".")
!3 = !{}
!4 = distinct !DISubprogram(name: "kernel", linkageName: "julia_kernel_63254", scope: null, file: !2, type: !5, isLocal: false, isDefinition: true, isOptimized: true, unit: !1, variables: !3)
!5 = !DISubroutineType(types: !3)
!6 = !{!7, !7, i64 0, i64 1}
!7 = !{!"jtbaa_const", !8, i64 0}
!8 = !{!"jtbaa"}
!9 = !DILocation(line: 1, scope: !4)
,
define void @julia_kernel_63254() #0 !dbg !4 {
top:
%0 = call i8**** @jl_get_ptls_states()
%1 = bitcast i8**** %0 to i8***
%2 = getelementptr i8**, i8*** %1, i64 3
%3 = bitcast i8*** %2 to i64**
%4 = load i64*, i64** %3, !tbaa !6
ret void, !dbg !9
}
)
julia> entry = CUDAnative.promote_kernel!(mod, entry, Tuple{})
ERROR: UndefVarError: promote_kernel! not defined
julia> CUDAnative.optimize!(mod, entry, v"2.0")
true
julia> ptx = CUDAnative.mcgen(mod, entry, v"2.0")
"//\n// Generated by LLVM NVPTX Back-End\n//\n\n.version 3.2\n.target sm_20\n.address_size 64\n\n\t.file\t1 \"./REPL[2]\"\n\t// .globl\tjulia_kernel_63254\n\n.visible .entry julia_kernel_63254()\n{\n\t.reg .s32 \t%r<2>;\n\n\t.loc 1 1 0\n\tret;\n}\n\n\n"
julia> using CUDAdrv
julia> dev = CuDevice(0)
CuDevice(0): Tesla M2090
julia> ctx = CuContext(dev)
CUDAdrv.CuContext(Ptr{Void} @0x0000560940862980, true, true)
julia> cumod = CuModule(ptx)
CUDAdrv.CuModule(Ptr{Void} @0x0000560940af8660, CUDAdrv.CuContext(Ptr{Void} @0x0000560940862980, true, true)) |
Ah, so |
Poor choice of version names by nvidia! In case it's useful here's a snippet from my
|
Thanks. I'm not sure I'll be able to fix this quickly though, so you better edit your |
I'll do that, thanks! Just let me know if you want me to test anything else. |
After editing julia> Pkg.test("CUDAnative")
INFO: Testing CUDAnative
TRACE: LLVM.jl is running in trace mode, this will generate a lot of additional output
DEBUG: Checking validity of bundled library at /home/cody/src/julia_06/usr/lib/libLLVM-3.9.1.so
WARNING: Encountered incompatible LLVM IR for codegen_ref_nonexisting() at capability 2.0.0: CUDAnative.InvalidIRError("calls the Julia runtime", ("jl_get_binding_or_error", %2 = tail call i8** @jl_get_binding_or_error(i8** inttoptr (i64 140455442071568 to i8**), i8** inttoptr (i64 140455441112520 to i8**)), !dbg !12))
WARNING: Encountered incompatible LLVM IR for codegen_ref_nonexisting() at capability 2.0.0: CUDAnative.InvalidIRError("calls the Julia runtime", ("jl_undefined_var_error", tail call void @jl_undefined_var_error(i8** inttoptr (i64 140455441112520 to i8**)), !dbg !12))
WARNING: Encountered incompatible LLVM IR for codegen_call_nonexisting() at capability 2.0.0: CUDAnative.InvalidIRError("calls the Julia runtime", ("jl_get_binding_or_error", %11 = call i8** @jl_get_binding_or_error(i8** inttoptr (i64 140455442071568 to i8**), i8** inttoptr (i64 140455441112520 to i8**)), !dbg !15))
WARNING: Encountered incompatible LLVM IR for codegen_call_nonexisting() at capability 2.0.0: CUDAnative.InvalidIRError("calls the Julia runtime", ("jl_undefined_var_error", call void @jl_undefined_var_error(i8** inttoptr (i64 140455441112520 to i8**)), !dbg !15))
WARNING: Encountered incompatible LLVM IR for codegen_call_nonexisting() at capability 2.0.0: CUDAnative.InvalidIRError("calls the Julia runtime", ("jl_apply_generic", %17 = call i8** @jl_apply_generic(i8*** %1, i32 1), !dbg !15))
INFO: Testing using device Tesla M2090
ERROR: MethodError: no method matching start(::Base.DevNullStream)
Closest candidates are:
start(::SimpleVector) at essentials.jl:258
start(::Base.MethodList) at reflection.jl:560
start(::ExponentialBackOff) at error.jl:107
...
ERROR: MethodError: no method matching start(::Base.DevNullStream)
Closest candidates are:
start(::SimpleVector) at essentials.jl:258
start(::Base.MethodList) at reflection.jl:560
start(::ExponentialBackOff) at error.jl:107
...
ERROR: MethodError: no method matching start(::Base.DevNullStream)
Closest candidates are:
start(::SimpleVector) at essentials.jl:258
start(::Base.MethodList) at reflection.jl:560
start(::ExponentialBackOff) at error.jl:107
...
ERROR: MethodError: no method matching start(::Base.DevNullStream)
Closest candidates are:
start(::SimpleVector) at essentials.jl:258
start(::Base.MethodList) at reflection.jl:560
start(::ExponentialBackOff) at error.jl:107 |
Fixed in JuliaGPU/CUDAnative.jl@f372132, tagging a release now. |
The whole mechanism for loading CUDA toolkits has been significantly updated since this issue, so I think we can close this. |
continued from JuliaGPU/CUDAnative.jl#141
I ran the build script with
TRACE=true
and I'm getting this:Note that I added a few
@show
statements at the end to show the version and target support info retrieved by the script.In case it's useful here's my
ext.jl
The text was updated successfully, but these errors were encountered: