# Xorg :0 -configure
Then, I deleted everything related to the new NVidia GPU. It gave the following configuration:
Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
Screen 1 "Screen1" RightOf "Screen0"
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection
Section "Files"
ModulePath "/usr/lib/xorg/modules"
FontPath "/usr/share/fonts/misc"
FontPath "/usr/share/fonts/TTF"
FontPath "/usr/share/fonts/OTF"
FontPath "/usr/share/fonts/Type1"
FontPath "/usr/share/fonts/100dpi"
FontPath "/usr/share/fonts/75dpi"
EndSection
Section "Module"
Load "glx"
EndSection
Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
EndSection
Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/input/mice"
Option "ZAxisMapping" "4 5 6 7"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Monitor Vendor"
ModelName "Monitor Model"
EndSection
Section "Monitor"
Identifier "Monitor1"
VendorName "Monitor Vendor"
ModelName "Monitor Model"
EndSection
Section "Device"
### Available Driver options are:-
### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
### <percent>: "<f>%"
### [arg]: arg optional
#Option "SWcursor" # [<bool>]
#Option "HWcursor" # [<bool>]
#Option "NoAccel" # [<bool>]
#Option "ShadowFB" # [<bool>]
#Option "VideoKey" # <i>
#Option "WrappedFB" # [<bool>]
#Option "GLXVBlank" # [<bool>]
#Option "ZaphodHeads" # <str>
#Option "PageFlip" # [<bool>]
#Option "SwapLimit" # <i>
#Option "AsyncUTSDFS" # [<bool>]
#Option "AccelMethod" # <str>
#Option "DRI" # <i>
Identifier "Card0"
Driver "nouveau"
BusID "PCI:2:0:0"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
SubSection "Display"
Viewport 0 0
Depth 1
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 4
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 8
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 15
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 16
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 24
EndSubSection
EndSection
Section "Screen"
Identifier "Screen1"
Device "Card1"
Monitor "Monitor1"
SubSection "Display"
Viewport 0 0
Depth 1
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 4
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 8
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 15
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 16
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 24
EndSubSection
EndSection
And that works! Thanks you all guys!
]]>Section "Device"
Identifier "nouveau"
#alternatively if installed, instead of the modesetting
#Driver "nouveau"
Driver "modesetting"
BusID "PCI:0:2:0"
EndSection
0 911 G /usr/bin/plasmashell 45MiB
That means that X11 is using the wrong GPU. How to change that?
]]>That suggest only the 315M is bound to the nouveau module .
That's how it looks.
I was probably wrong saying that the first driver to load will grab both GPUs. Actually, since the old GPU is no longer supported by NVIDIA, it seems entirely reasonable that if the proprietary driver loads first, it will completely ignore that old GPU and then nouveau will be able pick it up later.
So nvidia comes first and binds to the 1050Ti, then nouveau takes the internal GPU. The display is driven by nouveau and, guess what, I think there is a chance that cuda may work on the 1050Ti.
I suggest the following checks
dmesg |grep -i nvidia it may say something about what GPUs it found and enabled
ls /sys/module/nvidia/drivers/pci\:nvidia I think this or similar directory should exists and contain 0000:03:00.0
ls /sys/module/nouveau/drivers/pci\:nouveau this directory still shouldn't contain 0000:03:00.0
nvidia-smi -L from nvidia-utils package, lists all GPUs currently accessible through the proprietary driver
try to run any random cuda demo
# ls /sys/module/nouveau/drivers/pci\:nouveau
0000:02:00.0 bind module new_id remove_id uevent unbind
That suggest only the 315M is bound to the nouveau module .
check the output of lspci -k | grep VGA
]]>Thanks for the precision mich41.
To try it anyway, make sure that no X server is running on the 1060 and do
# lspci | grep VGA 01:05.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] RS780L [Radeon 3000] <- note the numbers on the left # echo 0000:01:05.0 > /sys/module/nouveau/drivers/pci\:nouveau/unbind <- yes, you need to add 0000:
This is obviously an integrated Radeon GPU, you are going to use numbers from your 1060.
If this succeeds and the machine doesn't crash, reload nvidiarmmod nvidia modprobe nvidia
Post any errors printed by modprobe or dmesg after nvidia loading, if the machine survives.
So, as asked, I tried what you said. I loaded both nvidia and nouveau. Both are loaded at the same time as shown:
# lsmod
Module Size Used by
nouveau 2187264 1
mxm_wmi 16384 1 nouveau
wmi 28672 2 mxm_wmi,nouveau
i2c_algo_bit 16384 1 nouveau
ttm 126976 1 nouveau
nvidia_drm 53248 0
nvidia_modeset 1040384 1 nvidia_drm
nvidia 17313792 1 nvidia_modeset
[...]
This way, I have access to the nouveau folder:
# ls /sys/module/nouveau/drivers/pci\:nouveau
0000:02:00.0 bind module new_id remove_id uevent unbind
The lspci shows:
# lspci | grep VGA
02:00.0 VGA compatible controller: NVIDIA Corporation GT218M [GeForce 315M] (rev a2)
03:00.0 VGA compatible controller: NVIDIA Corporation GP107 [GeForce GTX 1050 Ti] (rev a1)
and then, I get this weird error:
# echo 0000:03:00.0 > /sys/module/nouveau/drivers/pci\:nouveau/unbind
-bash: echo: write error: No such device
I just don't get it...
(Btw, sorry, it is a 1050, not a 1060. I was hesitating between both during my spending adventure...)
Sadly, it is very tough to make nouveau work back when the nvidia proprietary drivers are loaded. But it finally worked.
Great, getting nouveau to work without uninstalling nvidia is half the job done.
And then, I tried to load the nvidia module by hand. It just won't because of the conflict with nouveau (and nouveau can use the new card). Thus I would need to find a way to unload the module on this specific card, but keeping it running on the other one, and then try to load the nvidia driver. Which is exactly the problem that we try to solve with udev.
I don't think it can be achieved with a udev rule. Problem is, once any of these kernel modules is loaded, it will bind to both devices, regardless of which device triggered the loading of this module. Later the other module will find both devices busy and fail to work. I don't think there is any way to stop that, except by binding the dummy pci-stub driver to the 1060 beforehand, like people do to reserve GPUs for VM passthrough. (Well, technically, you could edit nouveau code and recompile, but come on).
If you are lucky, it may be enough unbind nouveau from the 1060 after it has loaded and then load nvidia, but this approach may also fail for reasons including nouveau being buggy and crashing or nvidia failing to properly initialize a device previously initialized by nouveau.
To try it anyway, make sure that no X server is running on the 1060 and do
# lspci | grep VGA
01:05.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] RS780L [Radeon 3000] <- note the numbers on the left
# echo 0000:01:05.0 > /sys/module/nouveau/drivers/pci\:nouveau/unbind <- yes, you need to add 0000:
This is obviously an integrated Radeon GPU, you are going to use numbers from your 1060.
If this succeeds and the machine doesn't crash, reload nvidia
rmmod nvidia
modprobe nvidia
Post any errors printed by modprobe or dmesg after nvidia loading, if the machine survives.
]]>Sadly, it is very tough to make nouveau work back when the nvidia proprietary drivers are loaded. But it finally worked. And then, I tried to load the nvidia module by hand. It just won't because of the conflict with nouveau (and nouveau can use the new card). Thus I would need to find a way to unload the module on this specific card, but keeping it running on the other one, and then try to load the nvidia driver. Which is exactly the problem that we try to solve with udev.
]]>Finally, I think it may be possible to run nouveau and nvidia side by side.
Make sure the old GPU is the one picked up by BIOS/UEFI. Typically a matter of rearranging them in PCIe slots.
Restore nouveau because that's the graphics stack you will use. If installation of nvidia removed some conflicting packages like mesa, reinstall them (check /var/log/pacman.log for that). If it installed module blacklists, remove them and blacklist nvidia instead (run "pacman -Ql nvidia" to find out what files it installed).
Once you have nouveau graphics running, reserve the 1060 like for GPU passthrough so that nouveau doesn't touch it during boot.
Manually load nvidia kernel module and see what happens. It won't touch the old GPU used by nouveau. It may bitch about nouveau being loaded. If you are lucky, it may still bind to the 1060 though and work with it.
Depending on how exactly the nvidia package is found to interfere with nouveau, some fiddling may be necessary to prevent problems at future updates.
]]>