Skip to content

Instantly share code, notes, and snippets.

View corndog2000's full-sized avatar

Joe Schroedl corndog2000

View GitHub Profile
@corndog2000
corndog2000 / configure_cuda_p70.md
Created June 28, 2020 03:58 — forked from alexlee-gk/configure_cuda_p70.md
Use integrated graphics for display and NVIDIA GPU for CUDA on Ubuntu 14.04

This was tested on a ThinkPad P70 laptop with an Intel integrated graphics and an NVIDIA GPU:

lspci | egrep 'VGA|3D'
00:02.0 VGA compatible controller: Intel Corporation Device 191b (rev 06)
01:00.0 VGA compatible controller: NVIDIA Corporation GM204GLM [Quadro M3000M] (rev a1)

A reason to use the integrated graphics for display is if installing the NVIDIA drivers causes the display to stop working properly. In my case, Ubuntu would get stuck in a login loop after installing the NVIDIA drivers. This happened regardless if I installed the drivers from the "Additional Drivers" tab in "System Settings" or the ppa:graphics-drivers/ppa in the command-line.

// gps_read.c
// Joe Schroedl
// February 25, 2020
// https://gist.github.com/corndog2000/5caa522f9a8fc75bb9d61e518d4d1cb8
#include <stdio.h>
#include <sys/types.h>
#include <termios.h>
#include <fcntl.h>
#include <stdlib.h>