Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Buck Turgidson
Feb 6, 2011

𓀬𓀠𓀟𓀡𓀢𓀣𓀤𓀥𓀞𓀬

McCracAttack posted:

I've been messing around with Pop OS and just like people said Steam games run pretty well with Proton enabled. However, I have noticed that the games have a bad habit of "hitching" every second or so. Any suggestions on what to look into first? I have an Nvidia GPU and I'm using the driver that was suggested in the built in Pop OS app store.

Also, if there's a better place to ask about this please let me know.

You might need to tweak things a bit to get better gaming performance. In the OP of the Linux gaming thread there's a link to a utility called Gamemode. It's a background process that detects when you are running a game and makes tweaks to try and maximise performance.

After you install it, you add "gamemoderun %command%" to the launch options of your steam games. The gamemode process should detect that you have launched a game and make the required tweaks.

Give it a try and see how you go. You might also find this page useful: https://wiki.archlinux.org/title/Gamemode

Adbot
ADBOT LOVES YOU

Kibner
Oct 21, 2008

Acguy Supremacy
Also, that may be shader compilation, if your computer didn't get pre-compiled shaders from steam or proton.

Yaoi Gagarin
Feb 20, 2014

Kibner posted:

Also, that may be shader compilation, if your computer didn't get pre-compiled shaders from steam or proton.

I don't think you'll ever get precompiled shaders for a PC game. At best you'll get a partially compiled IR like SPIR-V or DXIL

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

You get them on the Steam Deck, from Valve (crowdsourced). It’s glorious.

wash bucket
Feb 21, 2006

Klyith posted:

You could also try to narrow down whether it's steam or the system in general by trying out lutris, or finding a linux-native game.

Ah, I turned off Steam Play/Proton and tried a Linux native game. No stutter. Feels like we're onto something here. I'll keep looking into it with your suggestions and everyone else's. Thank you all for the replies.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
I have a Linux kernel question. Let's say I build set some CONFIG setting as a module, built, installed, and booted that kernel. What the hell actually happened? What's actually available?

For shits and giggles, I was asked if I could just disable the eBPF flags I enabled by unloading modules. I really don't think that would be possible, but you can still set all the related settings to 'm' and something builds. What does that even mean? I'm guessing it really just no-ops. How can I tell it all sorted out? If there are modules built for these capabilities, how would be able to tell what they are and load/unload them?

waffle iron
Jan 16, 2004
You would insert or remove the module with modprobe. You can also auto load a module on boot with /etc/modules and a couple other things that can be distro dependent.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

waffle iron posted:

You would insert or remove the module with modprobe. You can also auto load a module on boot with /etc/modules and a couple other things that can be distro dependent.

What would the module even be called?

other people
Jun 27, 2004
Associate Christ
/lib/modules/<kernel ver>/*/*.ko<.optional compression>

Something like that. Most distros provide large numbers of kernel bits as modules that are loaded on demand. The most obvious being device drivers but also things like nftables/iptables bits, file systems, etc, etc.

other people
Jun 27, 2004
Associate Christ
lsmod shows what is currently loaded. it can be a pretty big list.

Volguus
Mar 3, 2009

Rocko Bonaparte posted:

What would the module even be called?

The configuration help tells you what the module will be called. HW driver modules are going to be loaded automatically if the device they handle is found, otherwise not. Other modules ... it depends. If I mount a cifs mount, then the module will be loaded automatically. If I didn't compile it, it won't mount.

jaegerx
Sep 10, 2012

Maybe this post will get me on your ignore list!


Rocko Bonaparte posted:

I have a Linux kernel question. Let's say I build set some CONFIG setting as a module, built, installed, and booted that kernel. What the hell actually happened? What's actually available?

For shits and giggles, I was asked if I could just disable the eBPF flags I enabled by unloading modules. I really don't think that would be possible, but you can still set all the related settings to 'm' and something builds. What does that even mean? I'm guessing it really just no-ops. How can I tell it all sorted out? If there are modules built for these capabilities, how would be able to tell what they are and load/unload them?

Lets do this exercise https://xyproblem.info

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
Oh great I got X/Y'd.

I'm asking this because I was enabling BPF and got a question about lowering the cost to the kernel's footprint by making it a module. At the most basic level, sure I can just set all the 'y' to 'm' that I need to enable it, but what the hell does that mean? It's not like I'm option to turn a kernel driver into a kernel module, which I can see being much more decoupled than a kernel feature or ... would even "subsystem" describe the extended Berkeley Packet Filter?

What I think happens is that the config settings get promoted to 'y' instead. I thought I just botched it the first time but I got consistent results on a second attempt. Like, I thought it would be bizarre if that kind of thing could even become a separate module, and it looks like I was correct at least in that notion.

Edit: So the answer is that I can't make the stuff a module so everything beyond that is moot.

busfahrer
Feb 9, 2012

Ceterum censeo
Carthaginem
esse delendam
I am Dual Booting Windows 11 and 10 (11 was first), using Windows Boot Manager. Can I overwrite the Win10 Partition with a Ubuntu (hoping that the Ubuntu setup's Windows Boot Manager integration will work), or would that break the Boot Manager? I used to understand MBR booting but UEFI is a mystery to me.

Klyith
Aug 3, 2007

GBS Pledge Week

busfahrer posted:

I am Dual Booting Windows 11 and 10 (11 was first), using Windows Boot Manager. Can I overwrite the Win10 Partition with a Ubuntu (hoping that the Ubuntu setup's Windows Boot Manager integration will work), or would that break the Boot Manager? I used to understand MBR booting but UEFI is a mystery to me.

EFI boot = a FAT partition with some standard folders and files. The bios understands FAT and can start the boot process by running a file, rather than following a chain of hard addresses and blindly running whatever starts at that address. It's actually quite simple other than the fact that you now have options.


If you delete the 10 partition and install linux, the installer should make a second EFI partition in the empty space and leave the Windows boot partition alone. No problem with this -- you can have more than one, and the BIOS will just list all the EFI partitions in the boot selection menu in the same way it used to list different hard drives.

From there, you have 2 choices:
1. Continue to boot the windows boot manager EFI, add linux to that. In the past this was always a big pain because windows would regularly forget the linux entry but I think it works much better these days.
2. Switch to booting the linux EFI, which will have an entry for Windows ready to go with no effort. If you're using Ubuntu it should still work with Secure Boot turned on.

(In either case when you want to boot the "other" OS it's just running the EFI from the other OS. So there's a 3rd "why not both" if you really wanted.)

Computer viking
May 30, 2011
Now with less breakage.

You can also put multiple boot loaders in one EFI partition, and that works fine with one huge caveat: Windows is paranoid, and you'll probably have to dig up your bitlocker recovery key whenever your linux install updates its files on a shared partition.

cruft
Oct 25, 2007

Rocko Bonaparte posted:

I'm asking this because I was enabling BPF and got a question about lowering the cost to the kernel's footprint by making it a module.

e: to answer your actual question, there is a complicated graph of when stuff can be a module. I don't know for certain about the one you're messing with, but it's entirely likely that some other feature you're configuring forces the BPF module back into the main kernel. Like, I know in the last 5 years, BPF has been overloaded to provide a whole mess of stuff. Maybe some network driver is using it for something, and since the kernel can't call into userspace being like "hey I would like to request you tell me where this module is in order for the network to come up", config marks BPF as Y instead of M.

The thing I edited out was basically "what are you hoping to achieve by recompiling the kernel?" From my perspective, it's equally likely that you have a legitimate situation where a kernel recompile can actually help, or that you're on step 23 of a funroll-loops-esque duck hunt based on a misunderstanding about what "footprint" and "cost" mean.

cruft fucked around with this message at 16:15 on Mar 4, 2023

busfahrer
Feb 9, 2012

Ceterum censeo
Carthaginem
esse delendam

Klyith posted:

EFI boot = a FAT partition with some standard folders and files. The bios understands FAT and can start the boot process by running a file, rather than following a chain of hard addresses and blindly running whatever starts at that address. It's actually quite simple other than the fact that you now have options.


If you delete the 10 partition and install linux, the installer should make a second EFI partition in the empty space and leave the Windows boot partition alone. No problem with this -- you can have more than one, and the BIOS will just list all the EFI partitions in the boot selection menu in the same way it used to list different hard drives.

From there, you have 2 choices:
1. Continue to boot the windows boot manager EFI, add linux to that. In the past this was always a big pain because windows would regularly forget the linux entry but I think it works much better these days.
2. Switch to booting the linux EFI, which will have an entry for Windows ready to go with no effort. If you're using Ubuntu it should still work with Secure Boot turned on.

(In either case when you want to boot the "other" OS it's just running the EFI from the other OS. So there's a 3rd "why not both" if you really wanted.)

It looks like I'll have to do it manually - I can create my ext4 root partition and another small EFI partition in the empty space, but then ubuntu asks me which device to install the bootloader to - which one do I pick as the safest option here? It's OK if that means I can only boot Linux by selecting it from BIOS. Either that or add it to the Windows Boot Manager, but I don't see an option for that. What I don't want is to have to boot Windows from grub (I've done that in the past, though)

Klyith
Aug 3, 2007

GBS Pledge Week

busfahrer posted:

It looks like I'll have to do it manually - I can create my ext4 root partition and another small EFI partition in the empty space, but then ubuntu asks me which device to install the bootloader to - which one do I pick as the safest option here? It's OK if that means I can only boot Linux by selecting it from BIOS. Either that or add it to the Windows Boot Manager, but I don't see an option for that. What I don't want is to have to boot Windows from grub (I've done that in the past, though)

Hmmm. You should chose this main drive that you're installing both OSes to, but if it doesn't allow you target a partition I'm not sure which one it will pick. It might target the new EFI partition you made, it might do the existing windows one.

I'm not exactly familiar with Ubuntu's installer. I've only hosed with the cross-distro Calamares installer (rocks imo) and Fedora Anaconda (enterprisey but comprehensive).


OTOH if you're doing ETX4 for root then the amount of stuff linux needs on the EFI is extremely minimal. GRUB and a boot shim will easily fit on the existing windows EFI partition -- alongside the Windows Boot Manager, not replacing it. As Viking said, this is according to spec. Canonical is tight with MS, they have GRUB & a bootloader shim signed by MS to cover stuff like Secure Boot.

The downside of this always used to be that Windows would sometimes look at the EFI partition and it would be like "what's this other poo poo doing here? I don't know what it is, deleted!" Then you'd have to boot a linux USB stick to fix it. But maybe they don't do that to the signed Ubuntu version?

Anyways I'm pretty sure you are safe to proceed either way. If you start booting GRUB, you should be able to change back to windows in your BIOS.

jaegerx
Sep 10, 2012

Maybe this post will get me on your ignore list!


Rocko Bonaparte posted:

Oh great I got X/Y'd.

I'm asking this because I was enabling BPF and got a question about lowering the cost to the kernel's footprint by making it a module. At the most basic level, sure I can just set all the 'y' to 'm' that I need to enable it, but what the hell does that mean? It's not like I'm option to turn a kernel driver into a kernel module, which I can see being much more decoupled than a kernel feature or ... would even "subsystem" describe the extended Berkeley Packet Filter?

What I think happens is that the config settings get promoted to 'y' instead. I thought I just botched it the first time but I got consistent results on a second attempt. Like, I thought it would be bizarre if that kind of thing could even become a separate module, and it looks like I was correct at least in that notion.

Edit: So the answer is that I can't make the stuff a module so everything beyond that is moot.

Are you doing some embedded system poo poo to where you need to optimize that much?

BlankSystemDaemon
Mar 13, 2009



In case it needs to be said again, with modern update cycles for software, the amount of time saved through optimizations doesn't get offset by the amount of cputime spent by compiling code with optimizations compared to using whatever your packages provide.

If you need custom options (I don't know if this exists outside of FreeBSD Ports, but I assume it does), that calculation obviously changes - but usually the defaults are that for a reason.

The only exception to this is HPC clusters, where software is built exactly once and then run until the cluster gets replaced by a new one.

Computer viking
May 30, 2011
Now with less breakage.

BlankSystemDaemon posted:

In case it needs to be said again, with modern update cycles for software, the amount of time saved through optimizations doesn't get offset by the amount of cputime spent by compiling code with optimizations compared to using whatever your packages provide.

If you need custom options (I don't know if this exists outside of FreeBSD Ports, but I assume it does), that calculation obviously changes - but usually the defaults are that for a reason.

The only exception to this is HPC clusters, where software is built exactly once and then run until the cluster gets replaced by a new one.

In this specific case it may make sense. If the target is some weird embedded platform, cross-compiling a stripped down kernel sounds reasonable enough ... and if you're doing that in the first place, you may as well throw in the maximum CPU-specific optimizations.

Really depends on what Rocko is actually doing, ofc.

BlankSystemDaemon
Mar 13, 2009



Computer viking posted:

In this specific case it may make sense. If the target is some weird embedded platform, cross-compiling a stripped down kernel sounds reasonable enough ... and if you're doing that in the first place, you may as well throw in the maximum CPU-specific optimizations.

Really depends on what Rocko is actually doing, ofc.
I kinda thought "custom options" would include TARGET_ARCH'ing aarch64 from an amd64 machine, but :shrug:

Computer viking
May 30, 2011
Now with less breakage.

BlankSystemDaemon posted:

I kinda thought "custom options" would include TARGET_ARCH'ing aarch64 from an amd64 machine, but :shrug:

Yeah, I see what you mean. I'm just saying that if you're in a situation where it already makes sense to compile your own, and the processing power disparity between compiler and target is huge, then you're probably in one of the corner cases where you may as well also go full -O3/-mcpu/etc.

ziasquinn
Jan 1, 2006

Fallen Rib

McCracAttack posted:

Ah, I turned off Steam Play/Proton and tried a Linux native game. No stutter. Feels like we're onto something here. I'll keep looking into it with your suggestions and everyone else's. Thank you all for the replies.

Forgive me I repeat things you've already found or know about, I just am kinda of going overboard because I was really annoyed by how vague or assumptive a lot of information given by people related to Linux can be so I'm going off a little.

(also if you determine the fix please sure cause I'm curious):

As someone who switched full time to Linux in october because my games ended up running better, (like 30-50FPS avg better in Apex), i'm going to hedge it can likely shader compiling catching you up. Do you skip "compiling shaders" at the launch every time? If you let it run (or download some pre-compiled ones for the game from reddit or somewhere else (github)) that should help a little. What games are we talking here? What other specs are you running?

Otherwise, I really like https://github.com/GloriousEggroll/proton-ge-custom as a replacement/different Proton, it runs great. Additionally there are proprietary nvidia drivers (which I recommend if you don't have a grudge against closed-source stuff), vs the open-source Nvidia drivers which, admittedly, I've never used because I haven't cared to.

That repo also discussed nvidia-all, a dkms. Make sure you're using the correct dkms drivers for your card too, I was having HELL back in early october cause I had forced the installation of nvidia-42X drivers not understanding that I was supposed to be using nvidia-525.

I recommend compiling the ProtonGE from the source than an store/repo cause it'll ensure it's fully updated to the latest.

Finally, I just went through this tonight after blowing away and reinstalling, I forgot to modify nvidia-settings and set everything to MAX performance (under PowerMizer), as well as flipping off the checkmarks next to "OPENGL SETTINGS" > Sync to Vblank and Allow flipping (set them OFF). Apex FPS went from 120 --> 300. So don't forget to install nvidia-settings and take a look at that there too.

I'm happy to ramble about this more, but I actually wanted to come talk about my success getting displaylink to function on my system to run 2 extra monitors (for 6 total) in Xorg with literally no discernible lag, graphical artifacts, or random disconnects, but embarrassingly the last 5 hours of troubleshooting came down to the classic "try another cable or adapter" (or in one case, literally plug it in you moron).

The trick to getting it to even install the necessary EVDI driver for Displaylink by following apoc139's advice in the latest comment here https://aur.archlinux.org/packages/displaylink

Otherwise it would throw a fit about the kernel being too new. Then, in a kind of excitement, I applied basically a bunch of troubleshooting tips in the https://wiki.archlinux.org/title/DisplayLink to keep the screens from shutting off (seems to indicate Pulseaudio suspension in some cases) and some other bullshit I wish I had noted down but hopefully won't have to do again soon...

If other people want though, I could comb through my browser history and compile some kind of little guide for it, at least in Arch. I'm sure the same kind of ideas would work in Ubuntu etc as well. I literally switched from Ubuntu (back to) Arch today just because the guides seemed more fleshed out (Although thinking about it now, the trouble I was hitting in Ubuntu was I could only get 1 of 2 displays working at a time, so that was probably an adapter/cable/usb hub issue anyway).

Last thing I'll say:

Linux was something I purposefully avoided engaging with whatsoever since I was a teenager cause it seemed like too much annoyance. But I didn't really grok that it would remind me of being 12 and loving with Windows XP to fix whatever poo poo I broke pretty much every week, which is a really satisfying experience.

Shame so many Linux forums are full of... loving assholes.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

jaegerx posted:

Are you doing some embedded system poo poo to where you need to optimize that much?

No but I work with a bunch of electrical engineers who did a semester of C, so I have to bury them in evidence to shut up all the premature optimization and building of sand castles, one grain at a time, with tweezers.

BlankSystemDaemon
Mar 13, 2009



Computer viking posted:

Yeah, I see what you mean. I'm just saying that if you're in a situation where it already makes sense to compile your own, and the processing power disparity between compiler and target is huge, then you're probably in one of the corner cases where you may as well also go full -O3/-mcpu/etc.
Well, that's the inherit problem with these optimizations - without establishing a baseline, you don't know that they do anything.

And just because you tell it to optimize, doesn't mean it runs faster.
For a long time, there was a not-inconsiderable amount of latency associated with SIMD operations like SSE and MMX as documented by Agner Fog.
As a result, using these instructions in kernel code (which generally operates on small amounts of data, very quickly) could pessimize performance pretty significantly.

Rocko Bonaparte posted:

No but I work with a bunch of electrical engineers who did a semester of C, so I have to bury them in evidence to shut up all the premature optimization and building of sand castles, one grain at a time, with tweezers.
Let me introduce you to Emery Berger:
https://www.youtube.com/watch?v=r-TLSBdHe1A

https://www.youtube.com/watch?v=7g1Acy5eGbE

Oh, and this paper.

Yaoi Gagarin
Feb 20, 2014

BlankSystemDaemon posted:

Well, that's the inherit problem with these optimizations - without establishing a baseline, you don't know that they do anything.

And just because you tell it to optimize, doesn't mean it runs faster.
For a long time, there was a not-inconsiderable amount of latency associated with SIMD operations like SSE and MMX as documented by Agner Fog.
As a result, using these instructions in kernel code (which generally operates on small amounts of data, very quickly) could pessimize performance pretty significantly.

Let me introduce you to Emery Berger:
https://www.youtube.com/watch?v=r-TLSBdHe1A

https://www.youtube.com/watch?v=7g1Acy5eGbE

Oh, and this paper.

The most tricky thing about compiler optimizations for an end user is usually the size trade-off. Loop unrolling for example might make each individual loop faster, but it also inflates the program size. That causes more cache pressure, so in some cases the total performance of the system is worse. I know of at least one compiler that recommends using size optimization globally and only turning on speed optimization in hotspots.

For the Linux kernel, I wonder if you can compile with PGO?

BlankSystemDaemon
Mar 13, 2009



VostokProgram posted:

The most tricky thing about compiler optimizations for an end user is usually the size trade-off. Loop unrolling for example might make each individual loop faster, but it also inflates the program size. That causes more cache pressure, so in some cases the total performance of the system is worse. I know of at least one compiler that recommends using size optimization globally and only turning on speed optimization in hotspots.

For the Linux kernel, I wonder if you can compile with PGO?
Everything can be compiled with PGO given sufficient time.
The operative part of that sentence is the last three words, because it's fundamentally a combinatorics problem, it quickly gets to a point where it's computationally so expensive that any benefit you might gain is utterly negated.

What PGO is good for, really, is ensuring that you're not hit by the measurement bias that Emery Berger and the paper talks about.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Chapter 3 of this (IMO fantastic) ebook has a great real-world example of “system effects” from an optimization, as well as a pretty neat overview of how they resolved it.

https://carlos.bueno.org/optimization/

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
How come nut-scanner says snmp & xml are not available, even though I've installed those packages?
code:
root@d7a3fe62ee9c:~# nut-scanner --available
SNMP library not found. SNMP search disabled.
Neon library not found. XML search disabled.
IPMI library not found. IPMI search disabled.
OLDNUT
USB
EATON_SERIAL


root@d7a3fe62ee9c:~# apt list --installed | grep nut

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

debianutils/stable,now 4.11.2 amd64 [installed,automatic]
libgnutls30/stable-security,now 3.7.1-5+deb11u3 amd64 [installed,automatic]
libneon27-gnutls/stable,now 0.31.2-1 amd64 [installed,automatic]
libnutscan1/stable,now 2.7.4-13 amd64 [installed,automatic]
nut-client/stable,now 2.7.4-13 amd64 [installed]
nut-server/stable,now 2.7.4-13 amd64 [installed]
nut-snmp/stable,now 2.7.4-13 amd64 [installed]
nut-xml/stable,now 2.7.4-13 amd64 [installed]
nut/stable,now 2.7.4-13 all [installed]

cruft
Oct 25, 2007

fletcher posted:

How come nut-scanner says snmp & xml are not available, even though I've installed those packages?
code:
root@d7a3fe62ee9c:~# nut-scanner --available
SNMP library not found. SNMP search disabled.
Neon library not found. XML search disabled.
IPMI library not found. IPMI search disabled.
OLDNUT
USB
EATON_SERIAL


root@d7a3fe62ee9c:~# apt list --installed | grep nut

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

debianutils/stable,now 4.11.2 amd64 [installed,automatic]
libgnutls30/stable-security,now 3.7.1-5+deb11u3 amd64 [installed,automatic]
libneon27-gnutls/stable,now 0.31.2-1 amd64 [installed,automatic]
libnutscan1/stable,now 2.7.4-13 amd64 [installed,automatic]
nut-client/stable,now 2.7.4-13 amd64 [installed]
nut-server/stable,now 2.7.4-13 amd64 [installed]
nut-snmp/stable,now 2.7.4-13 amd64 [installed]
nut-xml/stable,now 2.7.4-13 amd64 [installed]
nut/stable,now 2.7.4-13 all [installed]

Oh what the hell is this bullshit?

I spun up a debian container, installed whatever this is, and tried to run it. I got the same output. I installed libneon27, same output. I straced it: it appears to do a directory listing of the right directory, but it's not happy with the results.

I found a patch to NixOS meant to fix this very problem (link). It appears to set LD_LIBRARY_PATH, so I did that. Same output.

Next up is going to have to be looking through the source code to figure out what batshit crazy technique "nut" uses to locate dynamic libraries. I mean, this was standardize, I dunno, 20 years ago? But I guess these people think they have a better way, so one of us is going to have to reverse-engineer what their better way is so we can make it work like everything else.

AlexDeGruven
Jun 29, 2007

Watch me pull my dongle out of this tiny box


Developer probably pushed it with whatever their local config was, and probably had something installed in a nonstandard location with a hard coded path somewhere.

I hate software.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

cruft posted:

Oh what the hell is this bullshit?

I spun up a debian container, installed whatever this is, and tried to run it. I got the same output. I installed libneon27, same output. I straced it: it appears to do a directory listing of the right directory, but it's not happy with the results.

I found a patch to NixOS meant to fix this very problem (link). It appears to set LD_LIBRARY_PATH, so I did that. Same output.

Next up is going to have to be looking through the source code to figure out what batshit crazy technique "nut" uses to locate dynamic libraries. I mean, this was standardize, I dunno, 20 years ago? But I guess these people think they have a better way, so one of us is going to have to reverse-engineer what their better way is so we can make it work like everything else.

Oh man, I figured this tool has been around for so long and is so widely used that I must be doing something totally wrong to have stumbled right out of the gate. Glad to hear it wasn't so trivial of an issue. I appreciate you taking the time to look at it! I have a UPS with a network card in it, and I just want my server to shut down when the battery gets low. I figured it was gonna be easy to set up! I'm running this on debian bullseye.

cruft
Oct 25, 2007

Okay OP, I'm knee deep in the source code here, in a function called get_libname_in_dir in common/common.c. It looks like it opens the directory, which I see in the strace, and then goes through each dirent trying to match it against the library name, which on anything but Windows should be libneon.so. That file exists in /usr/lib/x86_64-linux-gnu so I'm not sure what the problem is.

The source code says I should be able to pass -D to nut-scanner to get all these gorgeous debug messages, but it seems the version in Debian is too old and doesn't have that flag.

Does your version of nut-scanner let you pass -D in? That should make it reveal where it's trying to find libneon.so, which should help...

e:

quote:

I'm running this on debian bullseye.

Womp womp. Okay, I'll keep digging.

cruft
Oct 25, 2007

I upgraded to nut-client from bookworm (debian testing) and it found the library.

So I'm going to throw in the towel and suggest you do the same thing. There's probably some stupid bug in the version in bullseye and I don't want to roll the source code back to whatever that is just to find out if I can jury-rig some workaround for some rando with a tiny av and a 2003 reg date ;)

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

cruft posted:

I upgraded to nut-client from bookworm (debian testing) and it found the library.

So I'm going to throw in the towel and suggest you do the same thing. There's probably some stupid bug in the version in bullseye and I don't want to roll the source code back to whatever that is just to find out if I can jury-rig some workaround for some rando with a tiny av and a 2003 reg date ;)

Hey that worked! Thank you!!

code:
root@c7f60cf433e3:~# nut-scanner --available
OLDNUT
USB
SNMP
XML
EATON_SERIAL

jaegerx
Sep 10, 2012

Maybe this post will get me on your ignore list!


I broke 3 people because I use vi mode in zsh not emacs.

Yes kids, we still use vim.

Mr. Crow
May 22, 2008

Snap City mayor for life
I think you're confused, who the hell uses emacs

Adbot
ADBOT LOVES YOU

Keito
Jul 21, 2005

WHAT DO I CHOOSE ?
Yeah I was about to ask where you find these kids using emacs. Sounds like unicorns.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply