# [RISOLTO] errore nel compilare i driver nvidia

## drudox

Salve ho appena compilato il kernel 4.10.0 , ma se provo a compilare i driver nvidia .... ottengo questo errore https://paste.pound-python.org/show/s6adPWOYBLaWqIxxC7Xl/

ho preso la configurazione del vecchio kernel 4.9.5 che compila i driver benissimo e tentato di usarla nei 4.10.0 

(# genkernel --menuconfig all --kernel-config=/usr/src/linux-4.9.5-gentoo/.config)Last edited by drudox on Thu Mar 02, 2017 7:57 pm; edited 1 time in total

----------

## fedeliallalinea

Sembra un problema conosciuto (leggi qui).

Per ovviare devi applicare le seguenti patches

```
# mkdir -p /etc/portage/patches/x11-drivers/nvidia-drivers-378.13

# cd /etc/portage/patches/x11-drivers/nvidia-drivers-378.13

# wget https://gist.githubusercontent.com/tpruzina/c4d9c0ca6bdbb6e78ab2126a7cdf8f1c/raw/38ccd3224f3205e45982c0c217e23d04f9681b49/gistfile1.txt -O nvidia-drivers-378.13-1.patch

# wget https://gist.githubusercontent.com/tpruzina/4a4aef53b266aa04606385b92ca6d042/raw/aaa55b9f6d53aff5624d4d98cd646c12dcba61d8/gistfile1.txt -O nvidia-drivers-378.13-2.patch

# wget https://gist.githubusercontent.com/tpruzina/3e36f7da0673c1bf4b421f53b8d99b02/raw/0c0aaf8bd7e5c8e59d897ec1340d3742174a6f0c/gistfile1.txt -O nvidia-drivers-378.13-3.patch

# emerge -1 =x11-drivers/nvidia-drivers-378.13
```

----------

## drudox

e come le applico le patch ??   :Embarassed: 

----------

## drudox

se faccio solo quello che mi hai scritt ottengo questo : 

```
 [root@quad-Gentoo ../nvidia-drivers-378.13]# emerge -1 =x11-drivers/nvidia-drivers-378.13

Calculating dependencies                                                                           ... done!

>>> Verifying ebuild manifests

>>> Running pre-merge checks for x11-drivers/nvidia-drivers-378.13

 * Determining the location of the kernel source code

 * Found kernel source directory:

 *     /usr/src/linux

 * Found kernel object directory:

 *     /lib/modules/4.10.0-gentoo/build

 * Found sources for kernel version:

 *     4.10.0-gentoo

 * Gentoo supports kernels which are supported by NVIDIA

 * which are limited to the following kernels:

 * <sys-kernel/gentoo-sources-4.10

 * <sys-kernel/vanilla-sources-4.10

 * 

 * You are free to utilize epatch_user to provide whatever

 * support you feel is appropriate, but will not receive

 * support as a result of those changes.

 * 

 * Do not file a bug report about this.

 * 

 * Checking for suitable kernel configuration options...                                      [ ok ]

>>> Emerging (1 of 1) x11-drivers/nvidia-drivers-378.13::gentoo

 * NVIDIA-Linux-x86_64-378.13.run SHA256 SHA512 WHIRLPOOL size ;-) ...                        [ ok ]

 * nvidia-settings-378.13.tar.bz2 SHA256 SHA512 WHIRLPOOL size ;-) ...                        [ ok ]

 * Determining the location of the kernel source code

 * Found kernel source directory:

 *     /usr/src/linux

 * Found kernel object directory:

 *     /lib/modules/4.10.0-gentoo/build

 * Found sources for kernel version:

 *     4.10.0-gentoo

 * Checking for suitable kernel configuration options...                                      [ ok ]

>>> Unpacking source...

>>> Unpacking NVIDIA-Linux-x86_64-378.13.run to /var/tmp/portage/x11-drivers/nvidia-drivers-378.13/work

>>> Unpacking nvidia-settings-378.13.tar.bz2 to /var/tmp/portage/x11-drivers/nvidia-drivers-378.13/work

>>> Source unpacked in /var/tmp/portage/x11-drivers/nvidia-drivers-378.13/work

>>> Preparing source in /var/tmp/portage/x11-drivers/nvidia-drivers-378.13/work ...

 * Applying patches from /etc/portage/patches/x11-drivers/nvidia-drivers-378.13 ...

 *   nvidia-drivers-378.13-1.patch ...                                                        [ ok ]

 *   nvidia-drivers-378.13-2.patch ...

1 out of 2 hunks FAILED -- saving rejects to file kernel/common/inc/nv-mm.h.rej

5 out of 5 hunks FAILED -- saving rejects to file kernel/nvidia/nv-p2p.c.rej

4 out of 4 hunks FAILED -- saving rejects to file kernel/nvidia/nv-pat.c.rej

16 out of 16 hunks FAILED -- saving rejects to file kernel/nvidia-drm/nvidia-drm-fence.c.rej

1 out of 2 hunks FAILED -- saving rejects to file kernel/nvidia-drm/nvidia-drm-gem.h.rej

1 out of 1 hunk FAILED -- saving rejects to file kernel/nvidia-drm/nvidia-drm-modeset.c.rej

1 out of 2 hunks FAILED -- saving rejects to file kernel/nvidia-drm/nvidia-drm-priv.h.rej

2 out of 2 hunks FAILED -- saving rejects to file kernel/nvidia-uvm/uvm8_test.c.rej           [ !! ]

 * ERROR: x11-drivers/nvidia-drivers-378.13::gentoo failed (prepare phase):

 *   patch -p1  failed with /etc/portage/patches/x11-drivers/nvidia-drivers-378.13/nvidia-drivers-378.13-2.patch

 * 

 * Call stack:

 *               ebuild.sh, line  115:  Called src_prepare

 *             environment, line 5020:  Called eapply_user

 *             environment, line 1283:  Called eapply '/etc/portage/patches/x11-drivers/nvidia-drivers-378.13'

 *             environment, line 1260:  Called _eapply_patch '/etc/portage/patches/x11-drivers/nvidia-drivers-378.13/nvidia-drivers-378.13-2.patch' '  '

 *             environment, line 1202:  Called __helpers_die 'patch -p1  failed with /etc/portage/patches/x11-drivers/nvidia-drivers-378.13/nvidia-drivers-378.13-2.patch'

 *   isolated-functions.sh, line  117:  Called die

 * The specific snippet of code:

 *         die "$@"

 * 

 * If you need support, post the output of `emerge --info '=x11-drivers/nvidia-drivers-378.13::gentoo'`,

 * the complete build log and the output of `emerge -pqv '=x11-drivers/nvidia-drivers-378.13::gentoo'`.

 * The complete build log is located at '/var/tmp/portage/x11-drivers/nvidia-drivers-378.13/temp/build.log'.

 * The ebuild environment file is located at '/var/tmp/portage/x11-drivers/nvidia-drivers-378.13/temp/environment'.

 * Working directory: '/var/tmp/portage/x11-drivers/nvidia-drivers-378.13/work'

 * S: '/var/tmp/portage/x11-drivers/nvidia-drivers-378.13/work/'

>>> Failed to emerge x11-drivers/nvidia-drivers-378.13, Log file:

>>>  '/var/tmp/portage/x11-drivers/nvidia-drivers-378.13/temp/build.log'

 * Messages for package x11-drivers/nvidia-drivers-378.13:

 * Gentoo supports kernels which are supported by NVIDIA

 * which are limited to the following kernels:

 * <sys-kernel/gentoo-sources-4.10

 * <sys-kernel/vanilla-sources-4.10

 * 

 * You are free to utilize epatch_user to provide whatever

 * support you feel is appropriate, but will not receive

 * support as a result of those changes.

 * 

 * Do not file a bug report about this.

 * 

 * Messages for package x11-drivers/nvidia-drivers-378.13:

 * ERROR: x11-drivers/nvidia-drivers-378.13::gentoo failed (prepare phase):

 *   patch -p1  failed with /etc/portage/patches/x11-drivers/nvidia-drivers-378.13/nvidia-drivers-378.13-2.patch

 * 

 * Call stack:

 *               ebuild.sh, line  115:  Called src_prepare

 *             environment, line 5020:  Called eapply_user

 *             environment, line 1283:  Called eapply '/etc/portage/patches/x11-drivers/nvidia-drivers-378.13'

 *             environment, line 1260:  Called _eapply_patch '/etc/portage/patches/x11-drivers/nvidia-drivers-378.13/nvidia-drivers-378.13-2.patch' '  '

 *             environment, line 1202:  Called __helpers_die 'patch -p1  failed with /etc/portage/patches/x11-drivers/nvidia-drivers-378.13/nvidia-drivers-378.13-2.patch'

 *   isolated-functions.sh, line  117:  Called die

 * The specific snippet of code:

 *         die "$@"

 * 

 * If you need support, post the output of `emerge --info '=x11-drivers/nvidia-drivers-378.13::gentoo'`,

 * the complete build log and the output of `emerge -pqv '=x11-drivers/nvidia-drivers-378.13::gentoo'`.

 * The complete build log is located at '/var/tmp/portage/x11-drivers/nvidia-drivers-378.13/temp/build.log'.

 * The ebuild environment file is located at '/var/tmp/portage/x11-drivers/nvidia-drivers-378.13/temp/environment'.

 * Working directory: '/var/tmp/portage/x11-drivers/nvidia-drivers-378.13/work'

 * S: '/var/tmp/portage/x11-drivers/nvidia-drivers-378.13/work/'

```

ed ecco il build.log 

```
https://paste.pound-python.org/show/zfwrYxcUKTCGnfjcowyx/
```

----------

## fedeliallalinea

Scusa mio errore, non ho testato quelle patch. Fai questi passi

```
# rm /etc/portage/patches/x11-drivers/nvidia-drivers-378.13/*

# cd /etc/portage/patches/x11-drivers/nvidia-drivers-378.13/

# wget https://gist.githubusercontent.com/tpruzina/3e36f7da0673c1bf4b421f53b8d99b02/raw/0c0aaf8bd7e5c8e59d897ec1340d3742174a6f0c/gistfile1.txt -O nvidia-kernel-4.10.patch

# emerge -1 =x11-drivers/nvidia-drivers-378.13
```

----------

## drudox

Grazie Mille !! risolto !   :Very Happy: 

----------

## drudox

@fedeliallalinea ho aperto un post su problemi nell aggiornare world ! tu che mi sei stato salvatore nello stesso problema puoi dare un occhiata ? Grazie

----------

