# NVIDIA GeForce 320M: No devices connected / No screens found



## yha (Jun 2, 2021)

Hello,

      I have recently installed 13.0-RELEASE on my old A1342 Mid-2010 MacBook. The machine has a GeForce 320M discrete graphics card, with no integrated graphics as far as I can tell, so it is not an Optimus/multi-GPU setup. The 320M uses shared memory.

As per the documentation, this card is supported by version 340 of the nvidia-driver port/package. I have added the relevant bits to rc.conf so that the nvidia/linux kernel modules are loaded. This is verified with kldstat (nvidia.ko, linux_common.ko, linux.ko, and linux64.ko are all loaded).

My user is added to both the wheel and video groups. If I `startx` as a regular user, I get "Cannot run in framebuffer mode. Please specify busIDs for all framebuffer devices". Same thing if I do it as root.

Next I I created driver-nvidia.conf in /usr/local/etc/X11/xorg.conf.d/ with the following config:


```
Section "Device"
    Identifier "NVIDIA Card"
    VendorName "NVIDIA Corporation"
    Driver "nvidia"
    BusID "PCI:0:2:0:0"
EndSection
```

The BusID is taken from `pciconf -lvv`:


```
vgapci0@pci0:2:0:0:     class=0x030000 ............
    vendor     = 'NVIDIA Corporation'
    device     = 'MCP89 [GeForce 320M]'
    class      = display
    subclass   = VGA
```

Running `startx` now gives me "no screens found(EE)". Looking at Xorg.0.log, all messages are informational except the last few lines:


```
(II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
(--) Using syscons driver with X support (version 2.0)
(--) using VT number 9

(EE) No devices detected.
(EE)
Fatal server error:
(EE) no screens found(EE)
Please consult the X.Org Foundation support at http://wiki.x.org
for help.
...
```

Running as root (to rule out a permissions issue) gives the same results.

I figured it may be an issue with the binary package, so I installed x11/nvidia-driver-340 from ports so that it is compiled against my kernel. Same results, no go.

Next, I installed nvidia-xconfig and generated xorg.conf, copied the generated file to /usr/local/etc/X11/xorg.conf. Now every time I run `startx`, the machine immediately reboots (as either root or a regular user).

Has anyone else gotten the nvidia driver to work on their laptop with a 320M card? If not, what is my best option? xf86-video-nv? scfb?


----------



## SirDice (Jun 2, 2021)

The config isn't correct. The busID is wrong, just remove it. You really only need this:

```
Section "Device"
  Identifier "Card0"
  Driver     "nvidia"
EndSection
```



yha said:


> Has anyone else gotten the nvidia driver to work on their laptop with a 320M card?


Not a laptop but a Zotac small form factor PC with a GT 520M and need to use the 390 version. As far as I know there are known issues with the 304 version (it definitely fails with a recent Xorg version). Not entirely sure about the 340 version.


----------



## yha (Jun 3, 2021)

Thanks for the suggestion, but the machine still reboots immediately after `startx` (with or without nvidia-xconfig's xorg.conf).


----------



## Menelkir (Jun 3, 2021)

SirDice said:


> The config isn't correct. The busID is wrong, just remove it. You really only need this:
> 
> ```
> Section "Device"
> ...


390 works fine with modern Xorg for me:
    vendor     = 'NVIDIA Corporation'
    device     = 'GT215M [GeForce GTS 360M]'


----------



## scottro (Jun 4, 2021)

I have sometimes, not always (and with different Nvidia cards than mentioned) had to use the nvidia-xconfig package. In one case, for example, X wouldn't start and the nvidia-xconfig package gave me an xorg.conf that included the BusID (which, until that machine, I had never, ever, needed in several years of installing FreeBSD).  It might be worth a shot.  (though doing pkg search, there may only be a package for nvidia-460.)


----------



## yha (Jun 4, 2021)

Version 390 does not work for me, it explicitly tells me that my card is supported through 340.

Following the advice on this post, I _ktrace_d X and got this vital piece of info:

(EE) Failed to load /usr/local/lib/xorg/modules/drivers/nvidia_drv.so: /usr/local/lib/xorg/modules/drivers/nvidia_drv.so: invalid file format


----------



## bsduck (Jun 8, 2021)

I do have a laptop (HP) with a GT320M but it isn't running FreeBSD. 

Last time I tried, FreeBSD 12.x worked fine with the nvidia driver, except that I couldn't find a way to set the brightness.

Your problem is a good occasion for me to see how FreeBSD 13.0 is doing on that hardware, so I will try soon.


----------



## bsduck (Jun 19, 2021)

So I tried and it still works. Even brightness control works, it just requires acpi_video.ko to be loaded.

Quick summary of the procedure:

fresh install of FreeBSD 13.0
user in groups wheel, operator, video
`# pkg install xorg-minimal xfce nvidia-driver-340 nvidia-xconfig`
`# kldload nvidia acpi_video`
`# nvidia-xconfig`
`$ startxfce4`
... and I get a working desktop.

I don't know why it doesn't work on your MacBook...


----------



## fbsd_ (Jun 20, 2021)

Also
/boot/loader.conf
ADD THIS LINE -> nvidia_load="YES"
/etc/rc.conf
ADD THIS to /etc/rc.conf -> acpi_load="YES"

you would want to add this line to your loader.conf in boot dir which get loads on system boot. It will make system automaticlly load nvidia and acpi_video kernel module on boot so you will not have to load them all the time manually.
You have to install nvidia-driver-340 like bsduck said.





						FreshPorts -- x11/nvidia-driver-340: NVidia graphics card binary drivers for hardware OpenGL rendering
					

These are the official NVidia binary drivers for hardware OpenGL rendering in X11, using the GLX extensions.




					www.freshports.org


----------



## SirDice (Jun 21, 2021)

fbsd_ said:


> /etc/rc.conf
> ADD THIS to /etc/rc.conf -> `acpi_load="YES"`


That's not going to work. Variables with *_load _always_ go in loader.conf. It will not produce an error if you put it in rc.conf but it's not going to load acpi(4) either. Besides that acpi(4) doesn't need to be loaded, it's already included with the GENERIC kernel. 

Now, there's some movement _away_ from loader.conf. You should really only use it to load drivers that are required to boot the machine. Everything else should be loaded with `kld_list` in /etc/rc.conf:

```
kld_list="nvidia"
```



fbsd_ said:


> It will make system automaticlly load nvidia and acpi_video kernel module on boot


There is a difference between acpi(4) and acpi_video(4), those are two separate drivers. And, as I mentioned before, acpi(4) is already included with the GENERIC kernel, there's no need to load it. Loading acpi_video(4) only makes sense on laptops, it does nothing on desktops. But it may not work on your particular model of laptop as controlling the backlight (or switching outputs) very much depends on how it's been implemented by the manufacturer.


----------



## yha (Jul 8, 2021)

I cannot seem to reproduce the crashes/reboots anymore, but I'm still unable to start X. The only bits that are different now is loading acpi_video and adding myself to the operator group. Still no go. Running _ktrace_ still gives that "invalid file format" error.


----------



## Tieks (Jul 8, 2021)

[yha="invalid file format" error[/QUOTE]

Looks like a wrong version or a messed up file. Deinstall it and try again with /usr/ports/x11/nvidia-driver-390. I have that same driver without problems using `kld_list="nvidia-modeset"` in /etc/rc.conf. Make sure there is nothing related to nvidia left in /boot/loader.conf, then reboot.


----------



## Geezer (Jul 8, 2021)

SirDice said:


> The config isn't correct. The busID is wrong, just remove it. You really only need this:
> 
> ```
> Section "Device"
> ...



On my machine, it did not work until I put the BusID line in.


----------



## scottro (Jul 8, 2021)

I also have one machine that didn't work without the BusID. I've found that to be unusual, but it does happen.  On several other machines, it's been unnecessary.


----------



## SirDice (Jul 9, 2021)

I suspect it has something to do with the mainboard having integrated graphics or not. If that's still enabled in the BIOS/UEFI then you basically have two graphics cards in your system. In that case the BusID just tells Xorg which is the right one for the driver.


----------



## yha (Jul 24, 2021)

> Looks like a wrong version or a messed up file. Deinstall it and try again with /usr/ports/x11/nvidia-driver-390. I have that same driver without problems using `kld_list="nvidia-modeset"` in /etc/rc.conf. Make sure there is nothing related to nvidia left in /boot/loader.conf, then reboot.



Like I said in my earlier post, when I try to use version 390, it explicitly tells me that my GPU is (only) supported by version 340.


----------



## VladiBG (Jul 24, 2021)

Did you test if the video card work on the official supported OS? I had similar issue with error 43 on another laptop with dual video cards and it turn out that the NVidia card was broken.


----------



## yha (Jul 24, 2021)

VladiBG said:


> Did you test if the video card work on the official supported OS? I had similar issue with error 43 on another laptop with dual video cards and it turn out that the NVidia card was broken.



Yes, it works just fine under macOS.


----------



## yha (Oct 10, 2021)

So, I tried xf86-video-nv, but that does not support my card. I'd have to use the nouveau driver, which is not available for FreeBSD. In the end, I gave up on getting anything accelerated to work and settled on xf86-video-scfb. For such an old machine, my "benchmark" is to see if I can play a YouTube video. scfb doesn't cut it, but at least I have a graphical display now. I have a dual-boot setup with macOS so I can boot into that if I need to watch YouTube and whatnot.

Thanks for everyone who contributed to this thread.


----------



## jammied (Oct 10, 2021)

Best advice, get rid of ALL X.org configuration files, the existence of ANY X.org config files stops automatic detection of your hardware setup.


----------



## jammied (Oct 10, 2021)

In other words, run rm -R /etc/X11/*

If you are more cautious: mv /etc/X11 /etc/X11-old


----------



## yha (Oct 10, 2021)

jammied said:


> Best advice, get rid of ALL X.org configuration files, the existence of ANY X.org config files stops automatic detection of your hardware setup.



That's how I originally started. There was nothing in /etc/X11/ and /usr/local/etc/X11/(xorg.conf.d/) in my first attempt.


----------



## jammied (Oct 10, 2021)

yha said:


> That's how I originally started. There was nothing in /etc/X11/ and /usr/local/etc/X11/(xorg.conf.d/) in my first attempt.



Ok, there is probably a separate issue. However, I know when I spent ages trying to get my NVIDIA (NVS 510) card working, deleting all X config files, including some I had not noticed where there, is what fixed the issue. The general change in functionality made it pretty obvious that those files needed to be gone.

That said, I had taken several other steps before that which would have likely fixed other issues in the process. What I can lay odds on is though that you unlikely to sort any other issue with the existence of any X config files.

Can you post your /etc/rc.conf though please? For reference, this is what mine looks like (with my NVIDIA card):



> clear_tmp_enable="YES"
> syslogd_flags="-ss"
> sendmail_enable="NONE"
> keymap="uk.kbd"
> ...


If it can't be fixed by further altering your rc.conf in some way, then we can look at other steps (specifically, analysing X logs for any hints specific to your computer). I do see you have already been checking X logs looking more closely at the other posts but essentially, what we are looking for though is any changes in the output to that after various configuration changes.


----------



## jammied (Oct 10, 2021)

Actually, I lie... I do have this config file...
/usr/local/etc/X11/xorg.conf.d/nvidia.conf

which has the following contents:


> Section "Device"
> Identifier "NVIDIA Card"
> VendorName "NVIDIA Corporation"
> Driver "nvidia"
> EndSection


To test, I did try removing it and my desktop didn't completely stopped functioning but I lost my dual screens and basically all the fancy features of my graphics card.


----------



## Jaskie (Oct 10, 2021)

Hi, your specs seem really close to mine. I am running FreeBSD 13 and Nvidia 220M (laptop, no integrated GPU, just nvidia. Legacy BIOS, MBR) with 340 driver from pkg. Nvidia 320M should be fine with 340 driver too I think. When I was installing xorg and nvidia-driver, X won't start either until I installed nvidia-xconfig and generated xorg.conf.  I don't need BusID either, this is the section in `/etc/X11/xorg.conf` :


```
Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    Option         "NoLogo" "true"
    VendorName     "NVIDIA Corporation"
EndSection
```

My `/etc/X11/rc.conf` :


```
zfs_enable="YES"
hostname="freebsd.asus"
wlans_ath0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP"
dbus_enable="YES"
lightdm_enable="YES"
kld_list="nvidia fusefs acpi_asus acpi_asus_wmi acpi_video"
#ifconfig_alc0="DHCP"
clear_tmp_enable="YES"
clear_tmp_X="YES"
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
dumpdev="AUTO"
rc_startmsgs="NO"
background_dhclient="YES"
sshd_enable="YES"
moused_enable="YES"
powerd_enable="YES"
syslogd_flags="-ss"
```


----------



## jammied (Oct 10, 2021)

Jaskie said:


> Hi, your specs seem really close to mine. I am running FreeBSD 13 and Nvidia 220M (laptop, no integrated GPU, just nvidia. Legacy BIOS, MBR) with 340 driver from pkg. Nvidia 320M should be fine with 340 driver too I think. When I was installing xorg and nvidia-driver, X won't start either until I installed nvidia-xconfig and generated xorg.conf.  I don't need BusID either, this is the section in `/etc/X11/xorg.conf` :
> 
> 
> ```
> ...


I am hoping that the OP can extract something out of our configs that gets him to the root of the problem. I know on my PC I had to do some serious messing about to get my Nvidia card working properly but I did eventually get there. I do know the last step that magically fixed everything involved removing a load of config files. I thought I had removed all them altogether but I have realised I do still have one very short config file hanging around which appears to be more important than I remembered...


----------



## Jaskie (Oct 10, 2021)

If I remember it correctly, mine worked as soon as I add `nvidia` to kld_list, the rest was all added later by me.


jammied said:


> I am hoping that the OP can extract something out of our configs that gets him to the root of the problem. I know on my PC I had to do some serious messing about to get my Nvidia card working properly but I did eventually get there.


----------



## grahamperrin@ (Oct 10, 2021)

yha said:


> … installed nvidia-xconfig and generated xorg.conf, copied the generated file to …



My memory (from some time ago) may be wrong, does the utility not put the file in place for you? Without the need to copy.

x11/nvidia-xconfig



> /usr/local/etc/X11/xorg.conf



<https://forums.FreeBSD.org/threads/81493/post-524667> my path to the file differed, if that's significant.


----------



## 3301 (Dec 4, 2021)

In some Macbook's cases it's a problem with UEFI | PCI-express registers. I tried installing FreeBSD 12/13 on my old mid-2010 MacBook Pro (7,1). Followed guide from https://askubuntu.com/questions/264...i-on-mac-to-prevent-overheating/613573#613573 and even set these registers (using pciconf) before loading nvidia driver - no luck. Eventually I gave up and sold this machine. I suspect someone more experienced in FreeBSD internals can find the way, maybe some some changes are required at boot level or kernel source.


----------



## creatxr (Jan 1, 2022)

yha said:


> Deinstall it and try again with /usr/ports/x11/nvidia-driver-390.



in my case, dual video card (nvidia + intel).


not work with "pkg install X11/nvidia-hybrid-graphics"

but work with "pkg install nvidia-hybrid-graphics-0.5"

or, you could try install "nvidia-driver-390" not "X11/nvidia-driver-390"


----------

