Differences between revisions 11 and 13 (spanning 2 versions)
Revision 11 as of 2020-09-11 09:09:07
Size: 2276
Editor: bonaccos
Comment:
Revision 13 as of 2022-06-29 09:19:50
Size: 2297
Editor: bonaccos
Comment: Add formating for code parts
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
=== Compiling OpenGL/ NVidia CUDA-based applications on Debian Linux === == Compiling OpenGL/ NVidia CUDA-based applications on Debian Linux ==
Line 9: Line 10:
==== Libraries ==== === Libraries ===
Line 11: Line 12:
 * The /usr/lib/x86_64-linux-gnu/libGL*.so OpenGL libraries are symbolic links to the hardware-specific libraries. There is a mechanism in the starup process of each client workstation which detects the accurate OpenGL library based on the information about the graphics card and the kernel driver. The CUDA runtime libraries are found in the same directory.  * The `/usr/lib/x86_64-linux-gnu/libGL*.so` OpenGL libraries are symbolic links to the hardware-specific libraries. There is a mechanism in the starup process of each client workstation which detects the accurate OpenGL library based on the information about the graphics card and the kernel driver. The CUDA runtime libraries are found in the same directory.
Line 13: Line 14:
==== Header Files ====
 * The OpenGL headers are found under /usr/include/GL. For NVidia programming, a CUDA toolkit that should work with the installed NVidia graphics card is installed (CUDA headers in /usr/include).
=== Header Files ===
 * The OpenGL headers are found under `/usr/include/GL`. For NVidia programming, a CUDA toolkit that should work with the installed NVidia graphics card is installed (CUDA headers in `/usr/include`).
Line 16: Line 17:
==== Compiling sources and linking against NVidia libraries ==== === Compiling sources and linking against NVidia libraries ===
Line 18: Line 19:
 * No special CFLAGS/ CXXFLAGS and LDFLAGS must be set. The required headers and libraries are all found under the standard system paths. If you use an own OpenGL/ CUDA toolkit, e.g. installed in your home, make sure it is compatible with the graphics driver/ hardware installed on the system. Note: if you don't have brand new hardware in your computer, the most current CUDA release most probably won't work with it - use an older relase or ask ISG.EE if you are in doubt about the right version.
 * Then set CFLAGS (for C-compiler), CXXFLAGS (for C++ compiler) and LDFLAGS (linker flags) as follows: {{{
 * No special `CFLAGS`,`CXXFLAGS` and `LDFLAGS` must be set. The required headers and libraries are all found under the standard system paths. If you use an own OpenGL/ CUDA toolkit, e.g. installed in your home, make sure it is compatible with the graphics driver/ hardware installed on the system. Note: if you don't have brand new hardware in your computer, the most current CUDA release most probably won't work with it - use an older relase or ask ISG.EE if you are in doubt about the right version.
 * Then set `CFLAGS` (for C-compiler), `CXXFLAGS` (for C++ compiler) and `LDFLAGS` (linker flags) as follows:
Line 21: Line 22:
Assume you have installed the toolkit under /home/$USER/toolkit, then set the mentioned environment variables
in your Debian shell (bash, tcsh, ...) as follows, before you start compiling/ linking:
   Assume you have installed the toolkit under `/home/$USER/toolkit`, then set the mentioned environment variables in your Debian shell (`bash`, `tcsh`, ...) as follows, before you start compiling/ linking:
   {{{
Line 27: Line 27:
}}}
   `$USER` must of course be replaced with your ETH (login-)username.
Line 28: Line 30:
$USER must of course be replaced with your ETH (login-) username.
}}}

==== Reccomendation ====
=== Reccomendation ===

OpenGL

Compiling OpenGL/ NVidia CUDA-based applications on Debian Linux

The Debian platform managed by ISG.EE uses the following directory layout for the OpenGL libraries and headers:

Libraries

  • The /usr/lib/x86_64-linux-gnu/libGL*.so OpenGL libraries are symbolic links to the hardware-specific libraries. There is a mechanism in the starup process of each client workstation which detects the accurate OpenGL library based on the information about the graphics card and the kernel driver. The CUDA runtime libraries are found in the same directory.

Header Files

  • The OpenGL headers are found under /usr/include/GL. For NVidia programming, a CUDA toolkit that should work with the installed NVidia graphics card is installed (CUDA headers in /usr/include).

Compiling sources and linking against NVidia libraries

  • No special CFLAGS,CXXFLAGS and LDFLAGS must be set. The required headers and libraries are all found under the standard system paths. If you use an own OpenGL/ CUDA toolkit, e.g. installed in your home, make sure it is compatible with the graphics driver/ hardware installed on the system. Note: if you don't have brand new hardware in your computer, the most current CUDA release most probably won't work with it - use an older relase or ask ISG.EE if you are in doubt about the right version.

  • Then set CFLAGS (for C-compiler), CXXFLAGS (for C++ compiler) and LDFLAGS (linker flags) as follows:

    • Assume you have installed the toolkit under /home/$USER/toolkit, then set the mentioned environment variables in your Debian shell (bash, tcsh, ...) as follows, before you start compiling/ linking:

      export CFLAGS="-I/home/$USER/toolkit/include"
      export CXXFLAGS="$CFLAGS"
      export LDFLAGS="-L/home/$USER/toolkit/lib -Wl,-rpath,/home/$USER/toolkit/lib"

      $USER must of course be replaced with your ETH (login-)username.

Reccomendation

That said we encourage the use of CUDA Toolkit within Conda environments. More details can be found in the Working with GPU or CPU in data sciences and Conda subpages of this wiki.


CategoryLXSW

Programming/Libraries/OpenGL (last edited 2023-10-16 13:36:41 by alders)