-
Notifications
You must be signed in to change notification settings - Fork 6
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
Windows variant of Linux installer without MSys2 #6
Conversation
Thanks, I am getting an error during the execution of Level Zero on Windows 11. Did you do any extra step to enable Level Zero on the Intel Integrated Graphics? .\bin\Release\zello_world.exe
Driver not initialized: ZE_RESULT_ERROR_UNINITIALIZED
Did NOT find matching ZE_DEVICE_TYPE_GPU device! |
README.md
Outdated
cmake --build . --config Release | ||
``` | ||
|
||
Note: Check for extisting Level Zero API libraries (e.g. `ze_tracing_layer.dll`) in `c:\windows\system32` if `zello_world.exe` fails. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this is the reason why it fails for me. Can you expand what you did here in this step? you just move the file to this directory?
There were in fact three leve-zero DLLs already in my system32 folder:
ze_validation_layer.dll, ze_tracing_layer.dll, and ze_loader.dll. After
moving these away, zello_world.exe worked. I had no need to move any DLL
from the level zero repo.
Juan Fumero ***@***.***> schrieb am Mi. 20. März 2024 um
11:19:
… ***@***.**** commented on this pull request.
------------------------------
In README.md
<#6 (comment)>
:
>
+```cmd
+git clone https://github.com/oneapi-src/level-zero
+cd level-zero
+md build
+cd build
+cmake ..
+cmake --build . --config Release
+```
+
+Note: Check for extisting Level Zero API libraries (e.g. `ze_tracing_layer.dll`) in `c:\windows\system32` if `zello_world.exe` fails.
I feel like this is the reason why it fails for me. Can you expand what
you did here in this step? you just move the file to this directory?
—
Reply to this email directly, view it on GitHub
<#6 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD7PMXACYCEVVTGE5KI7KKLYZFPBPAVCNFSM6AAAAABE6ITT2CVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTSNBYGQ2TQOJQHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Thank you, that did the trick. When I first installed it (a couple of years ago) this was not the case. It might be worth filing an issue in the Level Zero repo. |
Good idea. I stepped thru the API when I couldn’t get zello_world to search
PATH for its DLLs. It calls
LoadLibraryExA(NAME, nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32) and pointed me
at the DLLs that were already there. Forcing the DLLs to live in system32
might be ok in terms of security, but indeed worth a note in the repo. I
filed an issue:
oneapi-src/level-zero#138
Juan Fumero ***@***.***> schrieb am Mi. 20. März 2024 um
18:42:
… Thank you, that did the trick. When I first installed it (a couple of
years ago) this was not the case. It might be worth filing an issue in the
Level Zero repo.
—
Reply to this email directly, view it on GitHub
<#6 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD7PMXD6PWK5SNE77RZJ4ODYZHC65AVCNFSM6AAAAABE6ITT2CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJQGIYDINBUGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I can build the library on Windows using the MS Tools. However, I get an error when I run. I am pretty sure it is my fault and I am missing something: cmake --build . --config Release
MSBuild version 17.8.3+195e7f5a3 for .NET Framework
tornado-levelzero.vcxproj -> C:\Users\jjfum\source\repos\levelzero-jni\levelZeroLib\build\Release\tornado-levelzero.dll
C:\Users\jjfum\source\repos\levelzero-jni\levelZeroLib\build>cd ../..
C:\Users\jjfum\source\repos\levelzero-jni>.\scripts\run.cmd
C:\Users\jjfum\source\repos\levelzero-jni>java -Djava.library.path=./levelZeroLib/build/Release -cp target/beehive-levelzero-jni-0.1.2.jar uk.ac.manchester.tornado.drivers.spirv.levelzero.samples.TestLevelZero copyData.spv
Testing Level-ZERO JNI Library
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\jjfum\source\repos\levelzero-jni\levelZeroLib\build\Release\tornado-levelzero.dll: Can't find dependent libraries
at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:331)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:197)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:139)
at java.base/jdk.internal.loader.NativeLibraries.findFromPaths(NativeLibraries.java:259)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:251)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2451)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:916)
at java.base/java.lang.System.loadLibrary(System.java:2059)
at uk.ac.manchester.tornado.drivers.spirv.levelzero.LevelZeroDriver.<clinit>(LevelZeroDriver.java:51)
at uk.ac.manchester.tornado.drivers.spirv.levelzero.samples.TestLevelZero.main(TestLevelZero.java:105) Any ideas? I used to get these errors when I built the library and I have a missing name when invoking a native function, but now it seems the error is when loading the DLL. |
Can you please sync with the latest |
@@ -98,7 +106,11 @@ JNIEXPORT jint JNICALL Java_uk_ac_manchester_tornado_drivers_spirv_levelzero_Lev | |||
ze_command_queue_desc_t cmdQueueDesc = {}; | |||
jclass commandDescriptorClass = env->GetObjectClass(javaCommandQueueDescriptor); | |||
field = env->GetFieldID(commandDescriptorClass, "ptrZeCommandDescriptor", "J"); | |||
#ifdef _WIN32 | |||
int64_t ptrZeCommandDescriptor = env->GetLongField(javaCommandQueueDescriptor, field); | |||
#else | |||
long ptrZeCommandDescriptor = env->GetLongField(javaCommandQueueDescriptor, field); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should also use int64_t
in Linux as well. Let's keep it for now, I will make a note and do this after we merge, so we can unify the Windows and Linux ports as much as possible.
The PR looks good to me. I need to make it work and we are ready to merge. |
Try adding the folder containing the Intel Level Zero DLLs to PATH (e.g.
set PATH=<somedir>\level-zero\build\bin\Release;%PATH%). I put this into
the installer script but obviously forgot to mention it in the README.md.
Juan Fumero ***@***.***> schrieb am Do. 21. März 2024 um
06:57:
… I can build the library on Windows using the MS Tools. However, I get an
error when I run. I am pretty sure it is my fault and I am missing
something:
cmake --build . --config Release
MSBuild version 17.8.3+195e7f5a3 for .NET Framework
tornado-levelzero.vcxproj -> C:\Users\jjfum\source\repos\levelzero-jni\levelZeroLib\build\Release\tornado-levelzero.dll
C:\Users\jjfum\source\repos\levelzero-jni\levelZeroLib\build>cd ../..
C:\Users\jjfum\source\repos\levelzero-jni>.\scripts\run.cmd
C:\Users\jjfum\source\repos\levelzero-jni>java -Djava.library.path=./levelZeroLib/build/Release -cp target/beehive-levelzero-jni-0.1.2.jar uk.ac.manchester.tornado.drivers.spirv.levelzero.samples.TestLevelZero copyData.spv
Testing Level-ZERO JNI Library
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\jjfum\source\repos\levelzero-jni\levelZeroLib\build\Release\tornado-levelzero.dll: Can't find dependent libraries at java.base/jdk.internal.loader.NativeLibraries.load(Native Method) at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:331) at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:197) at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:139) at java.base/jdk.internal.loader.NativeLibraries.findFromPaths(NativeLibraries.java:259) at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:251) at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2451) at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:916) at java.base/java.lang.System.loadLibrary(System.java:2059) at uk.ac.manchester.tornado.drivers.spirv.levelzero.LevelZeroDriver.<clinit>(LevelZeroDriver.java:51) at uk.ac.manchester.tornado.drivers.spirv.levelzero.samples.TestLevelZero.main(TestLevelZero.java:105)
Any ideas? I used to get these errors when I built the library and I have
a missing name when invoking a native function, but now it seems the error
is when loading the DLL.
—
Reply to this email directly, view it on GitHub
<#6 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD7PMXG7ZKYY466MJO4K3UTYZJZENAVCNFSM6AAAAABE6ITT2CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJRGI3TIOBVGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I don‘t know if we need it but I guess we do not. To be honest, I simply
copied (with rather few modifications) the lines to compile for Windows
from Intel's CMakeLists.txt in the level zero repo.
Juan Fumero ***@***.***> schrieb am Do. 21. März 2024 um
08:15:
… ***@***.**** commented on this pull request.
------------------------------
In levelZeroLib/CMakeLists.txt
<#6 (comment)>
:
>
-add_definitions(${GCC_INTEL_LEVEL0})
+ # enable CET shadow stack
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /CETCOMPAT")
+
+ #Use of sccache with MSVC requires workaround of replacing /Zi with /Z7
+ #https://github.com/mozilla/sccache
+ if(USE_Z7) #sccache
Does this mean we need sccache installed as a dependency?
—
Reply to this email directly, view it on GitHub
<#6 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD7PMXDN2B4IYYC4EK7TKLLYZKCKRAVCNFSM6AAAAABE6ITT2CVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTSNJQHEYTCNRUGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Same behaviour on my system: C:\Users\jjfum\source\repos\levelzero-jni>set ZE_SHARED_LOADER=C:\Users\jjfum\source\repos\level-zero\build\lib\release\ze_loader.lib
C:\Users\jjfum\source\repos\levelzero-jni>set CPLUS_INCLUDE_PATH=C:\Users\jjfum\source\repos\level-zero\include
C:\Users\jjfum\source\repos\levelzero-jni>set C_INCLUDE_PATH=C:\Users\jjfum\source\repos\level-zero\include
C:\Users\jjfum\source\repos\levelzero-jni>set PATH=C:\Users\jjfum\source\repos\levelzero-jni\levelZeroLib\build\Release;%PATH%
C:\Users\jjfum\source\repos\levelzero-jni> dir C:\Users\jjfum\source\repos\levelzero-jni\levelZeroLib\build\Release
Directory of C:\Users\jjfum\source\repos\levelzero-jni\levelZeroLib\build\Release
21/03/2024 08:55 <DIR> .
21/03/2024 08:55 <DIR> ..
21/03/2024 08:55 303,104 tornado-levelzero.dll
21/03/2024 08:55 36,546 tornado-levelzero.exp
21/03/2024 08:55 62,140 tornado-levelzero.lib
21/03/2024 08:55 6,533,120 tornado-levelzero.pdb
4 File(s) 6,934,910 bytes
2 Dir(s) 434,048,061,440 bytes free
C:\Users\jjfum\source\repos\levelzero-jni> java -Djava.library.path=./levelZeroLib/build/Release -cp target/beehive-levelzero-jni-0.1.2.jar uk.ac.manchester.tornado.drivers.spirv.levelzero.samples.TestLevelZero copyData.spv
Testing Level-ZERO JNI Library
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\jjfum\source\repos\levelzero-jni\levelZeroLib\build\Release\tornado-levelzero.dll: Can't find dependent libraries
at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:331)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:197)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:139)
at java.base/jdk.internal.loader.NativeLibraries.findFromPaths(NativeLibraries.java:259)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:251)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2451)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:916)
at java.base/java.lang.System.loadLibrary(System.java:2059)
at uk.ac.manchester.tornado.drivers.spirv.levelzero.LevelZeroDriver.<clinit>(LevelZeroDriver.java:51)
at uk.ac.manchester.tornado.drivers.spirv.levelzero.samples.TestLevelZero.main(TestLevelZero.java:105) |
I think your PATH still misses the folder with the Intel DLLs. Derived from
your value for ZE_SHARED_LOADER the appropriate folder for your setup might
be C:\Users\jjfum\source\repos\level-zero\build\bin\release (mind bin
instead of lib). This PATH setup might work:
set PATH=
C:\Users\jjfum\source\repos\level-zero\build\bin\release;C:\Users\jjfum\source\repos\levelzero-jni\levelZeroLib\build\Release;%PATH%
If that still does not work, look for a folder in
C:\Users\jjfum\source\repos\level-zero that contains DLLs whose names start
with ze_ and add it to PATH
Juan Fumero ***@***.***> schrieb am Do. 21. März 2024 um
10:42:
… Same behaviour on my system:
C:\Users\jjfum\source\repos\levelzero-jni>set ZE_SHARED_LOADER=C:\Users\jjfum\source\repos\level-zero\build\lib\release\ze_loader.lib
C:\Users\jjfum\source\repos\levelzero-jni>set CPLUS_INCLUDE_PATH=C:\Users\jjfum\source\repos\level-zero\include
C:\Users\jjfum\source\repos\levelzero-jni>set C_INCLUDE_PATH=C:\Users\jjfum\source\repos\level-zero\include
C:\Users\jjfum\source\repos\levelzero-jni>set PATH=C:\Users\jjfum\source\repos\levelzero-jni\levelZeroLib\build\Release;%PATH%
C:\Users\jjfum\source\repos\levelzero-jni> dir C:\Users\jjfum\source\repos\levelzero-jni\levelZeroLib\build\Release
Directory of C:\Users\jjfum\source\repos\levelzero-jni\levelZeroLib\build\Release
21/03/2024 08:55 <DIR> .
21/03/2024 08:55 <DIR> ..
21/03/2024 08:55 303,104 tornado-levelzero.dll
21/03/2024 08:55 36,546 tornado-levelzero.exp
21/03/2024 08:55 62,140 tornado-levelzero.lib
21/03/2024 08:55 6,533,120 tornado-levelzero.pdb
4 File(s) 6,934,910 bytes
2 Dir(s) 434,048,061,440 bytes free
C:\Users\jjfum\source\repos\levelzero-jni> java -Djava.library.path=./levelZeroLib/build/Release -cp target/beehive-levelzero-jni-0.1.2.jar uk.ac.manchester.tornado.drivers.spirv.levelzero.samples.TestLevelZero copyData.spv
Testing Level-ZERO JNI Library
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\jjfum\source\repos\levelzero-jni\levelZeroLib\build\Release\tornado-levelzero.dll: Can't find dependent libraries at java.base/jdk.internal.loader.NativeLibraries.load(Native Method) at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:331) at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:197) at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:139) at java.base/jdk.internal.loader.NativeLibraries.findFromPaths(NativeLibraries.java:259) at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:251) at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2451) at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:916) at java.base/java.lang.System.loadLibrary(System.java:2059) at uk.ac.manchester.tornado.drivers.spirv.levelzero.LevelZeroDriver.<clinit>(LevelZeroDriver.java:51) at uk.ac.manchester.tornado.drivers.spirv.levelzero.samples.TestLevelZero.main(TestLevelZero.java:105)
—
Reply to this email directly, view it on GitHub
<#6 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD7PMXEIY7BHRHWIYB6TE4DYZKTQNAVCNFSM6AAAAABE6ITT2CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJRG43DCNBYGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Thank you @otabuzzman , That made the trick. C:\Users\jjfum\source\repos\levelzero-jni>set PATH=C:\Users\jjfum\source\repos\level-zero\build\bin\Release;%PATH%
C:\Users\jjfum\source\repos\levelzero-jni>.\scripts\run.cmd
C:\Users\jjfum\source\repos\levelzero-jni>java -Djava.library.path=./levelZeroLib/build/Release -cp target/beehive-levelzero-jni-0.1.2.jar uk.ac.manchester.tornado.drivers.spirv.levelzero.samples.TestLevelZero copyData.spv
Testing Level-ZERO JNI Library
Driver Version: 17001183
Level Zero API Version:
=========================
Device Properties
=========================
STye : ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES
pNext : 0
Type : ZE_DEVICE_TYPE_GPU
vendorId : 32902
deviceId : 18048
flags : 1
subdeviceId : 0
coreClockRate : 1500
maxMemAllocSize : 4294959104
maxHardwareContext : 65536
maxCommandQueuePriority: 0
numThreadsPerEU : 7
physicalEUSimdWidth : 8
numEUsPerSubslice : 8
numSubslicesPerSlice: 4
numSlices : 1
timerResolution : 52
timestampValidBits : 36
kernelTimestampValidBits: 32
uuid : [134, 128, 128, 70, 12, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0]
name : Intel(R) UHD Graphics 770 Can you please complete the README file to add these instructions? |
BTW, I used the latest version of Level Zero, so no need to checkout the tag |
Great. I will update README.md tonight with access to my notebook
(currently traveling with smartphone only).
Juan Fumero ***@***.***> schrieb am Do. 21. März 2024 um
11:23:
… Thank you @otabuzzman <https://github.com/otabuzzman> , That made the
trick.
C:\Users\jjfum\source\repos\levelzero-jni>set PATH=C:\Users\jjfum\source\repos\level-zero\build\bin\Release;%PATH%
C:\Users\jjfum\source\repos\levelzero-jni>.\scripts\run.cmd
C:\Users\jjfum\source\repos\levelzero-jni>java -Djava.library.path=./levelZeroLib/build/Release -cp target/beehive-levelzero-jni-0.1.2.jar uk.ac.manchester.tornado.drivers.spirv.levelzero.samples.TestLevelZero copyData.spv
Testing Level-ZERO JNI Library
Driver Version: 17001183
Level Zero API Version:
=========================
Device Properties
=========================
STye : ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES
pNext : 0
Type : ZE_DEVICE_TYPE_GPU
vendorId : 32902
deviceId : 18048
flags : 1
subdeviceId : 0
coreClockRate : 1500
maxMemAllocSize : 4294959104
maxHardwareContext : 65536
maxCommandQueuePriority: 0
numThreadsPerEU : 7
physicalEUSimdWidth : 8
numEUsPerSubslice : 8
numSubslicesPerSlice: 4
numSlices : 1
timerResolution : 52
timestampValidBits : 36
kernelTimestampValidBits: 32
uuid : [134, 128, 128, 70, 12, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0]
name : Intel(R) UHD Graphics 770
Can you please complete the README file to add these instructions?
—
Reply to this email directly, view it on GitHub
<#6 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD7PMXD2KSBPDSBS4EJEOFLYZKYK3AVCNFSM6AAAAABE6ITT2CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJRHA2TCMJYGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @otabuzzman . This PR looks good to me.
Let's wait until @stratika can also reproduce it and then we merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, only a small typo in CHANGELOG.md.
@jjfumero, once we do the release of 0.1.3, we need to update also the path for the target directory that will have the new jar files. |
Co-authored-by: Thanos Stratikopoulos <[email protected]>
This PR complements the PR for a Windows install script for the main TornadoVM repo. Details can be found there.