Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] cuda & gcc 4.9
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
Xywa
Veteran
Veteran


Joined: 23 Jul 2005
Posts: 1631
Location: /mnt/Gentoo/Europe

PostPosted: Fri Jun 03, 2016 2:55 pm    Post subject: [SOLVED] cuda & gcc 4.9 Reply with quote

Hi,

Did someone was trying this "dirty trick"?
Quote:
If you use gcc 4.9, cuda may not work, complaining that it does not support gcc-4.9 and higher. However, gcc 4.9 happily works after a simple dirty hack: in a file /opt/cuda/include/host_config.h

https://wiki.gentoo.org/wiki/Blender


Last edited by Xywa on Fri Sep 30, 2016 8:41 am; edited 1 time in total
Back to top
View user's profile Send private message
soka
Tux's lil' helper
Tux's lil' helper


Joined: 27 Dec 2006
Posts: 99
Location: Argentina

PostPosted: Sat Jun 04, 2016 3:15 pm    Post subject: Reply with quote

Hi, I modified that header file for cuda 6.5.19 and it has been working without problems.
Back to top
View user's profile Send private message
Xywa
Veteran
Veteran


Joined: 23 Jul 2005
Posts: 1631
Location: /mnt/Gentoo/Europe

PostPosted: Sun Jun 05, 2016 6:12 am    Post subject: Reply with quote

soka wrote:
Hi, I modified that header file for cuda 6.5.19 and it has been working without problems.


How you did this? As I was trying to modify a file from link example, but I do not have this file: /opt/cuda/include/host_config.h
Back to top
View user's profile Send private message
soka
Tux's lil' helper
Tux's lil' helper


Joined: 27 Dec 2006
Posts: 99
Location: Argentina

PostPosted: Sun Jun 05, 2016 3:03 pm    Post subject: Reply with quote

Xywa wrote:
How you did this? As I was trying to modify a file from link example, but I do not have this file: /opt/cuda/include/host_config.h

That header file belongs to nvidia-cuda-toolkit, did you install it along nvidia-cuda-sdk?
Code:
equery b /opt/cuda/include/host_config.h
 * Searching for /opt/cuda/include/host_config.h ...
dev-util/nvidia-cuda-toolkit-6.5.19 (/opt/cuda/include/host_config.h)
Back to top
View user's profile Send private message
Xywa
Veteran
Veteran


Joined: 23 Jul 2005
Posts: 1631
Location: /mnt/Gentoo/Europe

PostPosted: Sat Jun 11, 2016 8:53 am    Post subject: Reply with quote

soka wrote:
That header file belongs to nvidia-cuda-toolkit, did you install it along nvidia-cuda-sdk?


No, but when I woud like to try, gcc-4.8.5 will be installed as well. Will it affect my gcc 4.9.3 already installed?
Code:
# emerge -p nvidia-cuda-sdk

These are the packages that would be merged, in order:

Calculating dependencies   * waiting for lock on /var/db/.pkg.portage_lockfile ...                                                                          [ ok ]
... done!
[ebuild  N     ] media-libs/ilmbase-2.1.0  USE="-static-libs" ABI_X86="(64) -32 (-x32)"
[ebuild  N     ] sys-cluster/openmpi-1.4.3  USE="cxx fortran ipv6 -heterogeneous -mpi-threads -pbs -romio -threads -vt"
[ebuild  N     ] virtual/mpi-2.0-r3  USE="cxx fortran -romio -threads"
[ebuild  N     ] media-libs/freeimage-3.15.4  USE="jpeg mng png tiff -jpeg2k -openexr -raw -static-libs"
[ebuild  NS    ] sys-devel/gcc-4.8.5 [4.9.3] USE="cxx fortran (multilib) nls nptl openmp sanitize (-altivec) (-awt) -debug -doc (-fixed-point) -gcj -go -graphite (-hardened) (-libssp) -mudflap -multislot -nopie -nossp -objc -objc++ -objc-gc -regression-test -vanilla"
[ebuild   R   ~] x11-drivers/nvidia-drivers-364.19  USE="uvm*"
[ebuild  N     ] dev-util/nvidia-cuda-toolkit-6.5.14  USE="-debugger -doc -eclipse -profiler"
[ebuild  N     ] dev-util/nvidia-cuda-sdk-6.5.14  USE="cuda doc examples -debug -opencl"

The following USE changes are necessary to proceed:
 (see "package.use" in the portage(5) man page for more details)
# required by dev-util/nvidia-cuda-toolkit-6.5.14::gentoo
# required by dev-util/nvidia-cuda-sdk-6.5.14::gentoo
# required by nvidia-cuda-sdk (argument)
>=x11-drivers/nvidia-drivers-364.19 uvm
Back to top
View user's profile Send private message
soka
Tux's lil' helper
Tux's lil' helper


Joined: 27 Dec 2006
Posts: 99
Location: Argentina

PostPosted: Sat Jun 11, 2016 2:39 pm    Post subject: Reply with quote

It should be possible to install gcc-4.8.5 without affecting the already installed gcc-4.9.3 as gcc is slotted. You can then change the active gcc profile with gcc-config.
An alternative if you can is to unmask nvidia-cuda-toolkit-7.5.18 and nvidia-cuda-sdk-7.5.18 which depend on gcc < 5.
Back to top
View user's profile Send private message
allistarM
Tux's lil' helper
Tux's lil' helper


Joined: 22 Jul 2004
Posts: 138

PostPosted: Fri Jul 29, 2016 3:21 am    Post subject: Reply with quote

The only way I could get nvidia-cuda-sdk-6.5.14 to install was to recompile freeimage using gcc-4.8.5, the compile cuda with gcc-4.9.3.
Back to top
View user's profile Send private message
Xywa
Veteran
Veteran


Joined: 23 Jul 2005
Posts: 1631
Location: /mnt/Gentoo/Europe

PostPosted: Tue Sep 27, 2016 9:11 pm    Post subject: Reply with quote

allistarM wrote:
The only way I could get nvidia-cuda-sdk-6.5.14 to install was to recompile freeimage using gcc-4.8.5, the compile cuda with gcc-4.9.3.

How to this?

Quote:
An alternative if you can is to unmask nvidia-cuda-toolkit-7.5.18 and nvidia-cuda-sdk-7.5.18 which depend on gcc < 5.

Code:
# emerge -p nvidia-cuda-sdk

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N     ] media-libs/freeimage-3.15.4  USE="jpeg mng png tiff -jpeg2k -openexr -raw -static-libs"
[ebuild  NS   ~] sys-devel/gcc-5.4.0 [4.9.3] USE="cxx fortran (multilib) nls nptl openmp sanitize vtv (-altivec) (-awt) -cilk -debug -doc (-fixed-point) -gcj -go -graphite (-hardened) (-jit) (-libssp) -mpx -nopie -nossp -objc -objc++ -objc-gc -regression-test -vanilla"
[ebuild  N     ] sys-cluster/openmpi-1.4.3  USE="cxx fortran ipv6 -heterogeneous -mpi-threads -pbs -romio -threads -vt"
[ebuild  N     ] virtual/mpi-2.0-r3  USE="cxx fortran -romio -threads"
[ebuild   R   ~] x11-drivers/nvidia-drivers-370.28  USE="uvm*"
[ebuild  N    ~] dev-util/nvidia-cuda-toolkit-7.5.18-r3  USE="-debugger -doc -eclipse -profiler"
[ebuild  N    ~] dev-util/nvidia-cuda-sdk-7.5.18  USE="cuda doc examples -debug -opencl"

The following keyword changes are necessary to proceed:
 (see "package.accept_keywords" in the portage(5) man page for more details)
# required by dev-util/nvidia-cuda-toolkit-7.5.18-r3::cg
# required by dev-util/nvidia-cuda-sdk-7.5.18::gentoo
# required by nvidia-cuda-sdk (argument)
=sys-devel/gcc-5.4.0 ~amd64

The following USE changes are necessary to proceed:
 (see "package.use" in the portage(5) man page for more details)
# required by dev-util/nvidia-cuda-sdk-7.5.18::gentoo[examples]
# required by nvidia-cuda-sdk (argument)
>=x11-drivers/nvidia-drivers-370.28 uvm
Back to top
View user's profile Send private message
soka
Tux's lil' helper
Tux's lil' helper


Joined: 27 Dec 2006
Posts: 99
Location: Argentina

PostPosted: Wed Sep 28, 2016 11:15 am    Post subject: Reply with quote

@Xywa, You are installing dev-util/nvidia-cuda-toolkit-7.5.18-r3 from the cg overlay, dev-util/nvidia-cuda-toolkit-7.5.18-r2 on the official tree depends on gcc < 5.
Back to top
View user's profile Send private message
Xywa
Veteran
Veteran


Joined: 23 Jul 2005
Posts: 1631
Location: /mnt/Gentoo/Europe

PostPosted: Wed Sep 28, 2016 11:25 am    Post subject: Reply with quote

soka wrote:
@Xywa, You are installing dev-util/nvidia-cuda-toolkit-7.5.18-r3 from the cg overlay, dev-util/nvidia-cuda-toolkit-7.5.18-r2 on the official tree depends on gcc < 5.


How is this possible?

I have:
Code:
# layman -l

 * cg                        [Git       ] (https://github.com/brothermechanic/cg.git

but I masked:
Code:
*/*::cgme


Code:
# cat /var/lib/layman/make.conf
PORTDIR_OVERLAY="
/var/lib/layman/cg
$PORTDIR_OVERLAY
"


And I did something for steam client:
Quote:
Install the Steam overlay repository configuration:

root #wget -P /etc/portage/repos.conf/ https://raw.githubusercontent.com/anyc/steam-overlay/master/steam-overlay.conf
Sync the Steam overlay repository:

root #emaint sync --repo steam-overlay


BTW: I masked taht package and the same:
Code:
# emerge nvidia-cuda-sdk
Calculating dependencies... done!
[ebuild  N     ] media-libs/freeimage-3.15.4  USE="jpeg mng png tiff -jpeg2k -openexr -raw -static-libs"
[ebuild  NS   ~] sys-devel/gcc-5.4.0 [4.8.5, 4.9.3] USE="cxx fortran (multilib) nls nptl openmp sanitize vtv (-altivec) (-awt) -cilk -debug -doc (-fixed-point) -gcj -go -graphite (-hardened) (-jit) (-libssp) -mpx -nopie -nossp -objc -objc++ -objc-gc -regression-test -vanilla"
[ebuild  N     ] sys-cluster/openmpi-1.4.3  USE="cxx fortran ipv6 -heterogeneous -mpi-threads -pbs -romio -threads -vt"
[ebuild  N     ] virtual/mpi-2.0-r3  USE="cxx fortran -romio -threads"
[ebuild     U ~] dev-util/nvidia-cuda-toolkit-7.5.18-r2 [6.5.14]
[ebuild  N    ~] dev-util/nvidia-cuda-sdk-7.5.18  USE="cuda doc examples opencl -debug"

The following keyword changes are necessary to proceed:
 (see "package.accept_keywords" in the portage(5) man page for more details)
# required by dev-util/nvidia-cuda-toolkit-7.5.18-r2::cg
# required by dev-util/nvidia-cuda-sdk-7.5.18::gentoo
# required by nvidia-cuda-sdk (argument)
=sys-devel/gcc-5.4.0 ~amd64
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21631

PostPosted: Thu Sep 29, 2016 1:22 am    Post subject: Reply with quote

According to the Portage output, that repository uses the name cg, but you masked all packages from the repository named cgme.
Back to top
View user's profile Send private message
Xywa
Veteran
Veteran


Joined: 23 Jul 2005
Posts: 1631
Location: /mnt/Gentoo/Europe

PostPosted: Fri Sep 30, 2016 8:40 am    Post subject: Reply with quote

Hu wrote:
According to the Portage output, that repository uses the name cg, but you masked all packages from the repository named cgme.


Right, some king of error - thanks for the help. [SOLVED]

BTW: Do you think I have "a working OpenCV-OpenCL" now, as one developer is asking me for this (I have problem with slowmovideo & v3d)?

Code:
*  dev-util/nvidia-cuda-sdk
      Latest version available: 7.5.18
      Latest version installed: 7.5.18
      Size of files: 1,167,407 KiB
      Homepage:      https://developer.nvidia.com/cuda-downloads
      Description:   NVIDIA CUDA Software Development Kit
      License:       CUDPP

*  dev-util/nvidia-cuda-toolkit
      Latest version available: 7.5.18-r2
      Latest version installed: 7.5.18-r2
      Size of files: 1,167,407 KiB
      Homepage:      http://developer.nvidia.com/cuda
      Description:   NVIDIA CUDA Toolkit (compiler and friends)
      License:       NVIDIA-CUDA


Code:
# eselect opencl list
Available OpenCL implementations:
  [1]   mesa
  [2]   nvidia *


Code:
# equery u opencv
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for media-libs/opencv-2.4.12-r1:
 U I
 + + cuda                     : Enable NVIDIA Cuda computations support
 + + eigen                    : Enable usage of dev-cpp/eigen for computations
 - - examples                 : Install examples, usually source code
 + + ffmpeg                   : Enable ffmpeg/libav-based audio/video codec support
 - - gstreamer                : Add support for media-libs/gstreamer (Streaming media)
 + + gtk                      : Add support for x11-libs/gtk+ (The GIMP Toolkit)
 - - ieee1394                 : Enable FireWire/iLink IEEE1394 support (dv, camera, ...)
 - - java                     : Add support for Java
 + + jpeg                     : Add JPEG image support
 - - jpeg2k                   : Support for JPEG 2000, a wavelet-based image compression format
 - - libav                    : Prefer libav over ffmpeg whenever both are supported
 + + opencl                   : Add support for OpenCL
 - - openexr                  : Support for the OpenEXR graphics file format
 + + opengl                   : Add support for OpenGL (3D graphics)
 + + openmp                   : Build support for the OpenMP (support parallel computing), requires >=sys-devel/gcc-4.2
                                built with USE="openmp"
 - - pch                      : Enable precompiled header support for faster compilation at the expense of disk space and
                                memory (>=sys-devel/gcc-3.4 only)
 + + png                      : Add support for libpng (PNG images)
 + + python                   : Add optional support/bindings for the Python language
 + + python_targets_python2_7 : Build with Python 2.7
 - - qt4                      : Add support for the Qt GUI/Application Toolkit version 4.x
 + + qt5                      : Add support for the Qt 5 application and UI framework
 - - testprograms             : Build and install programs for testing OpenCV (performance)
 - - threads                  : Add threads support for various packages. Usually pthreads
 + + tiff                     : Add support for the TIFF image format
 - - v4l                      : Enable support for video4linux (using linux-headers or userspace libv4l libraries)
 - - vtk                      : Build new 3D visualization module viz based on sci-libs/vtk
 - - xine                     : Add support for the XINE movie libraries
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum