Skip to content

Level-zero on Windows (WIP) #386

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

Closed
wants to merge 3 commits into from
Closed

Level-zero on Windows (WIP) #386

wants to merge 3 commits into from

Conversation

1e-to
Copy link
Contributor

@1e-to 1e-to commented Apr 14, 2021

Closes #340

@1e-to 1e-to changed the title Level-zero on Windows Level-zero on Windows (WIP) Apr 14, 2021
@1e-to 1e-to requested review from PokhodenkoSA and diptorupd April 14, 2021 13:37
@PokhodenkoSA
Copy link
Contributor

@1e-to check CI please.

@@ -4,6 +4,9 @@ if errorlevel 1 (
exit /b 1
)

git clone -b v1.2.3 https://github.com/oneapi-src/level-zero.git
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make comment that tag version is not very important. Headers are backward compatible.

Comment on lines +33 to +37
if(UNIX)
find_path(LEVEL_ZERO_INCLUDE_DIR NAMES level_zero/zet_api.h HINTS $ENV{L0_INCLUDE_DIR})
elif(WIN32)
find_path(LEVEL_ZERO_INCLUDE_DIR NAMES zet_api.h HINTS $ENV{L0_INCLUDE_DIR})
endif()
Copy link
Contributor

@PokhodenkoSA PokhodenkoSA Apr 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is not necessary if L0_INCLUDE_DIR has correct value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is that, because in source level-zero/include/zet_api.h, not level_zero/zet_api.h

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that build process copies level-zero/include/zet_api.h into include/level_zero/zet_api.h.

@@ -26,7 +26,11 @@
# TODO: Add a way to record the version of the level_zero library

find_library(LEVEL_ZERO_LIBRARY ze_loader HINTS $ENV{L0_LIB_DIR})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also set L0_LIB_DIR in bld.bat? Is it needed from level-zero repo, or what?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We access ze_loader library dynamically. I do not know why we search for it. @diptorupd Do you have something to comment?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea was that FindLevelZero.cmake should not really care whether we use the library dynamically. Maybe someone is already doing a more comprehensive cmake module for Level zero than I want to write. I will look if there is one.

@1e-to
Copy link
Contributor Author

1e-to commented Apr 21, 2021

I tried to test it on TestProgramForLevel0GPU.create_program_from_spirv
I do not quite understand the reason for the error is that the level-zero was not going to run under Windows, or the creation from spirv should not work in this case

ERROR: test_create_program_from_spirv (__main__.TestProgramForLevel0GPU)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_sycl_program.py", line 104, in test_create_program_from_spirv
    prog = dpctl_prog.create_program_from_spirv(q, spirv)
  File "dpctl\program\_program.pyx", line 161, in dpctl.program._program.create_program_from_spirv
  File "dpctl\program\_program.pyx", line 191, in dpctl.program._program.create_program_from_spirv
dpctl.program._program.SyclProgramCompilationError

@diptorupd
Copy link
Contributor

@1e-to @PokhodenkoSA I added level zero program creation support for Windows in #319. I took a slightly different approach by using a cmake module to git checkout the level zero headers and removed the FindLevelZero.cmake. I am closing this PR now.

@diptorupd diptorupd closed this May 20, 2021
@1e-to 1e-to deleted the zero branch November 3, 2021 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Waiting: CI infrastructure Level Zero Issues related to Level Zero windows Applies to Windows OS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Level Zero on Windows
3 participants