02:38 pmoreau: imirkin: So, I have been working on cleaning up the code, which turned into a “redesign all the infrastructure”. Types are done, so now I just need to port all the code to the new type and value tracking system, and iron out regressions.
02:39 pmoreau: I don’t know if people will prefer that new design (which is quite heavily inspired by the spirv_to_nir code), but it’s definitely **way** more readable IMHO.
02:42 pmoreau: I’m hoping to be done in a week at most, with all the cleanup, and once that’s done, I think you should be able to get something upstreamable with all basic features (control flow and images included) in a week.
02:52 Manoa: you meen the openCL and vulkan functions development ?
03:19 imirkin: pmoreau: awesome. copying from spirv_to_nir is definitely a good idea.
03:19 imirkin: they have a structure that works well
03:19 imirkin: conceptually nvir isn't that different from nir
03:20 imirkin: in fact it might be easier to do the ssa conversion directly, and then do an out-of-ssa pass within nvir. dunno. your call.
04:21 Manoa: thank ilia for advice, I updated the drivers and got a huge improvement
04:22 Manoa: had to make some creative modifications to get it going but now after a few days, it does :)
04:25 Manoa: I only recently returned to linux from windows 7, and one thing that I like about mesa is that, it is able to "hide" the impact of frame rate fluctuations on the gameplay experience
04:50 Manoa: anyone here plays any hardcore games ? might know any solutions to this problem ? https://www.reddit.com/r/linux_gaming/comments/7itkb7/noticable_mouse_input_lag_in_games_any_less_known/
09:09 pmoreau: imirkin: The out-of-SSA pass is done once the whole binary has been translated to NVIR, so one could say it’s already done in NVIR, though having it as a completely separate pass that could be run by any frontend would be a good idea.
13:20 karolherbst: imirkin: there are other "sample_count > 1" checks we might want to change to "sample_count > 0" as well. Wasn't there some commits some months ago to change the semantics of samples=1?
13:21 karolherbst: like this for example: https://github.com/karolherbst/mesa/blob/1cee356cee39e8f944575ff7bd7df2a3e5dd0b15/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c#L67-L73
13:39 imirkin_: karolherbst: mmmaybe? iirc it was mostly getting rid of sample_count==1
13:42 imirkin_: pmoreau: oh ok, cool
13:42 karolherbst: imirkin_: well, we can keep it until we run into issues I guess
13:42 karolherbst: I just asked before sending out the other patch
13:46 karolherbst: imirkin_: sent out that samples patch, was there something else? I was running into this fun bug again with my NIR patches: https://github.com/karolherbst/mesa/commit/126f29bfe9398bfeda61110f0cbc8ebd18fd506c
13:47 karolherbst: the code is broken for tk->op == OP_PHI if the bb contains a join
13:48 imirkin_: yeah, i'll need to see an example. or a proper description of the issue.
13:48 karolherbst: because bb->insertAfter(join, phi); is called, which is clearyl wrong
13:48 karolherbst: right
13:48 karolherbst: okay
14:19 karolherbst: pmoreau: do you have some patches somewhere using the spirv-llvm module for OpenCL C code?
14:19 pmoreau: I do
14:21 karolherbst: pmoreau: which branch?
14:21 pmoreau: If you just want clover support: https://github.com/pierremoreau/mesa/tree/clover_spirv_series_v3
14:21 pmoreau: If you want to play with Nouveau: https://github.com/pierremoreau/mesa/tree/nouveau_spirv_support
14:22 karolherbst: now pushing to github?
14:23 pmoreau: I still have them on Phabricator
14:23 karolherbst: right, I am just wondering hwere the newest stuff will go
14:23 karolherbst: also my git repository is already so messed up, that even git gc fails
14:23 pmoreau: And all the highly WIP branches (like the code cleanup for nouveau_spirv_support) will stay there. But I thought it would be easier to have things on GitHub.
14:24 pmoreau: For people that want to try out things
14:24 karolherbst: ahh k
14:26 pmoreau: How to set up things: https://github.com/pierremoreau/mesa/wiki
14:26 karolherbst: yeah, I already done that, I am just integration it with my stuff
14:27 karolherbst: and wanted to test with the OpenCL CTS
14:27 karolherbst: but meson is unhappy
14:27 karolherbst: "Native dependency 'llvm-spirv' not found" :(
14:27 pmoreau: :-(
14:27 pmoreau: Do you have it in your PKG_CONFIG_PATH?
14:27 karolherbst: right
14:28 pmoreau: The path to the folder containing llvm-spirv.pc
14:28 karolherbst: I need to change the path
14:28 karolherbst: somehow that PKG_CONFIG_PATH handling in meson is dd
14:28 karolherbst: *odd
14:28 karolherbst: you can't just change it afaik
14:28 karolherbst: and if you do PKG_CONFIG_PATH=.. ninja ... it complains
14:29 pmoreau: You can change it afterwards
14:29 pmoreau: I tend to have the opposite issue: it does not stay
14:29 karolherbst: right
14:29 karolherbst: mhh
14:29 karolherbst: you didn't add the PIPE_SHADER_IR_SPIRV thing, right?
14:30 pmoreau: Only on the nouveau_spirv_support branch
14:30 karolherbst: mhh, so I might need some patches from there as well
14:31 karolherbst: pmoreau: also, you can't push to your master branch anymore: 99,999 commits :p
14:31 pmoreau: So if I run PKG_CONFIG_PATH= meson configure, do some changes to meson config files, and then run ninja again, it refetches PKG_CONFIG_PATH
14:31 pmoreau: :-D
14:32 pmoreau: Yeah, then pick from “clover/spirv: Import spirv.hpp11 version 1.0 (rev 12) ” to “clover: Plug in compilation and linking when using SPIR-V as IR” included
14:33 pmoreau: So, from a39e079975c8762305c140af8a0765b6f0415fb8 to b13cde41b4162847e70a2e1bc9e3d612c5a8ed84 (included) https://github.com/pierremoreau/mesa/commits/nouveau_spirv_support?after=fbf059d27ce6677d8b4a69bed26034bd44294954+104
14:33 karolherbst: pmoreau: is "clover/spirv: Import spirv.hpp11 version 1.0 (rev 12)" -> "clover: Plug in compilation and linking when using SPIR-V as IR" enough?
14:33 karolherbst: ahhh
14:33 karolherbst: good
14:33 pmoreau: ;-)
14:33 imirkin_: pmoreau: report bugs
14:34 imirkin_: they're pretty good about stuff
14:34 karolherbst: I think pkg_config_path should be handled exactly like prefix
14:34 karolherbst: you can just change prefix later like meson configure -Dprefix=...
14:34 imirkin_: it's an env var
14:34 imirkin_: so it's tricky
14:34 imirkin_: the solution is ... don't make it an env var :)
14:35 karolherbst: pmoreau: "clBuildProgram failed" :(
14:35 pmoreau: For the PKG_CONFIG_PATH thing? Yeah, I should probably do that. I wrote a small script that invokes `ninja install` with the var set
14:35 pmoreau: Sad
14:35 pmoreau: Does it give you more details?
14:35 karolherbst: no
14:36 pmoreau: Is that for the CTS?
14:37 karolherbst: yeah
14:37 pmoreau: If yes, update my spirv_testing repo and try with that. It should hopefully give you some more info
14:37 karolherbst: well
14:37 karolherbst: I hope that part still works, let me check
14:37 pmoreau: Oh wait, have you done any changes to clover or not?
14:38 pmoreau: Cause if not, I can see one issue
14:40 pmoreau: https://github.com/pierremoreau/mesa/blob/nouveau_spirv_support/src/gallium/state_trackers/clover/core/device.cpp#L250 add a check for NIR which will return SPIR-V
14:41 karolherbst: pmoreau: ohhh, nouveau_spirv_support uses some other llvm now?
14:41 karolherbst: for compiling cl to spv?
14:41 pmoreau: https://github.com/pierremoreau/mesa/blob/nouveau_spirv_support/src/gallium/state_trackers/clover/core/device.cpp#L286 check for NIR as well
14:41 pmoreau: It uses llvm-spirv from tomeu
14:41 karolherbst: nah, just checking for nir won't do
14:41 karolherbst: we need to add some spirv to nir code
14:41 pmoreau: Right, but that comes later
14:42 karolherbst: I have that in codegen for now
14:42 karolherbst: so I just consume spirvc
14:42 karolherbst: *spirv
14:42 pmoreau: Ah, okay
14:42 pmoreau: And you advertise SPIR-V support, right?
14:44 karolherbst: yeah
14:45 karolherbst: I think so
14:45 karolherbst: uhh
14:45 karolherbst: let me check
14:45 karolherbst: yeah, I do
14:47 pmoreau: So, 1. which repo and branch are you using for llvm-spirv?
14:48 pmoreau: 2. does my SPIR-V testing repo (after updating it) still works or not?
14:48 karolherbst: didn't test your branch
14:50 pmoreau: For llvm-spirv, you need https://github.com/pierremoreau/llvm-spirv/commits/integrate_with_mesa which contains several fixes
14:52 karolherbst: okay
15:25 pmoreau: karolherbst: Any progress?
16:40 karolherbst: pmoreau: uhm.. I took a break
16:40 pmoreau: Ah, no worries :-)
16:40 imirkin_: NO BREAKS! GET BACK TO WORK!
16:41 pmoreau: :-D
16:41 pmoreau: karolherbst: Watch out, Ilia is your real boss here, not some RH people ;-D
16:41 karolherbst: :O
16:41 imirkin_: lol
16:42 karolherbst: yeah, nobody cares here anyway
16:42 imirkin_: but remember - you're paid in lines of code removed
16:42 imirkin_: (that'd be a harsh work environment... add features while removing code)
16:44 karolherbst: imirkin_: uhhh, do empty lines count/
16:44 karolherbst: ?
16:44 imirkin_: hehehe
16:44 karolherbst: do I have to care about code style?
16:46 pmoreau: You get a super rare achievement if you manager to implement a full NIR frontend while actually removing more lines of code than you add, and without removing any features. :-)
16:46 pmoreau: Go, you have 24 hours to succeed!
16:46 pmoreau: s/manager/manage
16:48 karolherbst: easy
16:48 karolherbst: put as much code into one line, remove empty lines
16:51 karolherbst: pmoreau: and no, no progress, something is odd here, I can't even compile your testing stuff anymore
16:51 pmoreau: I guess I should have specified that the code should remain readable
16:51 pmoreau: Does it throw more errors?
16:51 karolherbst: clang-3.6: error: unknown argument: '-cl-std=CL1.1'
16:51 pmoreau: Update your clang version I try again? :-/
16:52 karolherbst: which clang do you use?
16:52 pmoreau: It’s weird neither Mesa nor llvm-spirv complained about your LLVM/clang version.
16:52 karolherbst: ohh wait, let me check
16:52 pmoreau: llvm-spirv, it’s set to 4.0
16:52 pmoreau: I think
16:53 karolherbst: do you use the module thing now?
16:53 pmoreau: Yeah
16:53 karolherbst: okay
16:53 karolherbst: that explains
16:53 karolherbst: how is it "imported"?
16:53 karolherbst: ahh llvm-spirv: Command not found
16:53 pmoreau: PKG_CONFIG_PATH to find it
16:53 pmoreau: Add it to your path?
16:53 karolherbst: I meant your spir-v-testing stuff
16:54 pmoreau: Right, I just hacked at it for the testing stuff, so just add llvm-spirv to your PATH
16:54 karolherbst: I have no llvm-spirv :)
16:54 Manoa: I understand you guys decided eventualy to go for the llvm way to do openCL/vulkan
16:54 pmoreau: I plan to move that code to CMake or meson, but sometime in the future
16:55 imirkin_: Manoa: just opencl
16:55 karolherbst: pmoreau: that llvm-spirv thing just installs the .h .pc and .so file
16:55 imirkin_: Manoa: use llvm for OpenCL C -> SPIR-V
16:55 karolherbst: no binary
16:55 karolherbst: Manoa: and no, no llvm
16:55 pmoreau: karolherbst: Which branch of llvm-spirv are you using? If you are using the correct branch, it should produce the binary
16:55 karolherbst: pmoreau: ohh right
16:56 karolherbst: totally forget about it
16:56 karolherbst: Manoa: just on the frontend, in the driver we don't want to use llvm
16:57 Manoa: I understand, so from now on, to build the mesa I must have --enable-llvm ?
16:57 karolherbst: pmoreau: yeah, now it works
16:57 pmoreau: karolherbst: Cool! :-)
16:57 karolherbst: uff
16:57 pmoreau: Manoa: Only if you want OpenCL support, which already required --enable-llvm
16:57 Manoa: ok thank :)
16:57 karolherbst: pmoreau: I figured out why the CTS didn't run: I used system mesa
16:58 pmoreau: Manoa: And by the way, there is nothing upstream yet
16:58 pmoreau: karolherbst: That might explains some issues :-p
16:59 karolherbst: pmoreau: mhh, function name issues now
16:59 karolherbst: ugh, that may get annoying
16:59 pmoreau: ?
17:00 karolherbst: right, nir matches the function name
17:00 pmoreau:does not really know what’s happening on Karol’s computer
17:01 karolherbst: pmoreau: well the kernel function name
17:01 karolherbst: like the entry_point
17:01 pmoreau: Okay, and what is the problem with it?
17:01 karolherbst: well, if it doesn't match, I don't have an entry point to compile the kernel :)
17:02 pmoreau: A match between what and what?
17:02 pmoreau: The OpName on the function and the name declared in the entry point?
17:02 karolherbst: spirv EntryPoint and a fixed string in source
17:04 pmoreau: “fixed string in source” being the string you give to spirv_to_nir?
17:04 karolherbst: uhh ishl with 64 bit shift
17:04 karolherbst: pmoreau: yeah
17:04 pmoreau: Okay
17:04 pmoreau: Hum, how come they do not match?
17:04 pmoreau: Is there something wrong in llvm-spirv?
17:05 karolherbst: well I put in "test"
17:05 karolherbst: okay, nice
17:05 karolherbst: in theory it works
17:05 karolherbst: just
17:05 karolherbst: vec3 64 ssa_3 = intrinsic load_var () (__spirv_BuiltInGlobalInvocationId) ()
17:05 pmoreau: Ah, you hardcoded “test” when calling spirv_to_nir, as this is what I use in my test samples, but the CTS uses other names?
17:05 karolherbst: decl_var INTERP_MODE_NONE u64vec3 __spirv_BuiltInGlobalInvocationId = { 0x00000000 }
17:05 karolherbst: pmoreau: yeah
17:05 pmoreau: Gotcha
17:06 pmoreau: Hum, that initialisation seems weird, but I guess it could work?
17:07 pmoreau: Could you share the SPIR-V for that please? (CLOVER_DEBUG=spirv CLOVER_DEBUG_FILE=something; file extension is automatically added)
17:17 karolherbst: pmoreau: llvm-dis: error: Invalid bitcode signature
17:17 karolherbst: uhm
17:17 karolherbst: wrong tool :)
17:17 karolherbst: pmoreau: https://gist.githubusercontent.com/karolherbst/2a93a998e559ce508ec99e2f2e6a96f3/raw/82ce35ee9484ea78afbfb4c07aceb4e047cd8bc9/gistfile1.txt
17:42 Manoa: can computer freezes be caused by mesa or are they more likely to be caused by the kernel ?
17:44 imirkin_: Manoa: depends how one likes to assign blame
17:44 imirkin_: depending on one's perspective, they're caused by you :)
17:44 imirkin_: or by nvidia's hw design department
17:49 Manoa: I don't understand :x
17:49 Manoa: I have problem, I have system freeze when playing game
17:49 imirkin_: well - it could be caused by you for choosing the software/hardware stack that freezes
17:49 Manoa: I wanne fix it, how should start from ? from the mesa or from the kernel ?
17:49 imirkin_: or it could be caused by nvidia, for making hardware that's prone to hangs like that :)
17:50 imirkin_: unfortunately the reality is that it's a lot of software that works together
17:50 imirkin_: so it's not always going to be a simple assessment like that
17:50 Manoa: ok I understand
17:50 Manoa: you meen to say: it everything :)
17:50 imirkin_: yep.
17:51 imirkin_: i presume this is more than hypothetical?
17:51 Manoa: ?
17:51 imirkin_: your question on assigning blame for the cause of a freeze
17:52 Manoa: I was playing a game today using wine nine and the system frozed so I was wondering if there is something I can do to fix it :)
17:52 imirkin_: are you seeing issues? or just curious about it?
17:52 imirkin_: well - first thing to do would be to get the latest mesa
17:52 Manoa: this could be a problem - latest mesa/semi latest mesa have other problems - but I could do it for the sake of testing :)
17:53 imirkin_: well, if you don't report the problems
17:53 imirkin_: then it's unlikely that they will be resolved
17:53 Manoa: I did :)
17:53 imirkin_: mmm ... do i remember about them?
17:53 imirkin_: (what are the issues)
17:54 Manoa: sorry I reported to here: https://github.com/iXit/Mesa-3D/issues
17:54 Manoa: not to you :x
17:54 imirkin_: oh
17:54 Manoa: my are the latest 3 subjects
17:54 imirkin_: yeah
17:55 Manoa: thank for looking to this problem ilia :)
17:56 imirkin_: unfortunately those problems are too abstract for me to do anything specific
17:56 imirkin_: you could ensure this isn't some compiler error by running with NV50_PROG_OPTIMIZE=0
17:56 imirkin_: s/compiler/optimizer/
17:57 Manoa: I will do that, thank
18:23 pmoreau: karolherbst: Thanks for the link, will have a look at it
18:28 pmoreau: The `64bitvec3 = { 0x00000000 }` does not come from the SPIR-V
18:29 pmoreau: `%15 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId Aligned 0` this seems very suspicious, to have it aligned to 0
19:41 Manoa: did you realy meen it ilia ? about nvidea hardware designed not the best ? it the true ?
19:58 imirkin_: your question was what was to blame for it, basically
19:59 imirkin_: my point was that assigning blame can happen at any and every point in the stack / process
20:08 Manoa: I understand, you meen some small thing / combination of things can create a problem in the hardware not that generally the hardware is a problem