11:34 moongazer: Hello
11:34 moongazer: How do I find out if I have a NVIDIA Maxwell GM107 / GM108 chip?
11:39 gnarface: lspci
11:40 pmoreau: `lspci -d 10de:` will restrict the output to NVIDIA devices
11:40 moongazer: pmoreau, gnarface 01:00.0 3D controller: NVIDIA Corporation Device 179c (rev a2)
11:41 pmoreau: Hum
11:42 moongazer: pmoreau, tell me?
11:42 gnarface: '3D controller' ?
11:42 pmoreau: Are you running Nouveau on it?
11:43 gnarface: if it was actually a video card, i would expect it to say "VGA..."
11:44 gnarface: wouldn't it have to?
11:44 imirkin: 179c is not a range that is in my pci.ids file, interesting
11:44 moongazer: Uh
11:44 imirkin: 3D Controller is a subtype of VGA
11:44 imirkin: (sort of)
11:44 gnarface: maybe it's something ancient? a PCI or AGP card?
11:44 imirkin: anyways, 17c-f is GM200, and 172x is GP100
11:44 moongazer: Well I have a NVIDIA GeForce 940MX with 2GB VRAM on my notebook
11:44 imirkin: no, ancient stuff is all covered
11:45 moongazer: Now tell m
11:45 moongazer: *me
11:45 mwk: imirkin: not fully
11:45 imirkin: moongazer: well, if you install envytools, and run 'nvapeek 0' it should tell you
11:45 imirkin: mwk: fully enough that we have every range :p
11:46 moongazer: imirkin, any other way?
11:46 mwk: well, it's not GM108, that's for sure
11:46 imirkin: mwk: why not?
11:47 gnarface: moongazer: it usually says, right there. the issue is nobody has ever seen one that looks like yours. it usually looks like this: 01:00.0 VGA compatible controller: NVIDIA Corporation GK106 [GeForce GTX 650 Ti Boost] (rev a1)
11:47 mwk: that'd be 13[4-7]*
11:47 imirkin: moongazer: nothing particularly easy
11:47 moongazer: Well, I am running a nouveau driver on it
11:47 imirkin: mwk: could have multiple ranges, lots of chips do, no?
11:47 imirkin: moongazer: oh. then just look in dmesg.
11:47 mwk: well, in principle...
11:47 imirkin: moongazer: dmesg | grep nouveau
11:47 gnarface: it's so weird in fact, i wonder if it's counterfeit
11:48 moongazer: gnarface, No it's not a counterfeit, don't worry
11:48 imirkin: gnarface: nah, i've seen the 179c thing before, in conjunction with the 940MX in fact
11:48 imirkin: i don't remember the outcome though
11:48 imirkin: gnarface: lspci is just based on the pci.ids file -- since it's not in there, it won't say
11:48 moongazer: [ 0.847216] nouveau 0000:01:00.0: NVIDIA GM107 (1171c0a2)
11:48 mwk: huh.
11:49 imirkin: moongazer: so there you have it.
11:49 mwk: so... multiple ranges?
11:49 moongazer: imirkin, where do I have what?
11:49 pmoreau: NVIDIA GM107
11:49 moongazer: pmoreau, what does that even mean?
11:49 imirkin: mwk: it's been known to happen
11:50 mwk: well, you asked if it's a GM107 or GM108
11:50 pmoreau: You were asling whether it was a MG107 or GM108
11:50 pmoreau: *asking
11:50 moongazer: And why isn't my card name been shown
11:50 pmoreau: (GM107
11:50 mwk: because nobody except marketing cares about card names
11:50 moongazer: I got that
11:50 mwk: nouveau doesn't even bother to figure it out
11:50 moongazer: mwk, lol OK
11:50 mwk: all that matters is the chipset
11:50 imirkin: it'd be a full time job to keep track of that... we have better things to do.
11:51 imirkin: although ben did do an initial import of all the names for some odd reason
11:51 gnarface: posterity?
11:51 mwk: well, they were in xf86-video-nv, ages ago
11:51 mwk: once in a while someone thinks we care and sends a patch that updates it :p
11:53 mwk: heck, I made a list in envytools as well
11:53 moongazer: https://www.x.org/wiki/SummerOfCodeIdeas/
11:53 moongazer: Someone look at the above page
11:53 moongazer: And look at 'Maxwell Accelerated Video Decoding'
11:53 moongazer: Can someone tell me what this project is all about?
11:54 imirkin: video decoding on maxwell?
11:54 mwk: ah, scary things
11:55 imirkin: moongazer: basically "through willpower and magic, make video decoding work on GM10x chips"
11:55 bsper: Hey. I have a GTK 770M, is power management through pstate supported for that card?
11:55 moongazer: imirkin, The meaning is hardly clear....
11:55 imirkin: it actually shouldn't be that hard... no more than a month's work i figured
11:55 imirkin: bsper: yes.
11:55 pmoreau: imirkin: I guess GM20x as well, except that at low clocks it is not that useful?
11:55 moongazer: imirkin, I am student interested in doing this project.
11:56 bsper: imirkin: Thanks!
11:56 imirkin: pmoreau: an except for the potentially signed firmware situation
11:56 imirkin: moongazer: ok ... so what's your question?
11:56 pmoreau: Ah, yeah
11:56 imirkin: [fyi, GSoC has already started, but EVoC can be done at any point afaik]
11:57 moongazer: imirkin, What does it mean exactly, how do go about contacting the right people, what do you mean by video decoding, what technologies are used etc.
11:57 imirkin: well ... irc is the right way to contact, and i am the right person
11:58 imirkin: video decoding means ... decoding videos. sorry, not sure how to better describe it.
11:58 imirkin: you have a video, and you want to decode it, so you do video decoding?
11:58 moongazer: imirkin, I mean I know what video decoding means
11:59 imirkin: ok, so what's your question?
11:59 gnarface: moongazer: it's not actually working currently. when you play video it's using software decoding. it's not hardware-accelerated
11:59 bsper: Hmm, none of the settings in /sys/kernel/debug/dri/0/pstate seem to be activated, but the settings are there. Is AC the default setting? Even though there's no visual feedback of it being activated
11:59 moongazer: gnarface, so is that what the project is all about.
11:59 imirkin: bsper: AC is the current setting
12:00 moongazer: imirkin, how do I go about doing this project
12:00 bsper: imirkin: Okay, thanks
12:00 imirkin: bsper: you can't (currently) reclock while the GPU is off
12:00 gnarface: moongazer: presumably (i didn't actually look at the schedule in question, i don't work here)
12:00 imirkin: bsper: so make sure that the application is already running before changing clocks
12:00 bsper: imirkin: Noted, thank you
12:00 imirkin: moongazer: the project is about the video decoding engine on maxwell. figure out how it works, and then add code to make use of it.
12:01 imirkin: (RE = reverse engineer, btw)
12:01 pmoreau: imirkin: Didn't karolherbst_ or RSpliet fix that (reclocking while the GPU is off)? Or at least that it wouldn't hang?
12:01 RSpliet: not me
12:02 imirkin: pmoreau: iirc the fact that it was dying was fixed, but it still doesn't set the old values on resume
12:02 pmoreau: Ah, ok
12:02 RSpliet: my mapping of nouveau plumming is still from three rewrites ago, I never found the time to keep up properly :-(
12:02 imirkin: bsper: oh, and another little bit of info you might be missing is that the GPU goes to sleep on laptops when it's not in use - it should say DynOff in the vgaswitcheroo file.
12:02 imirkin: RSpliet: yeah, ben writes this stuff faster than i can read it too :)
12:02 imirkin: RSpliet: but i think i'm one rewrite ahead of you...
12:03 pmoreau: RSpliet: But I'm sure the most recent one was the Last One (TM)!
12:03 imirkin: pmoreau: just like all the previous ones.
12:03 pmoreau: ;-)
12:04 pmoreau: But I am definitely not going to complain about those rewrites, they have definitely improved the code
12:04 bsper: imirkin: I don't have an optimus laptop, the integrated GPU is turned off for whatever reason. It shouldn't apply to me then, right? vgaswitcheroo doesn't exist on my system (great name by the way)
12:05 imirkin: bsper: oh, then yeah, you can just reclock. the settings should be reflected on the AC line. if they're not, you're in trouble
12:05 imirkin: bsper: also note that this stuff only started working with moderately recent kernels... 4.9 or 4.10 or something
12:05 imirkin: [well, it STARTED working a long time ago, but started working RELIABLY only recently]
12:06 imirkin: gtg
12:06 bsper: imirkin: Thanks, take care
12:06 pmoreau: bsper: Integrated GPU being turned off, are you on a rMBP?
12:06 bsper: pmoreau: Asus ROG
12:07 karolherbst_: pmoreau: not pushed
12:07 pmoreau: Ah, ok. Cause on some of the MacBook Pros (2013 at least), the Intel GPU is turned off by the EFI firmware if the OS does not identify as macOS.
12:08 pmoreau: karolherbst_: Ok
12:10 moongazer: imirkin, ok hmm
12:10 moongazer: imirkin, the kepler project after that...is my video card good enough to do that
12:11 karolherbst_: pmoreau: we need to poke skeggsb more often
12:12 bsper: The state seems to be reflected on the AC line, and there's an asterisk by the chosen pstate. So that seems to work, neat
12:13 RSpliet: karolherbst_: maybe send him a joint-weekly report of stuff he still needs to do. Rather concentrate than constantly distract ;-)
12:13 moongazer: imirkin, pmoreau ?
12:13 pmoreau: moongazer: There are probably a few differences in the video engines between Kepler and Maxwell. I don't know how much though.
12:14 karolherbst_: RSpliet: or maybe this problem will solve itself anyhow at some point
12:14 moongazer: Okay, I got to wait for imirkin
12:16 moongazer: pmoreau, Description: RE the mechanism for video decoding in VP6 (the video engine iteration used in GM10x chips). Implement support for driving the engine.
12:17 moongazer: Where do I find the codebase for this
12:17 pmoreau: RSpliet: Patchwork could work to list outstanding patches waiting for review, might need some cleanup.
12:18 RSpliet: moongazer: it doesn't exist. that's the problem. Earlier generations are part of the Linux kernel and mesa.
12:18 RSpliet: pmoreau: yeah that might automate the weekly report thing ;-) Although it doesn't help with collaboration on things like clk-devel
12:18 RSpliet: I guess that's my problem more than anyone else's
12:18 pmoreau: moongazer: In Mesa, you can look for VP3 here: https://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/drivers/nouveau
12:19 moongazer: RSpliet, what doesn't exist?
12:20 RSpliet: moongazer: code for the VP6 video engine
12:20 moongazer: RSpliet, that is what I have to make
12:20 RSpliet: yes ;-)
12:20 pmoreau: RSpliet: clk-devel?
12:21 RSpliet: pmoreau: pardon, devel-clk, Ben's dev tree for DRAM reclocking
12:21 moongazer: RSpliet, I am confused so as how to start doing anything related to it
12:22 pmoreau: RSpliet: I would have asked the same about devel-clk :-D
12:23 pmoreau: RSpliet: Looking at accepted patches for Nouveau on patchwork, there are only two of mine, which I manually set to accepted :-D https://patchwork.freedesktop.org/project/nouveau/patches/?submitter=&state=3&q=&archive=both&delegate=
12:25 pmoreau: moongazer: I am not enteriely sure, but you would probably look at how it worked for VP3, to get an idea of what is happening. Then you encode a small video using the NVIDIA driver while tracing it. After that, you look through the trace to see what the NVIDIA driver did, you implement it for Nouveau.
12:25 RSpliet: moongazer: these projects aren't for the faint of heart. "reverse engineering" is an important skill to have before you can embark on a project like this. We don't have a programming manual to follow that will guide you through the implementation...
12:26 pmoreau: Finally, you try encoding the video using Nouveau, decode it with another decoder and check that the output from the decoding matches what you gave to the encoder.
12:26 RSpliet: pmoreau: I'd be happy if patches get plucked from the nouveau ML (tricky, because it gathers various projects...), we might have to refine patchwork for Ben's workflow
12:27 moongazer: pmoreau, RSpliet That is fine.
12:27 RSpliet: I'm sure it'd help if he has a todo list that updates itself
12:27 moongazer: I will try the mailing list to get more help and ask more specific questions
12:28 pmoreau: RSpliet: Yeah, a todo list could be nice. Or some WIP branches, rather than seeing series appear on his master branch.
12:29 RSpliet: pmoreau: everyone can manage their own github fork as a WIP branch. devel-clk is one such branch
12:29 RSpliet: (but requires a bit of effort from Bens side to keep pushing WIP stuff, it's out of date to a point that I can't work with it properly right now)
12:30 RSpliet: it's a bit of a niche problem though, Ben does tend to be the only kernel dev 99% of the time, so forcing him into different workflows for the 1% might be a stretch to ask
12:30 pmoreau: True
12:30 RSpliet: (or is this a chicken-and-egg problem...? ;-))
12:31 pmoreau: In most cases, probably not
12:38 imirkin_: moongazer: based on your questions, i doubt you're in a position to tackle the project
12:39 imirkin_: moongazer: this is a medium-to-high difficulty project
12:39 imirkin_: it would require a student of fairly exceptional abilities to do during the GSoC period
12:39 moongazer: imirkin_, Sorry:( I know that my questions were totally stupid and I asked them in a hurry. But I think if I research enough and get the guidance, I can do it
12:40 imirkin_: moongazer: your premise is that this is a homework assignment. there's a teacher somewhere who has the answer but won't give it to you.
12:40 imirkin_: however the reality is somewhat different - this is more of a research project.
12:40 imirkin_: in order to provide guidance, i'd have to do the project myself
12:40 imirkin_: which would somewhat defeat the point of someone else doing it
12:41 imirkin_: we can point you at tools that we use/etc
12:41 imirkin_: having RE'd VP2 and helped iron out a few things with VP3, i'm reasonably well placed to know what's required to do such a project
12:42 imirkin_: the steps are basically: (a) trace kernel operations under blob, (b) trace userspace operations under blob, (c) write enough nouveau kernel support to bring up the engine and (d) write a test program that decodes a frame.
12:42 imirkin_: after you hit step (d) things get pretty easy actually
12:43 imirkin_: the steps after that are basically to get mesa up and running with it
12:43 imirkin_: i've been led to believe that the actual interchange format is pretty similar between VP3 and VP6
12:43 imirkin_: if not identical
12:44 moongazer: imirkin_, that is what I am looking for, the steps, the tools, where to learn the skills required etc
12:45 moongazer: imirkin_, I have not worked in this field earlier, so I have not idea about it
12:47 moongazer: imirkin_, where do I start reading
12:56 moongazer: imirkin_, what do you do here?
13:08 imirkin_: huh?
13:09 imirkin_: reading what?
13:09 imirkin_: envytools has an assortment of tools
13:09 imirkin_: mmiotrace will be useful, as will valgrind-mmt
13:13 gnarface: moongazer: you know how to code in C, right?
13:18 moongazer: gnarface, Yes, I am pretty good at C.
13:18 moongazer: gnurou, github.com/universecoder/Horus-Chess-Engine
13:18 moongazer: gnarface, *
13:18 moongazer: That's C++ though
13:22 gnarface: just making sure
13:25 moongazer: gnarface, What were you about to tell me?
13:25 moongazer: gnarface, tell me; how do I go about reverse engineering it
13:31 gnarface: i was not about to tell you anything, i was just trying to figure out where you were starting from
13:38 moongazer: gnarface, errr
13:38 moongazer: ok
13:42 gnarface: moongazer: i guess i would have told you to learn about gcc
13:43 gnarface: and maybe download the kernel source
13:46 moongazer: gnarface, yeah I have been using gcc for 3 years now
13:46 moongazer: gnarface, kernel source?
13:51 gnarface: you know
13:51 gnarface: apt-get source linux-image-amd64
13:51 moongazer: That's ok. But for what?
13:51 moongazer: gnarface, I mean for what purpose
13:52 gnarface: just to look at drivers
13:54 moongazer: gnarface, ok
13:54 moongazer: Got to go now
13:54 moongazer: I will try researching stuff and also look at the other projects
13:54 moongazer: Got to go now
15:23 imirkin_: hakzsam: did you ever end up providing some docs for the various bindless things?
15:23 imirkin_: hakzsam: do you figure it's something i can implement in an hour or two? [on nouveau]
15:33 hakzsam: imirkin_: I added some gallium docs yes
15:33 hakzsam: not sure if it's doable in two hours though :)
15:49 imirkin_: hakzsam: hm... ok. what do you expect won't work out of the box?
15:49 hakzsam: nothing, but 2 hours seem short
15:50 imirkin_: hakzsam: just create a texture and image bin, stick the resident handles into it
15:50 imirkin_: and let the good times roll
15:50 hakzsam: yeah, in theory but in practice :)
15:50 imirkin_: hehe ok
15:50 imirkin_: fair enough
15:50 hakzsam: let me know if you start to work into it
15:50 imirkin_: did someone want to take a stab at it? if not, i'll try it.
15:50 hakzsam: eventually, but not before july...
15:51 hakzsam: so, have fun :)
15:52 hakzsam: imirkin_: btw, bindless is required for dow3
16:00 dboyan: hakzsam: I saw your r-b on my perfmon patches. Do you think it proper to change type of matrics like ipc to float?
16:01 hakzsam: should work
16:03 dboyan: ok, I'll take a look and append that to my previous series. I'll also add some messages to previous ones. Probably tomorrow.
16:03 imirkin_: dboyan: btw, heed mupuf's email
16:09 dboyan: imirkin_, yeah I saw that, and currently working on it. Should be done soon
16:12 imirkin_: dboyan: cool
16:12 imirkin_: just making sure you saw it
17:03 bsper: Hey, stupid question, but is it the drivers (software) or the hardware (BIOS/firmware/whatever) that turns off the computer if the card gets too warm?
17:08 imirkin_: bsper: most modern GPUs have overheating protection where they just take themselves off the pcie bus past a certain temp
17:09 bsper: imirkin_: Thanks
17:09 imirkin_: no protection is perfect of course
17:09 imirkin_: laptops tend to have GPU fans that are controlled by the EC rather than the GPU directly
17:10 imirkin_: the drivers are meant to take preventative measures to avoid overheating as well
17:10 imirkin_: although nouveau has no such thing
17:11 bsper: Ah, I see. Is it a WIP to get such countermeasures?
17:11 bsper: Or on the to-do list?
17:11 imirkin_: all depends how one defines 'in progress'
17:11 imirkin_: but basically no, it's on a wishlist/todolist
17:12 imirkin_: that no one is tasked with getting to the end of :)
17:16 bsper: Awh. Well I'm impressed by how far the project has gotten
17:16 imirkin_: it's not bad, but hardly a bastion of perfection. and unfortunately very easy to compare to the golden standard in video drivers...
17:43 mooch2: mwk, do you know of anybody who knows how the windows nv3 drivers work?
17:43 mooch2: or the windows nv4 drivers, that'd be good too
17:44 imirkin_: they execute series of instructions on the host cpu?
17:45 mooch2: you know what i mean <.<
17:45 mooch2: like, i need to figure out why the current drivers fuck up before rendering anything
17:45 mooch2: interrupts seem to be working okay
18:33 imirkin_: mooch2: this is with an emulated gpu right?
18:33 imirkin_: if so, just make a log of everything
18:33 mooch: yeah
18:33 mooch: i did
18:34 mooch: it just stops after setting up some interrupts and reading from the crtc port
18:34 mooch: i have no fucking clue what's going on
18:34 imirkin_: it's likely due to the responses you're giving to the various queries
18:34 mooch: it also tries to read the EDID, which i don't emulate yet
18:34 mooch: because i2c is complicated and shit
18:35 imirkin_: ok, well you should emulate failing to return things
18:35 imirkin_: like what happens when there's no edid
18:35 mooch2: how does that work?
18:36 imirkin_: no clue
18:36 mooch2: shit
18:36 imirkin_: there was a time before 1996 though
18:36 imirkin_: i remember it as though it was yesterday :)
18:36 imirkin_: monitors didn't have EDIDs
18:36 mooch2: i was born in 1998 lol
18:37 karolherbst: imirkin_: fun times
18:37 imirkin_: you youngin's
18:37 karolherbst: hey. my actual first computer was an atari ST 1040
18:54 hakzsam: imirkin_: is bindless done? :)
18:54 imirkin_: hakzsam: haven't even so much as looked at it
18:54 imirkin_: i wasn't planning on doing it now... work ... etc
18:54 hakzsam: sure, no rush
19:05 mooch2: imirkin_, how does edid reading work exactly?
19:05 mooch2: like, at i2c port 0x50, how does reading that work?
19:15 imirkin_: mooch2: do you know what i2c is?
19:15 mooch2: yeah
19:15 mooch2: i've got it mostly implemented
19:15 mooch2: except i don't know how reading the eeprom works
19:15 imirkin_: so ... it's the "chip" at address 0x50
19:15 imirkin_: and you can send reads (or writes)
19:15 imirkin_: (since the idea of i2c is that you can have multiple chips on a single bus)
19:16 mooch2: yeah but how do you read at a specific address on the chip?
19:16 imirkin_: iirc you send a write with the address
19:16 imirkin_: and then you send a read
19:16 mooch2: oh
19:16 imirkin_: but i don't 100% remember
19:16 imirkin_: you'd have to check
19:16 imirkin_: http://i2c.info/i2c-bus-specification
19:17 imirkin_: i suspect reading some linux kernel helpers for i2c would also be instructional
19:17 mooch2: no i mean like
19:17 mooch2: the eeprom specifically
19:17 imirkin_: the eeprom is what's sitting on that i2c bus
19:18 imirkin_: with some standard chip id
19:19 mooch2: yeah but how do you read from it
19:19 imirkin_: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/drm_edid.c#n1215
19:19 imirkin_: look at that function.
19:20 mooch2: i think that answers my question. thanks
19:20 mooch2: but just to clarify
19:21 mooch2: you write the address to the chip addr, then you read the contents of the chip?
19:21 mooch2: does it auto-increment?
19:22 imirkin_: http://elixir.free-electrons.com/linux/latest/source/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busnv04.c
19:23 imirkin_: http://elixir.free-electrons.com/linux/latest/source/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/bit.c#L183
19:30 mooch2: thanks imirkin_
19:34 moongazer: imirkin_, I am downloading the codebase now
20:19 moongazer: Reading https://nouveau.freedesktop.org/wiki/InstallNouveau/ Out of the kernel compilation
20:19 moongazer: https://paste.ofcode.org/NMaWNUJxVDjJ3PGn9XtdTs got this error I thought the linux/ directory was not required, since it's an out of the kernel compilation?
20:23 moongazer: Anyone there?
21:18 pmoreau: moongazer: No, the kernel source are still required for the out-of-tree module, as Nouveau relies, for example, on calls to the ACPI API, or the DRM one, which are not part of the out-of-tree module.
21:20 pmoreau: With having the out-of-tree module though, you only need to compile the kernel once, and change Nouveau multiple times without having to re-create a kernel image each time you made a one line change in Nouveau.