Ubuntu – Xrandr – fail to set custom screen resolution (Ubuntu 16.04)

displaydisplay-resolutionxorgxrandr

I have followed the steps in this question to add a new custom resolution to my Ubuntu (16.04) machine. I got the same error that the person who asked the question got, however the answer did not solve my problem. Here's what I did:

cvt 1600 900 60

that gave me:

# 1600x900 59.95 Hz (CVT 1.44M9) hsync: 55.99 kHz; pclk: 118.25 MHz Modeline "1600x900_60.00"  118.25  1600 1696 1856 2112  900 903 908 934 -hsync +vsync

I then added the output using xrandr:

sudo xrandr --newmode "1600x900_60.00"  118.25  1600 1696 1856 2112  900 903 908 934 -hsync +vsync

But then, when I tried to add the new mode with:

sudo xrandr --addmode eDP1 1600x900_60.00

I got the following error message:

X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 140 (RANDR) Minor opcode of failed
request: 18 (RRAddOutputMode) Serial number of failed request: 37
Current serial number in output stream: 38

I input the following command to obtain my screen name:

xrandr | grep -e " connected [^(]" | sed -e "s/([A-Z0-9]+) connected.*/\1/"

and obtained

eDP1

Does anyone know a workaround or what is wrong with my commands? I have no xorg.conf file. Do I need it or it should be possible only using xrandr?