Skip to content
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

NNlibAMDGPUExt: UndefVarError: MIOpen not defined #482

Closed
jbrea opened this issue Mar 15, 2023 · 2 comments
Closed

NNlibAMDGPUExt: UndefVarError: MIOpen not defined #482

jbrea opened this issue Mar 15, 2023 · 2 comments

Comments

@jbrea
Copy link
Contributor

jbrea commented Mar 15, 2023

I wanted to test the newly landed AMDGPU support; thanks for all the work on this!
Unfortunately, installation failed. I tried adding Flux and AMDGPU in a fresh environment on Julia 1.9.0-rc1 and got the following error

julia> using AMDGPU, Flux
[ Info: Precompiling NNlibAMDGPUExt [244f68ed-b92b-5712-87ae-6c617c41e16a]
ERROR: LoadError: UndefVarError: `MIOpen` not defined
Stacktrace:
 [1] include
   @ ./Base.jl:457 [inlined]
 [2] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
   @ Base ./loading.jl:2004
 [3] top-level scope
   @ stdin:2
in expression starting at ~/.julia/packages/NNlib/ydqxJ/ext/NNlibAMDGPUExt/NNlibAMDGPUExt.jl:1
in expression starting at stdin:2
┌ Error: Error during loading of extension NNlibAMDGPUExt of NNlib, use `Base.retry_load_extensions()` to retry.
└ @ Base loading.jl:1200
[ Info: Precompiling AMDGPUExt [056cf8fd-e2db-58a6-a48a-88fb87bc7ebd]
ERROR: LoadError: UndefVarError: `MIOpen` not defined
Stacktrace:
 [1] include
   @ ./Base.jl:457 [inlined]
 [2] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::String)
   @ Base ./loading.jl:2004
 [3] top-level scope
   @ stdin:2
in expression starting at ~/.julia/packages/NNlib/ydqxJ/ext/NNlibAMDGPUExt/NNlibAMDGPUExt.jl:1
in expression starting at stdin:2
┌ Error: Error during loading of extension NNlibAMDGPUExt of NNlib, use `Base.retry_load_extensions()` to retry.
└ @ Base loading.jl:1200
ERROR: LoadError: UndefVarError: `MIOpen` not defined
Stacktrace:
 [1] getproperty(x::Module, f::Symbol)
   @ Base ./Base.jl:31
 [2] top-level scope
   @ ~/.julia/packages/Flux/Nzh8J/ext/AMDGPUExt/AMDGPUExt.jl:15
 [3] include
   @ ./Base.jl:457 [inlined]
 [4] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
   @ Base ./loading.jl:2004
 [5] top-level scope
   @ stdin:2
in expression starting at ~/.julia/packages/Flux/Nzh8J/ext/AMDGPUExt/AMDGPUExt.jl:1
in expression starting at stdin:2
┌ Error: Error during loading of extension AMDGPUExt of Flux, use `Base.retry_load_extensions()` to retry.
└ @ Base loading.jl:1200

(@DL) pkg> st -m
Status `~/.julia/environments/DL/Manifest.toml`
  [21141c5a] AMDGPU v0.4.8
  [621f4979] AbstractFFTs v1.3.1
  [7d9f7c33] Accessors v0.1.28
  [79e6a3ab] Adapt v3.6.1
  [dce04be8] ArgCheck v2.3.0
  [ab4f0b2a] BFloat16s v0.4.2
  [198e06fe] BangBang v0.3.37
  [9718e550] Baselet v0.1.1
  [b99e7846] BinaryProvider v0.5.10
  [fa961155] CEnum v0.4.2
  [052768ef] CUDA v4.0.1
  [1af6417a] CUDA_Runtime_Discovery v0.1.1
  [082447d4] ChainRules v1.48.0
  [d360d2e6] ChainRulesCore v1.15.7
  [bbf7d656] CommonSubexpressions v0.3.0
  [34da2185] Compat v4.6.1
  [a33af91c] CompositionsBase v0.1.1
  [187b0558] ConstructionBase v1.5.1
  [6add18c4] ContextVariablesX v0.1.3
  [9a962f9c] DataAPI v1.14.0
  [864edb3b] DataStructures v0.18.13
  [e2d170a0] DataValueInterfaces v1.0.0
  [244e2a9f] DefineSingletons v0.1.2
  [8bb1440f] DelimitedFiles v1.9.1
  [163ba53b] DiffResults v1.1.0
  [b552c78f] DiffRules v1.13.0
  [ffbed154] DocStringExtensions v0.9.3
  [e2ba6199] ExprTools v0.1.9
  [cc61a311] FLoops v0.2.1
  [b9860ae5] FLoopsBase v0.1.1
  [1a297f60] FillArrays v0.13.7
  [587475ba] Flux v0.13.14
  [9c68100b] FoldsThreads v0.1.1
  [f6369f11] ForwardDiff v0.10.35
  [069b7b12] FunctionWrappers v1.1.3
  [d9f16b24] Functors v0.4.3
  [0c68f7d7] GPUArrays v8.6.3
  [46192b85] GPUArraysCore v0.1.4
⌅ [61eb1bfa] GPUCompiler v0.17.3
  [7869d1d1] IRTools v0.4.8
  [22cec73e] InitialValues v0.3.1
  [3587e190] InverseFunctions v0.1.8
  [92d709cd] IrrationalConstants v0.2.2
  [82899510] IteratorInterfaceExtensions v1.0.0
  [692b3bcd] JLLWrappers v1.4.1
  [b14d175d] JuliaVariables v0.2.4
  [929cbde3] LLVM v4.16.0
  [2ab3a3ac] LogExpFunctions v0.3.23
  [d8e11817] MLStyle v0.4.17
  [f1d291b0] MLUtils v0.4.1
  [1914dd2f] MacroTools v0.5.10
  [128add7d] MicroCollections v0.1.3
  [e1d29d7a] Missings v1.1.0
  [99f44e22] MsgPack v1.2.0
  [872c559c] NNlib v0.8.19
  [a00861dc] NNlibCUDA v0.2.7
  [77ba4419] NaNMath v1.0.2
  [71a1bf82] NameResolution v0.1.5
  [d8793406] ObjectFile v0.3.7
  [0b1bfda6] OneHotArrays v0.2.3
  [3bd65402] Optimisers v0.2.15
  [bac558e1] OrderedCollections v1.4.1
  [21216c6a] Preferences v1.3.0
  [8162dcfd] PrettyPrint v0.2.0
  [33c8b6b6] ProgressLogging v0.1.4
  [74087812] Random123 v1.6.0
  [e6cf234a] RandomNumbers v1.5.3
  [c1ae055f] RealDot v0.1.0
  [189a3867] Reexport v1.2.2
  [ae029012] Requires v1.3.0
  [efcf1570] Setfield v1.1.1
  [605ecd9f] ShowCases v0.1.0
  [699a6c99] SimpleTraits v0.9.4
  [66db9d55] SnoopPrecompile v1.0.3
  [a2af1166] SortingAlgorithms v1.1.0
  [276daf66] SpecialFunctions v2.2.0
  [171d559e] SplittablesBase v0.1.15
  [1e83bf80] StaticArraysCore v1.4.0
  [82ae8749] StatsAPI v1.5.0
  [2913bbd2] StatsBase v0.33.21
  [09ab397b] StructArrays v0.6.15
  [53d494c1] StructIO v0.3.0
  [3783bdb8] TableTraits v1.0.1
  [bd369af6] Tables v1.10.1
  [a759f4b9] TimerOutputs v0.5.22
  [a526e669] TimespanLogging v0.1.0
  [28d57a85] Transducers v0.4.75
  [e88e6eb3] Zygote v0.6.57
  [700de1a5] ZygoteRules v0.2.2
  [02a925ec] cuDNN v1.0.1
  [6e34b625] Bzip2_jll v1.0.8+0
⌅ [4ee394cb] CUDA_Driver_jll v0.2.0+0
⌅ [76a88914] CUDA_Runtime_jll v0.2.3+2
⌅ [62b44479] CUDNN_jll v8.6.0+5
  [ab5a07f8] Elfutils_jll v0.182.0+1
  [2696aab5] HIP_jll v5.2.3+2
  [dad2f222] LLVMExtra_jll v0.0.16+2
⌅ [86de99a1] LLVM_jll v14.0.6+2
  [d4300ac3] Libgcrypt_jll v1.8.7+0
  [7e76a0d4] Libglvnd_jll v1.6.0+0
  [7add5ba3] Libgpg_error_jll v1.42.0+0
  [94ce4f54] Libiconv_jll v1.16.1+2
  [7f51dc2b] NUMA_jll v2.0.14+0
  [efe28fd5] OpenSpecFun_jll v0.5.5+0
  [8fbdd1d2] ROCmCompilerSupport_jll v5.2.3+1
  [873c0968] ROCmDeviceLibs_jll v5.2.3+0
  [10ae2a08] ROCmOpenCLRuntime_jll v5.2.3+1
  [02c8fc9c] XML2_jll v2.10.3+0
  [aed1982a] XSLT_jll v1.1.34+0
  [ffd25f8a] XZ_jll v5.2.9+0
  [4f6342f7] Xorg_libX11_jll v1.6.9+4
  [0c0b7dd1] Xorg_libXau_jll v1.0.9+4
  [a3789734] Xorg_libXdmcp_jll v1.1.3+4
  [1082639a] Xorg_libXext_jll v1.3.4+4
  [a65dc6b1] Xorg_libpciaccess_jll v0.16.0+1
  [14d82f49] Xorg_libpthread_stubs_jll v0.1.0+3
  [c7cfdc94] Xorg_libxcb_jll v1.13.0+3
  [c4d99508] Xorg_xorgproto_jll v2019.2.0+2
  [c5fb5394] Xorg_xtrans_jll v1.4.0+3
  [c53206cc] argp_standalone_jll v1.3.1+0
  [d65627f6] fts_jll v1.2.8+0
  [dd59ff1a] hsa_rocr_jll v5.2.3+0
  [1cecccd7] hsakmt_roct_jll v5.2.3+0
  [8e53e030] libdrm_jll v2.4.110+0
  [43dd8cde] msgpack_jll v3.0.1+0
  [c88a4935] obstack_jll v1.2.2+0
  [1ef8cab2] rocBLAS_jll v5.2.3+2
  [52935e6f] rocPRIM_jll v5.2.3+1
  [a6151927] rocRAND_jll v5.2.3+1
  [8c6ce2ba] rocSPARSE_jll v5.2.3+1
  [5a766526] rocminfo_jll v5.2.3+0
  [0dad84c5] ArgTools v1.1.1
  [56f22d72] Artifacts
  [2a0f44e3] Base64
  [ade2ca70] Dates
  [8ba89e20] Distributed
  [f43a241f] Downloads v1.6.0
  [7b1f6079] FileWatching
  [9fa8497b] Future
  [b77e0a4c] InteractiveUtils
  [4af54fe1] LazyArtifacts
  [b27032c2] LibCURL v0.6.3
  [76f85450] LibGit2
  [8f399da3] Libdl
  [37e2e46d] LinearAlgebra
  [56ddb016] Logging
  [d6f4376e] Markdown
  [a63ad114] Mmap
  [ca575930] NetworkOptions v1.2.0
  [44cfe95a] Pkg v1.9.0
  [de0858da] Printf
  [9abbd945] Profile
  [3fa0cd96] REPL
  [9a3f8284] Random
  [ea8e919c] SHA v0.7.0
  [9e88b42a] Serialization
  [6462fe0b] Sockets
  [2f01184e] SparseArrays
  [10745b16] Statistics v1.9.0
  [fa267f1f] TOML v1.0.3
  [a4e569a6] Tar v1.10.0
  [8dfed614] Test
  [cf7118a7] UUIDs
  [4ec0a83e] Unicode
  [e66e0078] CompilerSupportLibraries_jll v1.0.2+0
  [d55e3150] LLD_jll v14.0.6+3
  [deac9b47] LibCURL_jll v7.84.0+0
  [29816b5a] LibSSH2_jll v1.10.2+0
  [c8ffd9c3] MbedTLS_jll v2.28.2+0
  [14a3606d] MozillaCACerts_jll v2022.10.11
  [4536629a] OpenBLAS_jll v0.3.21+4
  [05823500] OpenLibm_jll v0.8.1+0
  [bea87d4a] SuiteSparse_jll v5.10.1+6
  [83775a58] Zlib_jll v1.2.13+0
  [8f36deef] libLLVM_jll v14.0.6+2
  [8e850b90] libblastrampoline_jll v5.4.0+0
  [8e850ede] nghttp2_jll v1.48.0+0
  [3f19e933] p7zip_jll v17.4.0+0

julia> versioninfo()
Julia Version 1.9.0-rc1
Commit 3b2e0d8fbc1 (2023-03-07 07:51 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 16 × AMD Ryzen 7 PRO 5850U with Radeon Graphics
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, znver3)
  Threads: 1 on 16 virtual cores
Environment:
  JULIA_IMAGE_THREADS = 1

Base.retry_load_extensions() didn't help. Any ideas?

@pxl-th
Copy link
Member

pxl-th commented Mar 15, 2023

If you are using ROCm artifacts (and by default yes), then for now you have to do a little workaround.

  1. In your project env (where you have NNlib installed):
    ]dev AMDGPU
  2. Then from the dev'd AMDGPU folder (~/.julia/dev/AMDGPU.jl by default):
    ]add MIOpen_jll
  3. Now you should be able to use AMDGPU with NNlib.
    You may call ]precompile & ]up for the sake of it...

This is because MIOpen artifact is only available for Julia 1.9.
Alternative is to use your global ROCm stack installation and bypass artifacts completely (for Julia 1.9 it needs to be ROCm 5.2.3).

@jbrea jbrea closed this as completed Mar 15, 2023
@ToucheSir
Copy link
Member

Is there any way we could only conditionally load MIOpen_jll on 1.9+?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants