Solved Proper way of installing Nvidia 465.27 driver

So the driver I am trying to install is: 465.27
I see various instructions at the same time threads on forums saying that handbook guide on nvidia is obsolete... so obvious question is, how do I proceed and properly install above version of driver for x64 amd?

I downloaded this file:

untared it, and ran "make install clean". and already got a problem where it complained that "opt_global.h" is not found, searched and found mentioning of that file in some online threads but no certain info.

how should I proceed?

can somebody please layout exact latest steps to follow in order to install that specific driver?
(especially if someone already went through this)
 
yes, there was readme file basically saying to extract archive and run "make install" which again returns error about that header file I mentioned.
 
Well I just downloaded it and extracted it and it says:
Chapter 2. Minimum Software Requirements
______________________________________________________________________________

The official minimum software requirements for the NVIDIA FreeBSD Graphics
Driver are as follows:

Software Element Min Requirement
---------------------------------- ----------------------------------
Kernel FreeBSD 10.4-STABLE
X.Org xserver 1.7
libvdpau * 0.2
libvulkan ** 1.0.61

Additionally, the kernel source tree must be installed in /usr/src/sys
(package 'ssys' installed)

Note that FreeBSD-CURRENT development snapshots are not supported.

* Required for hardware-accelerated video playback. See Appendix F for more
information.

** Required for applications which use the Vulkan API.
So you need some packages/ports, specifically :
multimedia/libvdpau and maybe graphics/vulkan-loader and perhaps even graphics/vulkan-headers.

Oh, and as it says, you'll need to pull in the src for FreeBSD.
 
You can often just apply the current port’s diffs to an updated 3rd party package and have to patch up just a few things. One thing you can try is copy /use/ports/x11/nvidia-driver-390 to create /use/ports/x11/nvidia-driver-465, fix up the Makefile and see what happens. If that is still hard to fix, create the new port from a copy of /use/ports/x11/nvidia-driver. Or at least examine the diffs in /use/ports/x11/nvidia-driver/files/ directory.

But first you should just try to use the existing port or package. Only try the more painful path above if your board is newer than what is supported by /use/ports/x11/nvidia-driver.
 
Well I just downloaded it and extracted it and it says:

So you need some packages/ports, specifically :
multimedia/libvdpau and maybe graphics/vulkan-loader and perhaps even graphics/vulkan-headers.

Oh, and as it says, you'll need to pull in the src for FreeBSD.
I apologize, I somehow didn't realize about requirements, thought that this is self-contained package.

so, I did install the vulkan-headers and vulkan-loader, libvdpau was already installed. x server.. means xorg, right? I did install xorg before that as well.

regarding the BSD sources, I did put "src" checkmark during FreeBSD 13.0 install process. so should be there as well.

attempting to "make install" again gives me this:
:1:10: fatal error: '/usr/home/r2com/builds/NVIDIA-FreeBSD-x86_64-465.27/src/nvidia/opt_global.h' file not found #include "/usr/home/r2com/builds/NVIDIA-FreeBSD-x86_64-465.27/src/nvidia/opt_global.h"
 
You should be able to use the nvidia-driver package, I would think. Looking through this thread, I'm not sure why you are using the driver from the Nvidia site, but I might have missed the reason--if so, I apologize.
I had always thought, though never experimented, that the driver from Nvidia as is was built for Linux, not FreeBSD which would certainly cause some issues.
I have a page on it, but it's written for 11.x, and I haven't updated it for using git. I'll have to fix that. In the meantime, aside from not giving the git comands to update source code, it's correct, so I'll give the link here.

As has been said, it's a much easier way to install the Nvidia drivers.
 
OK! so it seems I managed to start off this point and do as suggested, i.e. use the ports.

so here is what I did:
cd to /usr/ports/x11/nvidia-driver

change version inside Makefile to 465.27

then I ran "make makesum" and "make install"

the process started and even opened terminal/graphical installer where I just clicked OK for default options, then, it was installing/compiling dependencies (gesd etc..) and gave me different error:

===> Installing for gsed-4.8 ===> Checking if gsed is already installed ===> Registering installation for gsed-4.8 as automatic Installing gsed-4.8... ===> nvidia-driver-465.27_1 depends on executable: gsed - found ===> Returning to build of nvidia-driver-465.27_1 ===> Applying extra patch /usr/ports/x11/nvidia-driver/files/extra-patch-src_nvidia-modeset_nvidia-modeset-freebsd.c 2 out of 7 hunks failed--saving rejects to src/nvidia-modeset/nvidia-modeset-freebsd.c.rej ===> FAILED Applying extra patch /usr/ports/x11/nvidia-driver/files/extra-patch-src_nvidia-modeset_nvidia-modeset-freebsd.c *** Error code 1
 
again, just wanted to highlight the fact that it DID properly fetch 465.27 after I modified Makefile and ran "make makesum", which kinda gives some indication that I am on a right track. but I am a little stuck on this new error related to "Applying extra patch" failure.. any further suggestions?
 
Not sure how you managed to get this error: 460 -> 465 update doesn't involve any substantial patch changes, afaik. I have a slightly customized nvidia-driver port there, which is usually more up-to-date than official port. Might be easier for you to start with that one.
 
Open a PR and ask for porting the new version.

There's a reason for having ports. They make things easy to manage. It's what you should use. Of course, the "perfect" PR would already include a patch for the required update, and if you have the ability to do that, that's awesome. But if not, just opening a PR stating you need the newer version, asking the maintainer to port it, is perfectly fine.
 
well, I am already using ports as suggested. and trying to find the reason for errors related to patching..
 
below is the file "nvidia-modeset-freebsd.c.rej" where it said "saving rejects to":
@@ -25,6 +25,7 @@
#include <sys/poll.h>
#include <sys/file.h>
#include <sys/proc.h>
+#include <sys/sysproto.h>

#include "nvkms-ioctl.h"
#include "nvidia-modeset-os-interface.h"
@@ -889,33 +891,31 @@
*************************************************************************/

#if defined(NVKMS_SUPPORT_LINUX_COMPAT)
+static struct linux_device_handler nvkms_linux_device_handler = {
+ .bsd_driver_name = "nvidia-modeset",
+ .linux_driver_name = "nvidia-modeset",
+ .bsd_device_name = "nvidia-modeset",
+ .linux_device_name = "nvidia-modeset",
+ .linux_major = 195,
+ .linux_minor = 254,
+ .linux_char_device = 1
+};

static int nvkms_linux_ioctl_function(
struct thread *td,
struct linux_ioctl_args *args
)
{
- struct file *fp;
- int status;
- u_long cmd;
+ static const uint32_t dir[4] = { IOC_VOID, IOC_IN, IOC_OUT, IOC_INOUT };

-#if NV_FGET_HAS_CAP_RIGHTS_T_ARG
- cap_rights_t rights;
- status = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), &fp);
-#else
- status = fget(td, args->fd, &fp);
-#endif
-
- if (status != 0) {
- return status;
+ if ((args->cmd & (1<<29)) != 0) {
+ /* FreeBSD has only 13 bits to encode the size. */
+ printf("nvidia: pid %d (%s): ioctl cmd=0x%x size too large\n",
+ (int)td->td_proc->p_pid, td->td_proc->p_comm, args->cmd);
+ return (EINVAL);
}
-
- cmd = args->cmd;
-
- status = fo_ioctl(fp, cmd, (caddr_t)args->arg, td->td_ucred, td);
- fdrop(fp, td);
-
- return status;
+ args->cmd = (args->cmd & ~IOC_DIRMASK) | dir[args->cmd >> 30];
+ return (sys_ioctl(td, (struct ioctl_args *)args));
}

#define NVKMS_LINUX_IOCTL_MIN _IOC(0, NVKMS_IOCTL_MAGIC, NVKMS_IOCTL_CMD, 0)
 
Builds and works fine here on 12.2-RELEASE.

Makefile
Code:
PORTNAME=       nvidia-driver
DISTVERSION?=   465.27

Code:
$ pkg info -E nvidia-driver
nvidia-driver-465.27

Xorg.0.log
Code:
[   742.517] (II) LoadModule: "nvidia"
[   742.517] (II) Loading /usr/local/lib/xorg/modules/drivers/nvidia_drv.so
[   742.517] (II) Module nvidia: vendor="NVIDIA Corporation"
[   742.517]    compiled for 1.6.99.901, module version = 1.0.0
[   742.517]    Module class: X.Org Video Driver
[   742.517] (II) NVIDIA dlloader X Driver  465.27  Thu Apr 22 23:12:26 UTC 2021
 
T-Daemon, thanks for additional info for 12.2

so could my issue be because I do it in 13.0 ?
 
thank you,

so in that case, the specific error I copied over, does it tell you anything? or at least in terms of, where would you look for in order to get clue?
 
also could you confirm to me that the only thing you did is:
1) modify Makefile in /usr/ports/x11/nvidia-driver to have version 465.27
2) run "make makesum"
3) make install

is that all you did?
(I am trying to figure out if I missed anything)
 
darn.. no idea what to do then, searching online for similar problems does not bring any topics either.

I wonder if problem could be because I already launched X before?

and I did post the nvidia-modeset-freebsd.c.rej above, does not give me any idea either...although, does it look like something what has to do with Linux compatibility support?
 
Back
Top