Skip to content

Instantly share code, notes, and snippets.

View install-nvidia-opencl-drivers-for-linux.sh
sudo apt-get install nvidia-opencl-dev
@cmey
cmey / ubuntu-on-MBP15
Created May 10, 2018
Installing Ubuntu on MBP15
View ubuntu-on-MBP15
# wifi
sudo apt-get install bcmwl-kernel-source
@cmey
cmey / install-mpv-on-ubuntu1604.txt
Last active May 9, 2018
workaround to install mpv on Ubuntu 16.04
View install-mpv-on-ubuntu1604.txt
# If you get the error:
# The following packages have unmet dependencies:
# mpv : Depends: libva-x11-1 (>= 1.0.3) but it is not going to be installed
# E: Unable to correct problems, you have held broken packages.
# Workaround:
sudo aptitude install mpv
# Accept this solution?
View gist:2c7f616fe5fe84a85b34d4c502709165
Intel® Core™ i7-7567U CPU @ 3.50GHz × 4
Intel® Iris Plus Graphics 650 (Kaby Lake GT3e)
Number of platforms 2
Platform Name Intel(R) OpenCL
Platform Vendor Intel(R) Corporation
Platform Version OpenCL 2.0
Platform Profile FULL_PROFILE
Platform Extensions cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_depth_images cl_khr_fp64 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_icd cl_khr_image2d_from_buffer cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_spir
@cmey
cmey / README.txt
Created Mar 21, 2018
Ubuntu on Mac TouchBar
View README.txt
MacBookPro14,2: MacBookPro 13 Retina with Touchbar
Model A1706 EMC 3163
Serial C02v8055HV2V
no keyboard
no touch pad
no touch bar
no wifi (bad signal)
cb22/macbook12-spi-drivers ("applespi")
@cmey
cmey / install-intel-opencl-drivers-for-linux.sh
Last active Apr 11, 2021
Intel OpenCL drivers for Linux
View install-intel-opencl-drivers-for-linux.sh
# get OpenCL driver automated installer (installs kernel 4.7)
curl https://software.intel.com/sites/default/files/managed/f6/77/install_OCL_driver.sh_.txt > install_OCL_driver.sh
chmod +x install_OCL_driver.sh
# install OpenCL driver
sudo ./install_OCL_driver.sh install
# check
ls /boot/vmlinuz-*intel*
@cmey
cmey / update_user_params.py
Last active Sep 21, 2016
Generalized params update function
View update_user_params.py
def update_params(params):
# update params if user said 'auto', otherwise take user specified value
# a first try at reusing for all params the same code for that logic
for param_key, param_value in params.items():
actual_key = 'actual_' + param_key
# Is this a param that has a user mode?
has_user_mode = actual_key in params
if has_user_mode:
if param_value is 'user-forced':
# we could even do more checks here, maybe param-specific
@cmey
cmey / reikna_bug_fortran_order.py
Last active May 4, 2016
Reikna FFT produces unexpected transposed result when either input or output is Fortran-ordered
View reikna_bug_fortran_order.py
import itertools
import numpy as np
from numpy.fft import fftn as npfftn
from numpy.testing import assert_array_almost_equal
import pyopencl as cl
import pyopencl.array
from reikna import cluda
from reikna.fft import FFT as reikna_FFT
# Select device
@cmey
cmey / butterflycount.jl
Last active Aug 29, 2015
Implementation of count (in Julia v0.3)
View butterflycount.jl
# Implementation of count (in Julia v0.3)
# Christophe MEYER 2015
# count the number of times v appears in the sorted vector A
function count(A, v)
assert(issorted(A))
lower = findbound(A, v, :lower)
upper = findbound(A, v, :upper)
found = lower > 0 && upper > 0
if found