This document describes how to install nvidia drivers & CUDA in one go on a fresh debian install.
Work in progress
- Start with a fresh Debian install.
| ARCH=$(uname -m) | |
| which bc | |
| if [ $? -ne 0 ]; then | |
| echo "This script require GNU bc, cf. http://www.gnu.org/software/bc/" | |
| echo "On Linux Debian/Ubuntu you can install it by doing : apt-get install bc" | |
| fi | |
| echo "Update sysctl for $host" |
| This file provides some nifty command-line tools around DD-WRT's nvram command. | |
| https://www.dd-wrt.com/wiki/index.php/Hardware#NVRAM | |
| USE WITH CAUTION: fiddling with nvram can wipe your settings and you may loose access to your router. | |
| Hint 1: Different version of DD-WRT might use different nvram variables. Thus, be carefull when updating. | |
| Hint 2: The commands listed below should be issued via a ssh-connection since the webinterface for issuing commands might time out for the longer commands. | |
| Background | |
| ========== | |
| Extracting the content of configuration variables with nvram would provide an easy way of selective backup/restore of settings. However, listing the content of the nvram via | |
| nvram show |
| # Kernel sysctl configuration file for Red Hat Linux | |
| # | |
| # For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and | |
| # sysctl.conf(5) for more details. | |
| # | |
| # Use '/sbin/sysctl -a' to list all possible parameters. | |
| # Controls IPv4 Security | |
| net.ipv4.ip_forward=0 | |
| net.ipv4.conf.all.send_redirects=0 |
| #include <string.h> | |
| #include <stdlib.h> | |
| #include <unistd.h> | |
| #include <mach-o/dyld.h> | |
| #include <mach-o/nlist.h> | |
| #include <mach-o/dyld_images.h> | |
| #include <mach/mach_vm.h> | |
| /* Dyld is the OSX Dynamic Linker | |
| * /usr/include//mach-o/loader.h |
| % it creates a simple gray image (4x4) | |
| I = [255, 255, 30, 100 | |
| 255, 50, 90, 20 | |
| 70, 70, 20, 10 | |
| 100, 20, 10, 0]; | |
| % it converts it to grayscale | |
| I = mat2gray(I); | |
| % shows it | |
| imshow(I); |
| //: Playground - noun: a place where code can play | |
| import UIKit | |
| //Most precise time keeper | |
| // for more information on the benchmarks go to www.kandelvijaya.com | |
| func timeBlockWithMach(_ block: () -> Void) -> TimeInterval { | |
| var info = mach_timebase_info() | |
| guard mach_timebase_info(&info) == KERN_SUCCESS else { return -1 } |
NOTE (2022-07-09): Xcode finally added this functionality in Xcode 14, please see release notes here:
New Features in Xcode 14 Beta 3
When editing code, the Edit > Duplicate menu item and its corresponding keyboard shortcut now duplicate the selected text — or the line that currently contains the insertion point, if no text is selected. (8614499) (FB5618491)
| # The trick is to link the DeviceSupport folder from the beta to the stable version. | |
| # sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :) | |
| # Support iOS 15 devices (Xcode 13.0) with Xcode 12.5: | |
| sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport | |
| # Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions | |
| # (A similar approach works for older versions too, just change the version number after DeviceSupport) |
In this article, I will share some of my experience on installing NVIDIA driver and CUDA on Linux OS. Here I mainly use Ubuntu as example. Comments for CentOS/Fedora are also provided as much as I can.